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
20927d60
Commit
20927d60
authored
Jun 07, 2021
by
Thodoris Nestoridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RFT Bugs (edit title, double choices, verbs)
parent
153ae27e
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
76 additions
and
29 deletions
+76
-29
boilerplate-details.component.html
...ts/boilerplate-details/boilerplate-details.component.html
+1
-0
boilerplate-details.component.ts
...ents/boilerplate-details/boilerplate-details.component.ts
+2
-1
main-details.component.html
...c/app/components/main-details/main-details.component.html
+4
-4
main-details.component.ts
...src/app/components/main-details/main-details.component.ts
+24
-11
prefix-details.component.ts
...app/components/prefix-details/prefix-details.component.ts
+10
-5
suffix-details.component.ts
...app/components/suffix-details/suffix-details.component.ts
+6
-3
boilerplate.model.ts
reqtool/ReqmanAngular11/src/app/models/boilerplate.model.ts
+1
-0
main_req.py
reqtool/reqman/api/reqman/apps/reqtool/models/main_req.py
+2
-1
inference.py
...an/api/reqman/apps/reqtool/rest_api/services/inference.py
+2
-2
parse_ontologies.py
...reqman/apps/reqtool/rest_api/services/parse_ontologies.py
+19
-0
main_req_views.py
.../api/reqman/apps/reqtool/rest_api/views/main_req_views.py
+1
-1
requirements_views.py
.../reqman/apps/reqtool/rest_api/views/requirements_views.py
+4
-1
No files found.
reqtool/ReqmanAngular11/src/app/components/boilerplate-details/boilerplate-details.component.html
View file @
20927d60
...
...
@@ -21,6 +21,7 @@
class=
"form-control"
required
[(
ngModel
)]="
currentboilerplate
.
title
"
(
change
)="
this
.
updateBoilerplate
()"
style=
"width: 63%;"
/>
</div>
<div
style=
"display: flex; flex-grow: grow; margin-top: 50px; "
>
...
...
reqtool/ReqmanAngular11/src/app/components/boilerplate-details/boilerplate-details.component.ts
View file @
20927d60
import
{
Component
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
ActivatedRoute
,
Router
}
from
'@angular/router'
;
import
{
Boilerplate
}
from
'src/app/models/boilerplate.model'
;
...
...
@@ -25,6 +24,8 @@ export class BoilerplateDetailsComponent implements OnInit {
systems
?:
Sections
[];
currentboilerplate
:
Boilerplate
=
{
group_of_boilerplate
:
this
.
route
.
snapshot
.
params
.
gb
,
title
:
""
,
has_prefix
:
false
,
has_main
:
false
,
has_suffix
:
false
...
...
reqtool/ReqmanAngular11/src/app/components/main-details/main-details.component.html
View file @
20927d60
...
...
@@ -81,9 +81,9 @@
</form>
</div>
<div
class=
"col"
>
<form
class=
"form-group form-inline"
>
<form
class=
"form-group form-inline"
[
ngStyle
]="(
verbControlisDivVisible
)
?
{'
visibility
'
:
'
visible
'}
:
{'
visibility
'
:
'
hidden
'}"
>
<mat-form-field
class=
"example-full-width"
>
<mat-label
>
Verb
</mat-label>
<mat-label
*
ngIf=
"verbControl.value !=null"
>
Verb : {{verbControl.value.slice(0, verbControl.value.indexOf(' : '))}}
</mat-label>
<input
type=
"text"
placeholder=
"Pick one"
aria-label=
"Number"
...
...
@@ -92,9 +92,9 @@
required
[
matAutocomplete
]="
autoverb
"
>
<mat-autocomplete
autoActiveFirstOption
#
autoverb
=
"matAutocomplete
"
>
<mat-autocomplete
autoActiveFirstOption
#
autoverb
=
"matAutocomplete"
showPanel=
"true"
[
displayWith
]="
displayFn
"
>
<mat-option
*
ngFor=
"let option of verbfilteredOptions | async"
[
value
]="
option
"
>
{{option}}
{{option
.split(" : ").pop()
}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
...
...
reqtool/ReqmanAngular11/src/app/components/main-details/main-details.component.ts
View file @
20927d60
...
...
@@ -46,6 +46,8 @@ export class MainDetailsComponent implements OnInit {
verbControl
=
new
FormControl
();
verb
:
string
[]
=
[];
verbfilteredOptions
:
Observable
<
string
[]
>
;
verbControlisDivVisible
=
true
quantifierControl
=
new
FormControl
(
);
quantifier
:
string
[]
=
[];
...
...
@@ -148,10 +150,11 @@ export class MainDetailsComponent implements OnInit {
//console.log(this.mainsyntax[x])
//console.log(this.mainsyntax[x].Id)
for
(
let
s
=
0
;
s
<
this
.
mainsyntax
[
x
].
Subject
.
length
;
s
++
){
console
.
log
()
if
(
this
.
mainsyntax
[
x
].
Subject
[
s
]
==
(
this
.
subjectsControl
.
value
.
slice
(
0
,
this
.
subjectsControl
.
value
.
indexOf
(
':'
))).
replace
(
/
\s
/g
,
""
)){
//console.log("okk")
for
(
let
v
=
0
;
v
<
this
.
mainsyntax
[
x
].
Verbs
.
length
;
v
++
){
if
(
this
.
mainsyntax
[
x
].
Verbs
[
v
]
==
(
(
this
.
verbControl
.
value
).
replace
(
/
\s
/g
,
""
)
)){
if
(
this
.
mainsyntax
[
x
].
Verbs
[
v
]
==
(
this
.
verbControl
.
value
.
split
(
" : "
).
pop
()).
replace
(
/
\s
/g
,
""
)){
//console.log("Verb okk")
for
(
let
a
=
0
;
a
<
this
.
mainsyntax
[
x
].
Attributes
.
length
;
a
++
){
if
(
this
.
mainsyntax
[
x
].
Attributes
[
a
]
==
(
this
.
fifuintsysstatsetControl
.
value
.
slice
(
0
,
this
.
fifuintsysstatsetControl
.
value
.
indexOf
(
':'
))).
replace
(
/
\s
/g
,
""
)){
...
...
@@ -233,7 +236,7 @@ export class MainDetailsComponent implements OnInit {
.
subscribe
(
data
=>
{
this
.
currentmain
=
data
;
//
console.log(data)
console
.
log
(
data
)
this
.
subjectsControl
.
setValue
(
this
.
currentmain
.
sys_fun_inter
);
this
.
stateitemControl
.
setValue
(
this
.
currentmain
.
state_item_before_verb
);
this
.
statevalueControl
.
setValue
(
this
.
currentmain
.
statevalue_before_verb
);
...
...
@@ -280,7 +283,8 @@ export class MainDetailsComponent implements OnInit {
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
subjects
.
push
((
data
[
x
][
1
]));}
if
(
this
.
subjects
.
indexOf
(
data
[
x
][
1
])
==
-
1
)
{
this
.
subjects
.
push
((
data
[
x
][
1
]));}}
},
error
=>
{
console
.
log
(
error
);
...
...
@@ -291,7 +295,8 @@ export class MainDetailsComponent implements OnInit {
data
=>
{
//no data from State and Item
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
stateitem
.
push
(
data
[
x
][
1
]);}
if
(
this
.
stateitem
.
indexOf
(
data
[
x
][
1
])
==
-
1
)
{
this
.
stateitem
.
push
(
data
[
x
][
1
]);}}
},
error
=>
{
console
.
log
(
error
);
...
...
@@ -300,7 +305,8 @@ export class MainDetailsComponent implements OnInit {
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
statevalue
.
push
(
data
[
x
][
1
]);}
if
(
this
.
statevalue
.
indexOf
(
data
[
x
][
1
])
==
-
1
)
{
this
.
statevalue
.
push
(
data
[
x
][
1
]);}}
},
error
=>
{
console
.
log
(
error
);
...
...
@@ -309,7 +315,8 @@ export class MainDetailsComponent implements OnInit {
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
shall
.
push
(
data
[
x
][
1
]);}
if
(
this
.
shall
.
indexOf
(
data
[
x
][
1
])
==
-
1
)
{
this
.
shall
.
push
(
data
[
x
][
1
]);}}
},
error
=>
{
console
.
log
(
error
);
...
...
@@ -318,7 +325,9 @@ export class MainDetailsComponent implements OnInit {
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
verb
.
push
(
data
[
x
][
1
]);}
if
(
this
.
verb
.
indexOf
(
data
[
x
][
1
])
==
-
1
)
{
this
.
verb
.
push
(
data
[
x
][
1
]);}}
console
.
log
(
this
.
verb
)
},
error
=>
{
console
.
log
(
error
);
...
...
@@ -327,7 +336,8 @@ export class MainDetailsComponent implements OnInit {
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
quantifier
.
push
(
data
[
x
][
1
]);}
if
(
this
.
quantifier
.
indexOf
(
data
[
x
][
1
])
==
-
1
)
{
this
.
quantifier
.
push
(
data
[
x
][
1
]);}}
},
error
=>
{
console
.
log
(
error
);
...
...
@@ -337,7 +347,8 @@ export class MainDetailsComponent implements OnInit {
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
numunit
.
push
(
data
[
x
][
1
]);}
if
(
this
.
numunit
.
indexOf
(
data
[
x
][
1
])
==
-
1
)
{
this
.
numunit
.
push
(
data
[
x
][
1
]);}}
},
error
=>
{
console
.
log
(
error
);
...
...
@@ -346,7 +357,8 @@ export class MainDetailsComponent implements OnInit {
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
fifuintsysstatset
.
push
(
data
[
x
][
1
]);}
if
(
this
.
fifuintsysstatset
.
indexOf
(
data
[
x
][
1
])
==
-
1
)
{
this
.
fifuintsysstatset
.
push
(
data
[
x
][
1
]);}}
},
error
=>
{
console
.
log
(
error
);
...
...
@@ -355,7 +367,8 @@ export class MainDetailsComponent implements OnInit {
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
stsysconset
.
push
(
data
[
x
][
1
]);}
if
(
this
.
stsysconset
.
indexOf
(
data
[
x
][
1
])
==
-
1
)
{
this
.
stsysconset
.
push
(
data
[
x
][
1
]);}}
},
error
=>
{
console
.
log
(
error
);
...
...
reqtool/ReqmanAngular11/src/app/components/prefix-details/prefix-details.component.ts
View file @
20927d60
...
...
@@ -156,7 +156,8 @@ export class PrefixDetailsComponent implements OnInit {
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
simpleprefix
.
push
(
data
[
x
][
1
]);}
if
(
this
.
simpleprefix
.
indexOf
(
data
[
x
][
1
])
==
-
1
)
{
this
.
simpleprefix
.
push
(
data
[
x
][
1
]);}}
//this.simpleprefix = data;
},
error
=>
{
...
...
@@ -166,7 +167,8 @@ export class PrefixDetailsComponent implements OnInit {
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
logic_con
.
push
(
data
[
x
][
1
]);}
if
(
this
.
logic_con
.
indexOf
(
data
[
x
][
1
])
==
-
1
)
{
this
.
logic_con
.
push
(
data
[
x
][
1
]);}}
},
error
=>
{
console
.
log
(
error
);
...
...
@@ -175,7 +177,8 @@ export class PrefixDetailsComponent implements OnInit {
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
verbs
.
push
(
data
[
x
][
1
]);}
if
(
this
.
verbs
.
indexOf
(
data
[
x
][
1
])
==
-
1
)
{
this
.
verbs
.
push
(
data
[
x
][
1
]);}}
},
error
=>
{
console
.
log
(
error
);
...
...
@@ -184,7 +187,8 @@ export class PrefixDetailsComponent implements OnInit {
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
subjects
.
push
(
data
[
x
][
1
]);}
if
(
this
.
subjects
.
indexOf
(
data
[
x
][
1
])
==
-
1
)
{
this
.
subjects
.
push
(
data
[
x
][
1
]);}}
},
error
=>
{
console
.
log
(
error
);
...
...
@@ -193,7 +197,8 @@ export class PrefixDetailsComponent implements OnInit {
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
objects
.
push
(
data
[
x
][
1
]);}
if
(
this
.
objects
.
indexOf
(
data
[
x
][
1
])
==
-
1
)
{
this
.
objects
.
push
(
data
[
x
][
1
]);}}
},
error
=>
{
console
.
log
(
error
);
...
...
reqtool/ReqmanAngular11/src/app/components/suffix-details/suffix-details.component.ts
View file @
20927d60
...
...
@@ -137,7 +137,8 @@ export class SuffixDetailsComponent implements OnInit {
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
suffix
.
push
(
data
[
x
][
1
]);}
if
(
this
.
suffix
.
indexOf
(
data
[
x
][
1
])
==
-
1
)
{
this
.
suffix
.
push
(
data
[
x
][
1
]);}}
},
error
=>
{
console
.
log
(
error
);
...
...
@@ -146,7 +147,8 @@ export class SuffixDetailsComponent implements OnInit {
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
mumerical_units
.
push
(
data
[
x
][
1
]);}
if
(
this
.
mumerical_units
.
indexOf
(
data
[
x
][
1
])
==
-
1
)
{
this
.
mumerical_units
.
push
(
data
[
x
][
1
]);}}
},
error
=>
{
console
.
log
(
error
);
...
...
@@ -155,7 +157,8 @@ export class SuffixDetailsComponent implements OnInit {
.
subscribe
(
data
=>
{
for
(
let
x
=
0
;
x
<
data
.
length
;
x
++
){
this
.
flow
.
push
(
data
[
x
][
1
]);}
if
(
this
.
flow
.
indexOf
(
data
[
x
][
1
])
==
-
1
)
{
this
.
flow
.
push
(
data
[
x
][
1
]);}}
},
error
=>
{
console
.
log
(
error
);
...
...
reqtool/ReqmanAngular11/src/app/models/boilerplate.model.ts
View file @
20927d60
export
class
Boilerplate
{
id
?:
any
;
owner
?:
any
;
group_of_boilerplate
?:
any
;
title
?:
string
;
has_prefix
?:
boolean
;
...
...
reqtool/reqman/api/reqman/apps/reqtool/models/main_req.py
View file @
20927d60
...
...
@@ -88,7 +88,8 @@ STATE_VALUE_CHOICES =get_instances("SAO#StateValue")
STATEVALUES_CLASSES_COMMENTS
=
get_dmo_classes_and_comment
(
"SAO#StateValue"
)
#
VERB_CHOICES
=
get_verb_instances
(
"LO#Verb"
)
#VERB_CHOICES = get_verb_instances("LO#Verb")
VERB_CHOICES
=
get_verb_file_and_instances
(
"LO#Verb"
)
#test to add M
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/services/inference.py
View file @
20927d60
...
...
@@ -88,12 +88,12 @@ def findclassofmain(listofmain):
subsmain
=
main_syntax
[(
'M'
+
str
(
i
+
1
))][
'Subject'
]
attrsmain
=
main_syntax
[(
'M'
+
str
(
i
+
1
))][
'Attributes'
]
#for currentmain in range(len(listofmain)):
currentverb
=
listofmain
[
'verb'
]
currentverb
=
listofmain
[
'verb'
]
.
rsplit
(
' : '
,
1
)
currentsubject
=
listofmain
[
'sys_fun_inter'
]
currentattr
=
listofmain
[
'flow_function_interface_item_system_state_stateset'
]
for
verbmain
in
verbsmain
:
flag
=
0
if
(
verbmain
.
upper
()
==
currentverb
.
upper
()
):
if
(
verbmain
.
upper
()
==
currentverb
[
len
(
currentverb
)
-
1
]
.
upper
()
):
for
submain
in
subsmain
:
flag
=
0
if
submain
==
"System"
:
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/services/parse_ontologies.py
View file @
20927d60
...
...
@@ -73,6 +73,25 @@ def get_verb_instances(keyword):
out_list
.
append
(
str
(
spl
[
1
]))
return
tuple
((
str
(
n
),
str
(
n
))
for
n
in
(
out_list
))
'''Get Verbs - return tuple'''
def
get_verb_file_and_instances
(
keyword
):
get_file_and_instances
(
keyword
)
keywordspl
=
keyword
.
split
(
"#"
)
in_list
=
[]
out_list
=
[]
with
open
(
'../../Ontologies/instances.txt'
)
as
f
:
for
data
in
f
:
if
(
data
.
strip
())
.
endswith
(
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
:
per
=
URIRef
(
"http://delab.csd.auth.gr/ontologies/2018/LO#"
+
extra
)
for
s
,
p
,
o
in
g
.
triples
((
None
,
RDF
.
type
,
per
)):
spl
=
s
.
split
(
"#"
)
out_list
.
append
(
extra
+
" : "
+
str
(
spl
[
1
]))
return
tuple
((
str
(
n
),
str
(
n
))
for
n
in
(
out_list
))
'''Get Instaces - return tuple'''
def
get_instances
(
keyword
):
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/views/main_req_views.py
View file @
20927d60
...
...
@@ -73,7 +73,7 @@ class MainDetailsAPIView(RetrieveUpdateDestroyAPIView):
instance
=
serializer
.
validated_data
#add data in thn Model BoilerplateData
es_instance
=
instance
[
'sys_fun_inter'
]
.
rsplit
(
':'
,
1
)
ev_instance
=
instance
[
'verb'
]
.
rsplit
(
'
:
'
,
1
)
ev_instance
=
instance
[
'verb'
]
.
rsplit
(
'
:
'
,
1
)
eo_instance
=
instance
[
'flow_function_interface_item_system_state_stateset'
]
.
rsplit
(
':'
,
1
)
mn
=
(
es_instance
[
len
(
es_instance
)
-
1
]
+
' '
+
instance
[
'shall'
]
+
' '
+
ev_instance
[
len
(
ev_instance
)
-
1
]
+
' '
+
eo_instance
[
len
(
eo_instance
)
-
1
])
curmain_choices
=
inference
.
getclassofmain
(
instance
)
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/views/requirements_views.py
View file @
20927d60
...
...
@@ -98,7 +98,7 @@ class BoilerplateList(ListAPIView):
def
get_queryset
(
self
):
group_gb
=
self
.
kwargs
[
'groupboil'
]
title
=
self
.
kwargs
[
'title_1'
]
print
(
title
)
#
print(title)
queryset_title
=
Boilerplate
.
objects
.
filter
(
title
=
title
,
group_of_boilerplate
=
group_gb
)
return
queryset_title
...
...
@@ -118,6 +118,9 @@ class BoilerplateDetailsAPIView(RetrieveUpdateDestroyAPIView):
#print(serializer.validated_data['id'])
#if not Prefix.objects.filter(boilerplate = serializer.validated_data['id']) and (serializer.validated_data['b_prefix'] == True):
# serializer.validated_data['b_prefix'] = True
instance
=
serializer
.
validated_data
bd_title
=
instance
[
'title'
]
BoilerplateData
.
objects
.
filter
(
boilerplate_data_id
=
self
.
kwargs
[
'pk'
],
group_of_boilerplate_data
=
instance
[
'group_of_boilerplate'
])
.
update
(
title_data
=
bd_title
)
instance
=
serializer
.
save
()
#write_fuseki = fuseki.FusekiActions()
...
...
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