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
bf053d5f
Commit
bf053d5f
authored
Mar 01, 2023
by
Thodoris Nestoridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix error with prefix main
parent
5438962c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
inference.py
...an/api/reqman/apps/reqtool/rest_api/services/inference.py
+17
-13
No files found.
reqtool/reqman/api/reqman/apps/reqtool/rest_api/services/inference.py
View file @
bf053d5f
...
...
@@ -25,10 +25,11 @@ def getinstancefile(data, g):
out_list
=
get_file_and_instances
(
'SAO#'
+
datam
[
0
]
.
strip
(),
g
)
for
j
in
range
(
0
,(
len
(
out_list
)
-
1
),
2
):
if
(
datam
[
len
(
datam
)
-
2
]
.
strip
()
+
' : '
+
datam
[
len
(
datam
)
-
1
]
.
strip
()
)
in
out_list
[
j
]:
if
(
datam
[
len
(
datam
)
-
2
]
.
strip
()
+
' : '
+
datam
[
len
(
datam
)
-
1
]
.
strip
()
)
in
out_list
[
j
]:
splitter
=
out_list
[
j
]
.
split
(
" : "
)
instance_file
=
out_list
[
j
+
1
]
break
if
(
splitter
[
len
(
splitter
)
-
1
]
==
datam
[
len
(
datam
)
-
1
]
.
strip
()):
instance_file
=
out_list
[
j
+
1
]
break
return
instance_file
,
splitter
...
...
@@ -91,29 +92,32 @@ def exportboiltottl(ontfile,project, prefix, boilerplate, main, suffix):
if
(
boilerplate
[
i
][
0
][
'has_prefix'
]
==
True
):
#If the requirement has Prefix
g
.
add
((
per_instances
+
title
,
rdo
+
'hasPrefix'
,
per_instances
+
(
title
+
"_"
+
prefix
[
i
][
0
][
'simple_prefix'
])))
g
.
add
((
per_instances
+
(
title
+
"_"
+
prefix
[
i
][
0
][
'simple_prefix'
]),
RDF
.
type
,
rbo
+
prefix
[
i
][
0
][
'simple_prefix'
]))
prefixsub_splitter
=
prefix
[
i
][
0
][
'system_fun_item'
]
.
split
(
" : "
)
prefix_attr_splitter
=
prefix
[
i
][
0
][
'item_function_flow_statevalue'
]
.
split
(
" : "
)
#prefixsub_splitter = prefix[i][0]['system_fun_item'].split(" : ")
prefixsub_instance_file
,
prefixsub_splitter
=
getinstancefile
(
prefix
[
i
][
0
][
'system_fun_item'
],
g
)
prefixattr_instance_file
,
prefix_attr_splitter
=
getinstancefile
(
prefix
[
i
][
0
][
'item_function_flow_statevalue'
],
g
)
#prefix_attr_splitter = prefix[i][0]['item_function_flow_statevalue'].split(" : ")
prefixverb_instance_file
,
prefix_verb_splitter
=
getinstancefile
(
prefix
[
i
][
0
][
'item_function_flow_statevalue'
],
g
)
prefix_verb_splitter
=
prefix
[
i
][
0
][
'state_or_verb'
]
.
split
(
" : "
)
if
(
prefix_verb_splitter
[
0
]
==
'State'
):
g
.
add
(
(
per_instances
+
(
title
+
"_"
+
prefix
[
i
][
0
][
'simple_prefix'
]),
rbo
+
"isRelatedToLogicalExpression"
,
(
per_instances
+
(
"SystemStateValueContraint_"
+
title
))))
g
.
add
((
per_instances
+
(
"SystemStateValueContraint_"
+
title
),
RDF
.
type
,
(
per_instances
+
(
"SystemStateValueContraint"
))))
g
.
add
((
per_instances
+
(
"SystemStateValueContraint_"
+
title
),
rbo
+
"isRelatedToState"
,
rbo
+
prefix_verb_splitter
[
len
(
prefix_verb_splitter
)
-
1
]
.
strip
()))
g
.
add
((
per_instances
+
(
"SystemStateValueContraint_"
+
title
),
rbo
+
"isRelatedToSystem"
,
rbo
+
prefixsub_splitter
[
len
(
prefixsub_splitter
)
-
1
]
.
strip
()))
g
.
add
((
per_instances
+
(
"SystemStateValueContraint_"
+
title
),
rbo
+
"isRelatedToStateValue"
,
rbo
+
prefix_attr_splitter
[
len
(
prefix_attr_splitter
)
-
1
]
.
strip
()))
g
.
add
((
per_instances
+
(
"SystemStateValueContraint_"
+
title
),
rbo
+
"isRelatedToState"
,
URIRef
(
str
(
prefixverb_instance_file
))
+
"#"
+
prefix_verb_splitter
[
len
(
prefix_verb_splitter
)
-
1
]
.
strip
()))
g
.
add
((
per_instances
+
(
"SystemStateValueContraint_"
+
title
),
rbo
+
"isRelatedToSystem"
,
URIRef
(
str
(
prefixsub_instance_file
))
+
"#"
+
prefixsub_splitter
[
len
(
prefixsub_splitter
)
-
1
]
.
strip
()))
g
.
add
((
per_instances
+
(
"SystemStateValueContraint_"
+
title
),
rbo
+
"isRelatedToStateValue"
,
URIRef
(
str
(
prefixattr_instance_file
))
+
"#"
+
prefix_attr_splitter
[
len
(
prefix_attr_splitter
)
-
1
]
.
strip
()))
elif
(
prefix_attr_splitter
[
0
]
==
"StateValue"
):
g
.
add
(
(
per_instances
+
(
title
+
"_"
+
prefix
[
i
][
0
][
'simple_prefix'
]),
rbo
+
"isRelatedToLogicalExpression"
,
(
per_instances
+
(
"ItemStateValueContraint_"
+
title
))))
g
.
add
((
per_instances
+
(
"ItemStateValueContraint_"
+
title
),
RDF
.
type
,
(
per_instances
+
(
"ItemStateValueContraint"
))))
g
.
add
((
per_instances
+
(
"ItemStateValueContraint_"
+
title
),
rbo
+
"isRelatedToTraversingConcept"
,
rbo
+
prefixsub_splitter
[
len
(
prefixsub_splitter
)
-
1
]
.
strip
()))
g
.
add
((
per_instances
+
(
"ItemStateValueContraint_"
+
title
),
rbo
+
"isRelatedToStateValue"
,
rbo
+
prefix_attr_splitter
[
len
(
prefix_attr_splitter
)
-
1
]
.
strip
()))
g
.
add
((
per_instances
+
(
"ItemStateValueContraint_"
+
title
),
rbo
+
"isRelatedToTraversingConcept"
,
URIRef
(
str
(
prefixsub_instance_file
))
+
"#"
+
prefixsub_splitter
[
len
(
prefixsub_splitter
)
-
1
]
.
strip
()))
g
.
add
((
per_instances
+
(
"ItemStateValueContraint_"
+
title
),
rbo
+
"isRelatedToStateValue"
,
URIRef
(
str
(
prefixattr_instance_file
))
+
"#"
+
prefix_attr_splitter
[
len
(
prefix_attr_splitter
)
-
1
]
.
strip
()))
else
:
g
.
add
((
per_instances
+
(
title
+
"_"
+
prefix
[
i
][
0
][
'simple_prefix'
]),
rbo
+
"isRelatedToOccuringFunctionality"
,
per_instances
+
(
prefix_verb_splitter
[
0
]
+
"OccuringFunctionality"
+
title
)))
g
.
add
((
per_instances
+
(
prefix_verb_splitter
[
0
]
+
"OccuringFunctionality"
+
title
),
RDF
.
type
,
(
per_instances
+
(
prefix_verb_splitter
[
0
]
+
"OccuringFunctionality"
))))
g
.
add
((
per_instances
+
(
prefix_verb_splitter
[
0
]
+
"OccuringFunctionality"
+
title
),
rbo
+
"isRelatedToAction"
,
lo
+
prefix_verb_splitter
[
len
(
prefix_verb_splitter
)
-
1
]
.
strip
()))
g
.
add
((
per_instances
+
(
prefix_verb_splitter
[
0
]
+
"OccuringFunctionality"
+
title
),
rbo
+
"isRelatedToStimulus"
,
rbo
+
prefixsub_splitter
[
len
(
prefixsub_splitter
)
-
1
]
.
strip
()))
g
.
add
((
per_instances
+
(
prefix_verb_splitter
[
0
]
+
"OccuringFunctionality"
+
title
),
rbo
+
"isRelatedToStimulus"
,
URIRef
(
str
(
prefixsub_instance_file
))
+
"#"
+
prefixsub_splitter
[
len
(
prefixsub_splitter
)
-
1
]
.
strip
()))
if
(
prefix_attr_splitter
[
0
]
==
'Item'
):
g
.
add
((
per_instances
+
(
prefix_verb_splitter
[
0
]
+
"OccuringFunctionality"
+
title
),
rbo
+
"isRelatedToTraversingConcept"
,
rbo
+
prefix_attr_splitter
[
len
(
prefix_attr_splitter
)
-
1
]
.
strip
()))
g
.
add
((
per_instances
+
(
prefix_verb_splitter
[
0
]
+
"OccuringFunctionality"
+
title
),
rbo
+
"isRelatedToTraversingConcept"
,
URIRef
(
str
(
prefixattr_instance_file
))
+
"#"
+
prefix_attr_splitter
[
len
(
prefix_attr_splitter
)
-
1
]
.
strip
()))
elif
(
prefix_attr_splitter
[
0
]
==
'Function'
):
g
.
add
((
per_instances
+
(
prefix_verb_splitter
[
0
]
+
"OccuringFunctionality"
+
title
),
rbo
+
"isRelatedToFunction"
,
rbo
+
prefix_attr_splitter
[
len
(
prefix_attr_splitter
)
-
1
]
.
strip
()))
g
.
add
((
per_instances
+
(
prefix_verb_splitter
[
0
]
+
"OccuringFunctionality"
+
title
),
rbo
+
"isRelatedToFunction"
,
URIRef
(
str
(
prefixattr_instance_file
))
+
"#"
+
prefix_attr_splitter
[
len
(
prefix_attr_splitter
)
-
1
]
.
strip
()))
#Quantifier
if
prefix
[
i
][
0
][
'prefix_quantifier'
]
!=
""
:
numunit
=
prefix
[
i
][
0
][
"prefix_mumerical_units"
]
.
split
(
":"
)
...
...
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