Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
Requirement Formalization Tool
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thodoris Nestoridis
Requirement Formalization Tool
Commits
c78fb6f5
Commit
c78fb6f5
authored
Jan 25, 2021
by
Thodoris Nestoridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
find values in Ontologies
parent
887d0dc7
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7122 additions
and
19 deletions
+7122
-19
Mokos_18_1_7_47.ttl
reqtool/Ontologies/Mokos_18_1_7_47.ttl
+7023
-0
example.ttl
reqtool/Ontologies/example.ttl
+35
-0
main_req.py
reqtool/reqman/api/reqman/apps/reqtool/models/main_req.py
+4
-1
parse_ontologies.py
...reqman/apps/reqtool/rest_api/services/parse_ontologies.py
+28
-0
dict_RBO.py
reqtool/test_scripts/dict_RBO.py
+32
-18
No files found.
reqtool/Ontologies/Mokos_18_1_7_47.ttl
0 → 100644
View file @
c78fb6f5
This diff is collapsed.
Click to expand it.
reqtool/Ontologies/example.ttl
0 → 100644
View file @
c78fb6f5
DSO:
Spacecraft
a
owl:
Class
;
rdfs:
comment
"Abreviation: S/C\r\nSimilar: Satellite"
;
rdfs:
subClassOf
SAO:
System
;
rdfs:
subClassOf
[
a
owl:
Restriction
;
owl:
cardinality
"0"
^^
xsd:
nonNegativeInteger
;
owl:
onProperty
SAO:
isContainedIn
]
;
owl:
disjointWith
DSO:
Actuator
,
DSO:
AttitudeAndOrbitControlSystem
,
DSO:
ElectricalPowerSystem
,
DSO:
MassMemoryUnit
,
DSO:
PayloadSystem
,
DSO:
Sensor
,
DSO:
Software
,
DSO:
TelecommunicationSystem
,
DSO:
ThermalSystem
.
DSO:
TelecommunicationSystem
a
owl:
Class
;
rdfs:
comment
"The subsystem which is responsible for the communication of the satellite to and from the ground."
;
rdfs:
subClassOf
SAO:
System
;
rdfs:
subClassOf
[
a
owl:
Restriction
;
owl:
allValuesFrom
DSO:
Spacecraft
;
owl:
onProperty
SAO:
isContainedIn
]
;
owl:
disjointWith
DSO:
Actuator
,
DSO:
AttitudeAndOrbitControlSystem
,
DSO:
ElectricalPowerSystem
,
DSO:
MassMemoryUnit
,
DSO:
PayloadSystem
,
DSO:
Sensor
,
DSO:
Software
,
DSO:
Spacecraft
,
DSO:
ThermalSystem
.
DSO-AOCS-instances:
DISABLED
a
SAO:
StateValue
;
SAO:
belongsTo
DSO-AOCS-instances:
Enable_Disable_State
.
SAO:
StateValue
a
owl:
Class
;
rdfs:
comment
""
;
rdfs:
label
""
;
rdfs:
subClassOf
RBO:
StateValue
,
SAO:
IdentifiedConcept
,
SAO:
StateConcept
;
owl:
disjointWith
SAO:
System
,
SAO:
Function
,
SAO:
Item
,
SAO:
StateSet
,
SAO:
State
,
SAO:
Connection
,
SAO:
Flow
,
SAO:
Interface
.
SAO:
belongsTo
a
owl:
InverseFunctionalProperty
;
rdfs:
domain
SAO:
StateValue
;
rdfs:
range
SAO:
StateSet
.
DSO-AOCS-instances:
Enable_Disable_State
a
SAO:
StateSet
.
\ No newline at end of file
reqtool/reqman/api/reqman/apps/reqtool/models/main_req.py
View file @
c78fb6f5
...
...
@@ -4,6 +4,8 @@ from reqman.apps.account.models import User
from
pygments.formatters.html
import
HtmlFormatter
from
pygments
import
highlight
from
reqman.apps.reqtool.rest_api.services.parse_ontologies
import
*
MAIN_CHOICES
=
(
(
""
,
""
),
(
"M1"
,
"M1 : system/function shall [not] set [<quantifier>] item [to stateValue]"
),
(
"M2"
,
"M2 : system/function shall [not] set state to stateValue"
),
...
...
@@ -24,7 +26,8 @@ MAIN_CHOICES = ( ("",""), ("M1", "M1 : system/function shall [not] set [<quant
)
#to be updated with domains from DSO
SYSTEM_CHOICES
=
((
"SYSTEM"
,
"SYSTEM"
),
(
"SYSTEM2"
,
"SYSTEM2"
))
#SYSTEM_CHOICES = (("SYSTEM", "SYSTEM"), ("SYSTEM2", "SYSTEM2"))
SYSTEM_CHOICES
=
get_keyword
(
"SAO:System"
)
FUNCTION_CHOICES
=
((
"FUNCTION"
,
"FUNCTION"
),
(
"FUNCTION2"
,
"FUNCTION2"
))
SHALL_CHOICES
=
(
(
"shall"
,
"SHALL"
),
(
"shall not"
,
"SHALL NOT"
))
QUANTIFIER_CHOICES
=
(
(
"none"
,
"NONE"
),
(
"all"
,
"ALL"
),
(
"only"
,
"ONLY"
),
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/services/parse_ontologies.py
0 → 100644
View file @
c78fb6f5
IS_SAO_SYSTEM
=
"SAO:System"
list_of_DSO
=
[
"DSO"
,
"DSO-AOCS"
,
"DSO-AOCS-instances"
]
system_list
=
[]
'''Return the Systems from the Ontologies'''
def
get_keyword
(
keyword
):
with
open
(
"../../Ontologies/Mokos_18_1_7_47.ttl"
)
as
f
:
for
dso
in
list_of_DSO
:
flag_1
,
flag_2
=
0
,
0
for
line
in
f
:
if
line
.
startswith
(
dso
):
spliter_1
=
line
.
split
(
':'
)
spliter_2
=
spliter_1
[
1
]
.
split
(
' '
)
key
=
spliter_2
[
0
]
.
strip
()
flag_1
=
1
if
flag_1
==
1
:
if
keyword
in
line
:
flag_2
=
1
if
flag_1
==
1
and
flag_2
==
1
:
if
(
line
.
strip
())
.
endswith
(
'.'
):
system_list
.
append
(
key
)
flag_1
,
flag_2
=
0
,
0
if
(
line
.
strip
())
.
endswith
(
'.'
):
flag_1
,
flag_2
=
0
,
0
return
tuple
((
str
(
n
),
str
(
n
))
for
n
in
system_list
)
reqtool/test_scripts/dict_RBO.py
View file @
c78fb6f5
d
=
{}
flag
=
1
val
=
[
""
,
""
,
""
]
key
=
""
with
open
(
"../../../Desktop/foceta-auth/Ontologies/RDO_AOCS/RBO.ttl"
)
as
f
:
IS_SAO_SYSTEM
=
"SAO:System"
list_of_DSO
=
[
"DSO"
,
"DSO-AOCS"
,
"DSO-AOCS-instances"
]
system_list
=
[]
'''Return the Systems from the Ontologies'''
def
get_keyword
(
keyword
):
with
open
(
"../Ontologies/Mokos_18_1_7_47.ttl"
)
as
f
:
for
dso
in
list_of_DSO
:
flag_1
,
flag_2
=
0
,
0
for
line
in
f
:
if
line
.
startswith
(
"RBO:"
):
key
=
line
flag
=
0
if
flag
==
0
:
if
"subClassOf RBO"
in
line
:
val
=
line
.
split
(
':'
)
elif
line
.
startswith
(
"."
):
flag
=
1
d
[
key
]
=
val
[
2
]
print
(
d
)
if
line
.
startswith
(
dso
):
spliter_1
=
line
.
split
(
':'
)
spliter_2
=
spliter_1
[
1
]
.
split
(
' '
)
key
=
spliter_2
[
0
]
.
strip
()
flag_1
=
1
if
flag_1
==
1
:
if
keyword
in
line
:
flag_2
=
1
if
flag_1
==
1
and
flag_2
==
1
:
if
(
line
.
strip
())
.
endswith
(
'.'
):
if
not
key
in
system_list
:
system_list
.
append
(
key
)
flag_1
,
flag_2
=
0
,
0
if
(
line
.
strip
())
.
endswith
(
'.'
):
flag_1
,
flag_2
=
0
,
0
return
system_list
#tuple((str(n), str(n)) for n in system_list)
def
subClassOfRbo
():
m
=
get_keyword
(
IS_SAO_SYSTEM
)
for
i
in
m
:
get_keyword
(
i
)
print
(
system_list
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment