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
4d94a6cf
Commit
4d94a6cf
authored
Aug 25, 2021
by
Thodoris Nestoridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix inferencing process
parent
26eddc62
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
main_req.py
reqtool/reqman/api/reqman/apps/reqtool/models/main_req.py
+1
-1
inference.py
...an/api/reqman/apps/reqtool/rest_api/services/inference.py
+1
-1
parse_ontologies.py
...reqman/apps/reqtool/rest_api/services/parse_ontologies.py
+8
-2
No files found.
reqtool/reqman/api/reqman/apps/reqtool/models/main_req.py
View file @
4d94a6cf
...
...
@@ -49,7 +49,7 @@ QUANTIFIER_CHOICES = ( ("NONE","NONE"), ("ALL", "ALL"), ("ONLY", "ONLY"),
(
"MORE THAN"
,
"MORE THAN"
),
(
"LESS THAN"
,
"LESS THAN"
),
(
"EXACTLY"
,
"EXACTLY"
),
(
"AT LEAST"
,
"AT LEAST"
),
(
"AT MOST"
,
"AT MOST"
)
)
NUMBER_UNITS_CHOICES
=
((
""
,
""
),(
"m/s"
,
"m/s"
),
(
"m/s^2"
,
"m/s^2"
),
(
"m/s^3"
,
"m/s^3"
),
(
"rad"
,
"rad"
),
(
"rad/s"
,
"rad/s"
),
(
"Hz"
,
"Hz"
),
(
"METERS"
,
"METERS"
),
(
"KILOMETERS"
,
"KILOMETERS"
),
(
"VOLT"
,
"VOLT"
))
NUMBER_UNITS_CHOICES
=
((
""
,
""
),(
"m/s"
,
"m/s"
),
(
"m/s^2"
,
"m/s^2"
),
(
"m/s^3"
,
"m/s^3"
),
(
"rad"
,
"rad"
),
(
"rad/s"
,
"rad/s"
),
(
"Hz"
,
"Hz"
),
(
"METERS"
,
"METERS"
),
(
"KILOMETERS"
,
"KILOMETERS"
),
(
"VOLT"
,
"VOLT"
)
,
(
"Number"
,
"Number"
)
)
#ITEM
ITEM_CHOICES
=
get_instances
(
"SAO#Item"
)
ITEM_CLASSES_COMMENTS
=
get_dmo_classes_and_comment
(
"SAO#Item"
)
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/services/inference.py
View file @
4d94a6cf
...
...
@@ -43,7 +43,7 @@ def inferencing(project, boilerlate, prefix, main, suffix):
if
title
in
infer_result
[
met
]:
metrics
[
title
]
.
append
(
met
)
metrics
.
update
(
infer_result
)
return
metrics
return
(
metrics
,
ontology_with_new_req
)
def
exportboiltottl
(
project
,
prefix
,
boilerplate
,
main
,
suffix
):
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/services/parse_ontologies.py
View file @
4d94a6cf
...
...
@@ -120,9 +120,9 @@ def get_instances(keyword):
out_list
.
append
(
spl
[
len
(
spl
)
-
1
])
#new code
out_list
.
append
(
extra
)
#return tuple((str(keywordspl[len(keywordspl)-1]+" : "+n), str(keywordspl[len(keywordspl)-1]+" : "+n) ) for n in (out_list))
return
tuple
((
str
(
keywordspl
[
len
(
keywordspl
)
-
1
]
+
" : "
+
out_list
[
n
+
1
]
+
" : "
+
out_list
[
n
]),
str
(
keywordspl
[
len
(
keywordspl
)
-
1
]
+
" : "
+
out_list
[
n
+
1
]
+
" : "
+
out_list
[
n
])
)
for
n
in
range
(
0
,
len
(
out_list
),
2
))
# A list with the values and the file that is the instance
out_list
=
[]
# A dict with all the info of classes, subclasses and instances
...
...
@@ -137,6 +137,12 @@ def get_file_and_instances(keyword):
spliter_1
=
data
.
split
(
'$'
)
spliter_2
=
spliter_1
[
0
]
.
split
(
"#"
)
in_list
.
append
(
spliter_2
[
len
(
spliter_2
)
-
1
])
for
extra
in
in_list
:
for
uri
in
list_of_DSO
:
per
=
URIRef
(
uri
+
extra
)
for
s
,
p
,
o
in
g
.
triples
((
None
,
RDFS
.
subClassOf
,
per
)):
#subClassOf
spl
=
s
.
split
(
"#"
)
in_list
.
append
(
spl
[
len
(
spl
)
-
1
])
for
extra
in
in_list
:
for
uri
in
list_of_DSO
:
per
=
URIRef
(
uri
+
extra
)
...
...
@@ -171,7 +177,7 @@ def get_dmo_instance_and_comment(keyword):
mid_list
.
append
(
spl
[
len
(
spl
)
-
1
])
dmo_dic
=
{
'Class'
:
extra
,
'instance'
:
spl
[
len
(
spl
)
-
1
]}
dic_list
.
append
(
dmo_dic
)
#need to find if instances have comment with their descr
eption!!!!!
#need to find if instances have comment with their descr
iption
#for now it returns only the instances
for
extra
in
mid_list
:
for
uri
in
list_of_DSO
:
...
...
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