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
f2622a8f
Commit
f2622a8f
authored
Jan 25, 2021
by
Thodoris Nestoridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
find the system list
parent
c78fb6f5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
18 deletions
+65
-18
main_req.py
reqtool/reqman/api/reqman/apps/reqtool/models/main_req.py
+1
-1
parse_ontologies.py
...reqman/apps/reqtool/rest_api/services/parse_ontologies.py
+29
-7
dict_RBO.py
reqtool/test_scripts/dict_RBO.py
+35
-10
No files found.
reqtool/reqman/api/reqman/apps/reqtool/models/main_req.py
View file @
f2622a8f
...
@@ -27,7 +27,7 @@ MAIN_CHOICES = ( ("",""), ("M1", "M1 : system/function shall [not] set [<quant
...
@@ -27,7 +27,7 @@ MAIN_CHOICES = ( ("",""), ("M1", "M1 : system/function shall [not] set [<quant
#to be updated with domains from DSO
#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"
)
SYSTEM_CHOICES
=
find_extra_keywords
(
"SAO:System"
)
FUNCTION_CHOICES
=
((
"FUNCTION"
,
"FUNCTION"
),
(
"FUNCTION2"
,
"FUNCTION2"
))
FUNCTION_CHOICES
=
((
"FUNCTION"
,
"FUNCTION"
),
(
"FUNCTION2"
,
"FUNCTION2"
))
SHALL_CHOICES
=
(
(
"shall"
,
"SHALL"
),
(
"shall not"
,
"SHALL NOT"
))
SHALL_CHOICES
=
(
(
"shall"
,
"SHALL"
),
(
"shall not"
,
"SHALL NOT"
))
QUANTIFIER_CHOICES
=
(
(
"none"
,
"NONE"
),
(
"all"
,
"ALL"
),
(
"only"
,
"ONLY"
),
QUANTIFIER_CHOICES
=
(
(
"none"
,
"NONE"
),
(
"all"
,
"ALL"
),
(
"only"
,
"ONLY"
),
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/services/parse_ontologies.py
View file @
f2622a8f
IS_SAO_SYSTEM
=
"SAO:System"
IS_SAO_SYSTEM
=
"SAO:System"
list_of_DSO
=
[
"DSO"
,
"DSO-AOCS"
,
"DSO-AOCS-instances"
]
list_of_DSO
=
[
"DSO"
,
"DSO-AOCS"
,
"DSO-AOCS-instances"
]
system_list
=
[]
'''Return the Systems from the Ontologies'''
'''Return the Systems from the Ontologies'''
def
get_keyword
(
keyword
):
def
get_keyword
(
keyword
):
system_list
=
[]
with
open
(
"../../Ontologies/Mokos_18_1_7_47.ttl"
)
as
f
:
with
open
(
"../../Ontologies/Mokos_18_1_7_47.ttl"
)
as
f
:
for
dso
in
list_of_DSO
:
for
dso
in
list_of_DSO
:
flag_1
,
flag_2
=
0
,
0
flag_1
,
flag_2
=
0
,
0
...
@@ -15,14 +16,35 @@ def get_keyword(keyword):
...
@@ -15,14 +16,35 @@ def get_keyword(keyword):
key
=
spliter_2
[
0
]
.
strip
()
key
=
spliter_2
[
0
]
.
strip
()
flag_1
=
1
flag_1
=
1
if
flag_1
==
1
:
if
flag_1
==
1
:
if
keyword
in
line
:
if
':'
in
keyword
:
if
keyword
in
line
and
"subClassOf"
in
line
:
flag_2
=
1
elif
not
':'
in
keyword
:
keyword
=
':'
+
keyword
if
keyword
in
line
and
"subClassOf"
in
line
:
flag_2
=
1
flag_2
=
1
if
flag_1
==
1
and
flag_2
==
1
:
if
flag_1
==
1
and
flag_2
==
1
:
if
(
line
.
strip
())
.
endswith
(
'.'
):
if
(
line
.
strip
())
.
endswith
(
'.'
):
if
not
key
in
system_list
:
system_list
.
append
(
key
)
system_list
.
append
(
key
)
flag_1
,
flag_2
=
0
,
0
flag_1
,
flag_2
=
0
,
0
if
(
line
.
strip
())
.
endswith
(
'.'
):
if
(
line
.
strip
())
.
endswith
(
'.'
)
and
not
((
line
.
strip
())
.
startswith
(
'-'
)
or
(
line
.
strip
())
.
startswith
(
'rdfs:comment'
))
:
flag_1
,
flag_2
=
0
,
0
flag_1
,
flag_2
=
0
,
0
return
tuple
((
str
(
n
),
str
(
n
))
for
n
in
system_list
)
return
system_list
def
find_extra_keywords
(
keyword
):
first_search
=
get_keyword
(
keyword
)
second_search
=
first_search
.
copy
()
for
i
in
first_search
:
k
=
get_keyword
(
i
)
for
kl
in
k
:
if
not
kl
in
second_search
:
second_search
.
append
(
kl
)
third_search
=
second_search
.
copy
()
for
i
in
second_search
:
k
=
get_keyword
(
i
)
for
kl
in
k
:
if
not
kl
in
third_search
:
third_search
.
append
(
kl
)
return
tuple
((
str
(
n
),
str
(
n
))
for
n
in
third_search
)
\ No newline at end of file
reqtool/test_scripts/dict_RBO.py
View file @
f2622a8f
IS_SAO_SYSTEM
=
"
SAO:System
"
IS_SAO_SYSTEM
=
"
:Interface
"
list_of_DSO
=
[
"DSO"
,
"DSO-AOCS"
,
"DSO-AOCS-instances"
]
list_of_DSO
=
[
"DSO"
,
"DSO-AOCS"
,
"DSO-AOCS-instances"
]
system_list
=
[]
'''Return the Systems from the Ontologies'''
'''Return the Systems from the Ontologies'''
def
get_keyword
(
keyword
):
def
get_keyword
(
keyword
):
system_list
=
[]
with
open
(
"../Ontologies/Mokos_18_1_7_47.ttl"
)
as
f
:
with
open
(
"../Ontologies/Mokos_18_1_7_47.ttl"
)
as
f
:
for
dso
in
list_of_DSO
:
for
dso
in
list_of_DSO
:
flag_1
,
flag_2
=
0
,
0
flag_1
,
flag_2
=
0
,
0
...
@@ -15,20 +16,44 @@ def get_keyword(keyword):
...
@@ -15,20 +16,44 @@ def get_keyword(keyword):
key
=
spliter_2
[
0
]
.
strip
()
key
=
spliter_2
[
0
]
.
strip
()
flag_1
=
1
flag_1
=
1
if
flag_1
==
1
:
if
flag_1
==
1
:
if
keyword
in
line
:
if
':'
in
keyword
:
if
keyword
in
line
and
"subClassOf"
in
line
:
flag_2
=
1
elif
not
':'
in
keyword
:
keyword
=
':'
+
keyword
if
keyword
in
line
and
"subClassOf"
in
line
:
flag_2
=
1
flag_2
=
1
if
flag_1
==
1
and
flag_2
==
1
:
if
flag_1
==
1
and
flag_2
==
1
:
if
(
line
.
strip
())
.
endswith
(
'.'
):
if
(
line
.
strip
())
.
endswith
(
'.'
):
if
not
key
in
system_list
:
if
not
key
in
system_list
:
system_list
.
append
(
key
)
system_list
.
append
(
key
)
flag_1
,
flag_2
=
0
,
0
flag_1
,
flag_2
=
0
,
0
if
(
line
.
strip
())
.
endswith
(
'.'
):
if
(
line
.
strip
())
.
endswith
(
'.'
)
and
not
((
line
.
strip
())
.
startswith
(
'-'
)
or
(
line
.
strip
())
.
startswith
(
'rdfs:comment'
))
:
flag_1
,
flag_2
=
0
,
0
flag_1
,
flag_2
=
0
,
0
return
system_list
#tuple((str(n), str(n)) for n in system_list)
return
system_list
#tuple((str(n), str(n)) for n in system_list)
def
find_extra_keywords
(
keyword
):
first_search
=
get_keyword
(
keyword
)
second_search
=
first_search
.
copy
()
for
i
in
first_search
:
k
=
get_keyword
(
i
)
print
(
i
)
print
(
k
)
for
kl
in
k
:
if
not
kl
in
second_search
:
second_search
.
append
(
kl
)
third_search
=
second_search
.
copy
()
for
i
in
second_search
:
k
=
get_keyword
(
i
)
print
(
i
)
print
(
k
)
for
kl
in
k
:
if
not
kl
in
third_search
:
third_search
.
append
(
kl
)
return
tuple
((
str
(
n
),
str
(
n
))
for
n
in
third_search
)
m
=
get_keyword
(
IS_SAO_SYSTEM
)
print
(
find_extra_keywords
(
IS_SAO_SYSTEM
))
for
i
in
m
:
print
(
get_keyword
(
IS_SAO_SYSTEM
))
get_keyword
(
i
)
\ No newline at end of file
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