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
c53b3dfa
Commit
c53b3dfa
authored
Feb 03, 2021
by
Thodoris Nestoridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refresh models
parent
d879829f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
18 deletions
+17
-18
main_req.py
reqtool/reqman/api/reqman/apps/reqtool/models/main_req.py
+10
-12
requirements.py
...ool/reqman/api/reqman/apps/reqtool/models/requirements.py
+3
-3
suffix_req.py
reqtool/reqman/api/reqman/apps/reqtool/models/suffix_req.py
+1
-1
instances.py
reqtool/test_scripts/instances.py
+3
-2
No files found.
reqtool/reqman/api/reqman/apps/reqtool/models/main_req.py
View file @
c53b3dfa
...
...
@@ -37,10 +37,13 @@ QUANTIFIER_CHOICES = ( ("none","NONE"), ("all", "ALL"), ("only", "ONLY"),
NUMBER_UNITS_CHOICES
=
((
""
,
""
),
(
"meters"
,
"METERS"
),
(
"kilometers"
,
"KILOMETERS"
),
(
"volt"
,
"VOLT"
))
ITEM_CHOICES
=
get_instances
(
"SAO#Item"
)
STATE_VALUE_CHOICES
=
get_instances
(
"SAO#StateValue"
)
STATE_CHOICES
=
get_instances
(
"SAO#State"
)
#tuple( [ x for x in find_extra_keywords(":State", 2) if x not in STATE_VALUE_CHOICES ])
STATE_CHOICES
=
get_instances
(
"SAO#State"
)
#state set not working
STATE_SET_CHOICES
=
get_instances
(
"SAO#StateSet"
)
FLOW_CHOICES
=
get_instances
(
"SAO#Flow"
)
INTERFACE_CHOICES
=
get_instances
(
"SAO#Interface"
)
CONNECTION_CHOICES
=
get_instances
(
"SAO#Connection"
)
#add automatic function ot get verbs
VERB_CHOICES
=
((
"set"
,
"set"
),(
"send"
,
"send"
),(
"receive"
,
"receive"
),(
"ingest"
,
"ingest"
),(
"emit"
,
"emit"
),(
"perform"
,
"perform"
),(
"invoke"
,
"invoke"
),
(
"present"
,
"present"
),(
"transfer"
,
"transfer"
),(
"interact with"
,
"interact with"
),(
"have state"
,
"have state"
),(
"have substate"
,
"have substate"
),
(
"take values from"
,
"take values from"
),(
"be composed"
,
"be composed"
),(
"contain"
,
"contain"
))
...
...
@@ -70,26 +73,21 @@ class Main(models.Model):
boilerplate_of_main
=
models
.
ForeignKey
(
'reqtool.Boilerplate'
,
related_name
=
'main_boilerplate'
,
on_delete
=
models
.
CASCADE
)
main_owner
=
models
.
ForeignKey
(
User
,
related_name
=
'main_owner'
,
on_delete
=
models
.
CASCADE
)
#Subject
sys_fun_inter
=
models
.
CharField
(
choices
=
SYSTEM_
FUNCTION_
INTERFACE_CHOICES
,
max_length
=
100
)
sys_fun_inter
=
models
.
CharField
(
choices
=
SYSTEM_
CHOICES
+
FUNCTION_CHOICES
+
INTERFACE_CHOICES
,
max_length
=
100
)
#Between Subject - Verb
state_
before_verb
=
models
.
CharField
(
choices
=
STATE
_CHOICES
,
max_length
=
100
,
blank
=
True
)
state_
item_before_verb
=
models
.
CharField
(
choices
=
STATE_CHOICES
+
ITEM
_CHOICES
,
max_length
=
100
,
blank
=
True
)
statevalue_before_verb
=
models
.
CharField
(
choices
=
STATE_VALUE_CHOICES
,
max_length
=
100
,
blank
=
True
)
item_before_verb
=
models
.
CharField
(
choices
=
ITEM_CHOICES
,
max_length
=
100
,
blank
=
True
)
#Verb
shall
=
models
.
CharField
(
choices
=
SHALL_CHOICES
,
max_length
=
100
)
verb
=
models
.
CharField
(
choices
=
VERB_CHOICES
,
max_length
=
100
)
#Between Verb - Object
quantifier
=
models
.
CharField
(
choices
=
QUANTIFIER_CHOICES
,
max_length
=
100
,
blank
=
True
)
numerical
=
models
.
IntegerField
(
default
=
0
,
blank
=
True
)
mumerical_units
=
models
.
CharField
(
choices
=
NUMBER_UNITS_CHOICES
,
max_length
=
100
)
item
=
models
.
CharField
(
choices
=
ITEM_CHOICES
,
max_length
=
100
,
blank
=
True
)
state
=
models
.
CharField
(
choices
=
STATE_CHOICES
,
max_length
=
100
,
blank
=
True
)
statevalue
=
models
.
CharField
(
choices
=
STATE_VALUE_CHOICES
,
max_length
=
100
,
blank
=
True
)
numerical
=
models
.
IntegerField
(
blank
=
True
,
null
=
True
)
mumerical_units
=
models
.
CharField
(
choices
=
NUMBER_UNITS_CHOICES
,
max_length
=
100
,
blank
=
True
)
#Οbject
#add stateSet
flow_function_interface_item_system_state
=
models
.
CharField
(
choices
=
FLOW_FUNCTION_INTERFACE_ITEM_SYSTEM_STATE_CHOICES
,
max_length
=
100
,
blank
=
True
)
flow_function_interface_item_system_state_stateset
=
models
.
CharField
(
choices
=
FLOW_CHOICES
+
FUNCTION_CHOICES
+
INTERFACE_CHOICES
+
ITEM_CHOICES
+
SYSTEM_CHOICES
+
STATE_CHOICES
+
STATE_SET_CHOICES
,
max_length
=
100
)
#last definitions
connection
=
models
.
CharField
(
choices
=
CONNECTION
_CHOICES
,
max_length
=
100
,
blank
=
True
)
statevalue_system_connection_stateset
=
models
.
CharField
(
choices
=
STATE_VALUE_CHOICES
+
SYSTEM_CHOICES
+
CONNECTION_CHOICES
+
STATE_SET
_CHOICES
,
max_length
=
100
,
blank
=
True
)
#ID [M1-M16]
main_choices
=
models
.
CharField
(
choices
=
MAIN_CHOICES
,
max_length
=
100
)
...
...
reqtool/reqman/api/reqman/apps/reqtool/models/requirements.py
View file @
c53b3dfa
from
django.db
import
models
#from reqman.apps.common.models import CoreModel
from
reqman.apps.account.models
import
User
from
reqman.apps.reqtool.models.main_req
import
create_main
,
ITEM_CHOICES
,
STATE_VALUE_CHOICES
,
STATE_CHOICES
,
SYSTEM_CHOICES
,
SYSTEM_OR_FUNCTION_CHOICES
,
ITEM_FLOW_FUNCTION
from
reqman.apps.reqtool.models.main_req
import
create_main
,
ITEM_CHOICES
,
STATE_VALUE_CHOICES
,
STATE_CHOICES
,
SYSTEM_CHOICES
,
FUNCTION_CHOICES
,
FLOW_CHOICES
from
reqman.apps.reqtool.models.suffix_req
import
create_suffix
from
pygments.formatters.html
import
HtmlFormatter
...
...
@@ -93,13 +93,13 @@ class Prefix(models.Model):
prefix_boilerplate
=
models
.
ForeignKey
(
Boilerplate
,
related_name
=
'prefix_boilerplate'
,
on_delete
=
models
.
CASCADE
)
prefix
=
models
.
CharField
(
choices
=
PREFIX_CHOICES
,
max_length
=
100
)
#state value constraint
system_fun_item
=
models
.
CharField
(
choices
=
(
ITEM_CHOICES
+
SYSTEM_
OR_
FUNCTION_CHOICES
),
max_length
=
100
,
blank
=
True
)
system_fun_item
=
models
.
CharField
(
choices
=
(
ITEM_CHOICES
+
SYSTEM_
CHOICES
+
FUNCTION_CHOICES
),
max_length
=
100
,
blank
=
True
)
state_or_verb
=
models
.
CharField
(
choices
=
STATE_CHOICES
+
VERB_CHOICES
,
max_length
=
100
,
blank
=
True
)
#state_value = models.CharField(choices=STATE_VALUE_CHOICES, max_length=100, blank=True)
#occuring functionality
#sys_fun = models.CharField(choices=, max_length=100, blank=True)
#verb = models.CharField(choices=VERB_CHOICES, max_length=100, blank=True)
item_function_flow_statevalue
=
models
.
CharField
(
choices
=
ITEM_
FLOW_FUNCTION
+
STATE_VALUE_CHOICES
,
max_length
=
100
,
blank
=
True
)
item_function_flow_statevalue
=
models
.
CharField
(
choices
=
ITEM_
CHOICES
+
FLOW_CHOICES
+
FUNCTION_CHOICES
+
STATE_VALUE_CHOICES
,
max_length
=
100
,
blank
=
True
)
#Prefix value P1/P2/P3
logical_expression
=
models
.
CharField
(
choices
=
LOGICAL_EXPRESSION
,
max_length
=
100
,
blank
=
True
)
#Info for prefix
...
...
reqtool/reqman/api/reqman/apps/reqtool/models/suffix_req.py
View file @
c53b3dfa
...
...
@@ -50,7 +50,7 @@ class Suffix(models.Model):
#prefix templates
s_choices
=
models
.
CharField
(
choices
=
S_CHOICES
,
max_length
=
100
,
blank
=
True
)
#if S1
numerical
=
models
.
IntegerField
(
default
=
0
,
blank
=
True
)
numerical
=
models
.
IntegerField
(
blank
=
True
,
null
=
True
)
mumerical_units
=
models
.
CharField
(
choices
=
NUMBER_UNITS_CHOICES
,
max_length
=
100
,
blank
=
True
)
time_units
=
models
.
CharField
(
choices
=
TIME_UNITS_CHOICES
,
max_length
=
100
,
blank
=
True
)
#if S2/S3
...
...
reqtool/test_scripts/instances.py
View file @
c53b3dfa
...
...
@@ -23,10 +23,11 @@ for subj, obj in g.subject_objects(predicate=RDFS.subClassOf):
subClass
=
subj
+
"$"
+
obj
+
"
\n
"
file2
.
write
(
subClass
)
l
=
get_instances
(
"SAO#System"
)
l
=
get_instances
(
"SAO#StateSet"
)
print
(
l
)
for
i
in
l
:
p
=
URIRef
(
"http://delab.csd.auth.gr/ontologies/2018/
DSO#"
+
i
)
p
=
URIRef
(
"http://delab.csd.auth.gr/ontologies/2018/
SAO#StateSet"
)
for
s
,
p
,
o
in
g
.
triples
((
None
,
RDF
.
type
,
p
)):
print
(
s
)
...
...
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