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
cfc4aafc
Commit
cfc4aafc
authored
Mar 31, 2021
by
Thodoris Nestoridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dictionary for system classes, subclasses and instances
parent
2a3b6646
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
264 additions
and
3 deletions
+264
-3
boilerplate-details.component.html
...ts/boilerplate-details/boilerplate-details.component.html
+79
-2
boilerplate-details.component.scss
...ts/boilerplate-details/boilerplate-details.component.scss
+13
-0
boilerplate-details.component.ts
...ents/boilerplate-details/boilerplate-details.component.ts
+47
-0
boilerplate-list.component.html
...mponents/boilerplate-list/boilerplate-list.component.html
+2
-0
main.service.ts
reqtool/ReqmanAngular11/src/app/services/main.service.ts
+12
-0
main_req.py
reqtool/reqman/api/reqman/apps/reqtool/models/main_req.py
+3
-0
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
+79
-0
urls.py
reqtool/reqman/api/reqman/apps/reqtool/rest_api/urls.py
+7
-0
main_req_views.py
.../api/reqman/apps/reqtool/rest_api/views/main_req_views.py
+21
-0
No files found.
reqtool/ReqmanAngular11/src/app/components/boilerplate-details/boilerplate-details.component.html
View file @
cfc4aafc
...
...
@@ -8,7 +8,7 @@
<li
class=
"breadcrumb-item"
aria-current=
"page"
>
Edit Boilerplate
</li>
</ol>
</nav>
<div>
<div
class=
"first"
>
<div
*
ngIf=
"currentboilerplate.id"
class=
"edit-form"
>
<form>
<div
class=
"form-group"
style=
"width: 63%;"
>
...
...
@@ -82,5 +82,82 @@
<div
*
ngIf=
"!currentboilerplate.id"
>
<mat-spinner
style=
"margin: auto;"
></mat-spinner>
</div>
</div>
<!-- Dictionary -->
<div
class=
"second"
>
<mat-tab-group
mat-align-tabs=
"center"
>
<mat-tab
label=
"System"
>
<div
*
ngFor=
"let item of systems; let i = index"
>
<div
*
ngIf=
"checkeven(i)"
>
<mat-accordion>
<mat-expansion-panel
hideToggle
>
<mat-expansion-panel-header>
<mat-panel-title>
{{ item }}
</mat-panel-title>
<mat-panel-description>
<!-- only mini description-->
</mat-panel-description>
</mat-expansion-panel-header>
{{ systems [i+1] }}
<ul>
<h4><b>
Instances
</b></h4>
<div
*
ngFor=
"let instan of intacesystems; let y = index"
>
<div
*
ngIf=
"item == instan"
>
<li>
<mat-expansion-panel
hideToggle
>
<p>
Description.
</p>
<mat-expansion-panel-header>
<mat-panel-title>
{{ intacesystems[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
<ul>
<h4><b>
Subclasses
</b></h4>
<div
*
ngFor=
"let sub of subclassystems; let y = index"
>
<div
*
ngIf=
"item == sub"
>
<li>
<mat-expansion-panel
hideToggle
>
<mat-expansion-panel-header>
<mat-panel-title>
{{ subclassystems[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
<p>
{{subclassystems[y+2]}}
</p>
<ul>
<h5>
Instances
</h5>
<div
*
ngFor=
"let instan of intacesystems; let y = index"
>
<div
*
ngIf=
"sub == instan"
>
<li>
<mat-expansion-panel
hideToggle
>
<mat-expansion-panel-header>
<mat-panel-title>
{{ intacesystems[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
</mat-tab>
<mat-tab
label=
"Function"
>
Content 2
</mat-tab>
<mat-tab
label=
"Interface"
>
Content 3
</mat-tab>
<mat-tab
label=
"Item"
>
Content 3
</mat-tab>
<mat-tab
label=
"State"
>
Content 3
</mat-tab>
</mat-tab-group>
</div>
\ No newline at end of file
reqtool/ReqmanAngular11/src/app/components/boilerplate-details/boilerplate-details.component.scss
View file @
cfc4aafc
...
...
@@ -16,3 +16,16 @@
.form-group
{
min-width
:
150px
;
}
.first
{
width
:
68%
;
}
.second
{
width
:
32%
;
position
:
absolute
;
top
:
14%
;
right
:
0px
;
height
:
80%
;
overflow
:auto
;
}
\ No newline at end of file
reqtool/ReqmanAngular11/src/app/components/boilerplate-details/boilerplate-details.component.ts
View file @
cfc4aafc
...
...
@@ -3,6 +3,7 @@ import { Component, OnInit } from '@angular/core';
import
{
ActivatedRoute
,
Router
}
from
'@angular/router'
;
import
{
Boilerplate
}
from
'src/app/models/boilerplate.model'
;
import
{
BoilerplateService
}
from
'src/app/services/boilerplate.service'
;
import
{
MainService
}
from
'src/app/services/main.service'
;
...
...
@@ -13,6 +14,16 @@ import { BoilerplateService } from 'src/app/services/boilerplate.service';
})
export
class
BoilerplateDetailsComponent
implements
OnInit
{
panelOpenState
=
false
;
subjects
:
string
[]
=
[];
systems
:
string
[]
=
[];
subclassystems
:
string
[]
=
[];
intacesystems
:
string
[]
=
[];
functions
:
string
[]
=
[];
items
:
string
[]
=
[];
currentboilerplate
:
Boilerplate
=
{
has_prefix
:
false
,
has_main
:
false
,
...
...
@@ -21,12 +32,14 @@ export class BoilerplateDetailsComponent implements OnInit {
message
=
''
;
constructor
(
private
mainService
:
MainService
,
private
boilerplateService
:
BoilerplateService
,
private
route
:
ActivatedRoute
,
private
router
:
Router
)
{
}
ngOnInit
():
void
{
this
.
message
=
''
;
this
.
getchoices
();
this
.
getBoilerplate
(
this
.
route
.
snapshot
.
params
.
gb
,
this
.
route
.
snapshot
.
params
.
id
);
}
...
...
@@ -68,4 +81,38 @@ export class BoilerplateDetailsComponent implements OnInit {
});
}
}
getchoices
():
void
{
this
.
mainService
.
getclasssystem
()
.
subscribe
(
data
=>
{
this
.
systems
=
data
},
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getinstancesystem
()
.
subscribe
(
data
=>
{
this
.
intacesystems
=
data
},
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getsubclassystem
()
.
subscribe
(
data
=>
{
this
.
subclassystems
=
data
},
error
=>
{
console
.
log
(
error
);
});
}
checkeven
(
i
:
any
):
any
{
if
(
i
%
2
==
0
){
return
true
}
return
false
}
}
reqtool/ReqmanAngular11/src/app/components/boilerplate-list/boilerplate-list.component.html
View file @
cfc4aafc
...
...
@@ -43,6 +43,8 @@
</div>
</div>
<table
mat-table
[
dataSource
]="
newdataSource
"
class=
"mat-elevation-z8"
>
<!-- Position Column -->
<ng-container
matColumnDef=
"id"
>
...
...
reqtool/ReqmanAngular11/src/app/services/main.service.ts
View file @
cfc4aafc
...
...
@@ -69,4 +69,16 @@ export class MainService {
return
this
.
http
.
get
(
`http://155.207.131.19:8000/api-auth/main/choices/stsysconset/`
);
}
getclasssystem
():
Observable
<
any
>
{
return
this
.
http
.
get
(
`http://155.207.131.19:8000/api-auth/class/system`
);
}
getsubclassystem
():
Observable
<
any
>
{
return
this
.
http
.
get
(
`http://155.207.131.19:8000/api-auth/class/system/subclasses`
);
}
getinstancesystem
():
Observable
<
any
>
{
return
this
.
http
.
get
(
`http://155.207.131.19:8000/api-auth/class/system/instance`
);
}
}
reqtool/reqman/api/reqman/apps/reqtool/models/main_req.py
View file @
cfc4aafc
...
...
@@ -33,6 +33,9 @@ MAIN_CHOICES = ( ("",""), ("M1", "M1"),
#to be updated with domains from DSO
SYSTEM_CHOICES
=
get_instances
(
"SAO#System"
)
#+get_i_instances("SAO#System")
SYSTEM_CLASSES_COMMENTS
=
get_dmo_classes_and_comment
(
"SAO#System"
)
SYSTEM_SUBCLASSES_COMMENTS
=
get_dmo_classes_of_classes_and_comment
(
"SAO#System"
)
SYSTEM_INSTANCES_COMMENTS
=
get_dmo_instance_and_comment
(
"SAO#System"
)
#print(get_instances("SAO#System"))
FUNCTION_CHOICES
=
get_instances
(
"SAO#Function"
)
SHALL_CHOICES
=
(
(
"shall"
,
"shall"
),
(
"shall not"
,
"shall not"
))
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/services/inference.py
View file @
cfc4aafc
...
...
@@ -34,7 +34,7 @@ def inferencing(project, boilerlate, prefix, main, suffix):
def
exportboiltottl
(
project
,
prefix
,
boilerplate
,
main
,
suffix
):
#print(out_list) A list with the values and the file that is the instance
#print(out_list)
#
A list with the values and the file that is the instance
per_instances
=
URIRef
(
"http://delab.csd.auth.gr/ontologies/2018/RDO-instances#"
)
rdo
=
URIRef
(
"http://delab.csd.auth.gr/ontologies/2018/RDO#"
)
rbo
=
URIRef
(
"http://delab.csd.auth.gr/ontologies/2018/RBO#"
)
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/services/parse_ontologies.py
View file @
cfc4aafc
...
...
@@ -11,6 +11,7 @@ subClass_instances = "../../Ontologies/instances_subclass.txt"
list_of_DSO
=
[
"http://delab.csd.auth.gr/ontologies/2018/SAO#"
,
"http://delab.csd.auth.gr/ontologies/2018/DSO#"
,
"http://delab.csd.auth.gr/ontologies/2018/DSO-AOCS#"
,
"http://delab.csd.auth.gr/ontologies/2018/DSO-AOCS-instances#"
]
list_of_RMO
=
[
"RMO"
,
"RMO-instances"
,
"DSO-AOCS-instances"
,
"<http://delab.csd.auth.gr/ontologies/2018/RDO-instances"
]
DSO
=
[
"http://delab.csd.auth.gr/ontologies/2018/DSO#"
]
g
=
Graph
()
g
.
load
(
Ontology_file
,
format
=
"turtle"
)
...
...
@@ -72,6 +73,8 @@ def get_instances(keyword):
# 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
info_dict
=
{}
def
get_file_and_instances
(
keyword
):
keywordspl
=
keyword
.
split
(
"#"
)
...
...
@@ -92,6 +95,82 @@ def get_file_and_instances(keyword):
out_list
.
append
(
str
(
spl
[
len
(
spl
)
-
2
]))
#return out_list#tuple((out_list[i+1], out_list[i]) for i in range(0, (len(out_list) - 1), 2) )
#Instances and Comments
def
get_dmo_instance_and_comment
(
keyword
):
mid_list
=
[]
out_list_com
=
[]
keywordspl
=
keyword
.
split
(
"#"
)
in_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
:
for
uri
in
list_of_DSO
:
per
=
URIRef
(
uri
+
extra
)
for
s
,
p
,
o
in
g
.
triples
((
None
,
RDF
.
type
,
per
)):
spl
=
s
.
split
(
"#"
)
uri
=
spl
[
len
(
spl
)
-
2
]
.
split
(
"/"
)
mid_list
.
append
(
extra
)
mid_list
.
append
(
spl
[
len
(
spl
)
-
1
])
#need to find if instances have comment with their descreption!!!!!
#for now it returns only the instances
for
extra
in
mid_list
:
for
uri
in
list_of_DSO
:
per
=
URIRef
(
uri
+
extra
)
for
s
,
p
,
o
in
g
.
triples
((
per
,
RDFS
.
comment
,
None
)):
spl
=
s
.
split
(
"#"
)
uri
=
spl
[
len
(
spl
)
-
2
]
.
split
(
"/"
)
out_list_com
.
append
(
str
(
extra
))
out_list_com
.
append
((
str
(
o
)
.
replace
(
"
\r
"
,
""
))
.
replace
(
"
\n
"
,
""
))
return
mid_list
#Classes and Comments
def
get_dmo_classes_and_comment
(
keyword
):
out_list_instance
=
[]
out_list_com
=
[]
keywordspl
=
keyword
.
split
(
"#"
)
in_list
=
[
keywordspl
[
len
(
keywordspl
)
-
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
(
"#"
)
out_list_instance
.
append
(
spl
[
len
(
spl
)
-
1
])
for
comment
in
out_list_instance
:
for
uri
in
list_of_DSO
:
per
=
URIRef
(
uri
+
comment
)
for
s
,
p
,
o
in
g
.
triples
((
per
,
RDFS
.
comment
,
None
)):
out_list_com
.
append
(
str
(
comment
))
out_list_com
.
append
((
str
(
o
)
.
replace
(
"
\r
"
,
""
))
.
replace
(
"
\n
"
,
""
))
return
(
out_list_com
)
#Classes of classes and Comments
def
get_dmo_classes_of_classes_and_comment
(
keyword
):
out_list_instance
=
[]
out_list_com
=
[]
mid_list
=
[]
keywordspl
=
keyword
.
split
(
"#"
)
in_list
=
[
keywordspl
[
len
(
keywordspl
)
-
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
(
"#"
)
out_list_instance
.
append
(
spl
[
len
(
spl
)
-
1
])
for
comment
in
out_list_instance
:
for
uri
in
list_of_DSO
:
per
=
URIRef
(
uri
+
comment
)
for
s
,
p
,
o
in
g
.
triples
((
None
,
RDFS
.
subClassOf
,
per
)):
spl
=
s
.
split
(
"#"
)
out_list_com
.
append
(
str
(
comment
))
out_list_com
.
append
(
spl
[
len
(
spl
)
-
1
])
kop
=
URIRef
(
uri
+
spl
[
len
(
spl
)
-
1
])
for
q
,
w
,
m
in
g
.
triples
((
kop
,
RDFS
.
comment
,
None
)):
out_list_com
.
append
((
str
(
m
)
.
replace
(
"
\r
"
,
""
))
.
replace
(
"
\n
"
,
""
))
return
(
out_list_com
)
'''Get Instaces - return list'''
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/urls.py
View file @
cfc4aafc
...
...
@@ -52,5 +52,12 @@ urlpatterns = [
path
(
'suffix/choices/numunits/'
,
suffix_req_views
.
NumChoicesViewSet
.
as_view
(),
name
=
'suffixnum'
),
path
(
'suffix/choices/flow/'
,
suffix_req_views
.
FlowChoicesViewSet
.
as_view
(),
name
=
'suffixflow'
),
#CLASSES
path
(
'class/system'
,
main_req_views
.
SystemClassViewSet
.
as_view
(),
name
=
'class_system'
),
path
(
'class/system/subclasses'
,
main_req_views
.
SystemSubclasesViewSet
.
as_view
(),
name
=
'subclass_system'
),
path
(
'class/system/instance'
,
main_req_views
.
SystemInstancesViewSet
.
as_view
(),
name
=
'instances_of_system'
),
]
\ No newline at end of file
reqtool/reqman/api/reqman/apps/reqtool/rest_api/views/main_req_views.py
View file @
cfc4aafc
...
...
@@ -18,6 +18,9 @@ from reqman.apps.reqtool.models.main_req import SYSTEM_CHOICES, FUNCTION_CHOICES
from
reqman.apps.reqtool.models.main_req
import
STATE_VALUE_CHOICES
,
SHALL_CHOICES
,
VERB_CHOICES
,
QUANTIFIER_CHOICES
,
NUMBER_UNITS_CHOICES
from
reqman.apps.reqtool.models.main_req
import
FLOW_CHOICES
,
CONNECTION_CHOICES
,
STATE_SET_CHOICES
from
reqman.apps.reqtool.models.main_req
import
SYSTEM_CLASSES_COMMENTS
,
SYSTEM_SUBCLASSES_COMMENTS
,
SYSTEM_INSTANCES_COMMENTS
from
reqman.apps.reqtool.models.requirements
import
BoilerplateData
from
rest_framework.exceptions
import
APIException
...
...
@@ -145,3 +148,21 @@ class StaSysConSetChoicesViewSet(APIView):
def
get
(
self
,
request
):
response
=
Response
(
STATE_VALUE_CHOICES
+
SYSTEM_CHOICES
+
CONNECTION_CHOICES
+
STATE_SET_CHOICES
)
return
response
class
SystemClassViewSet
(
APIView
):
def
get
(
self
,
request
):
response
=
Response
(
SYSTEM_CLASSES_COMMENTS
)
return
response
class
SystemSubclasesViewSet
(
APIView
):
def
get
(
self
,
request
):
response
=
Response
(
SYSTEM_SUBCLASSES_COMMENTS
)
return
response
class
SystemInstancesViewSet
(
APIView
):
def
get
(
self
,
request
):
response
=
Response
(
SYSTEM_INSTANCES_COMMENTS
)
return
response
\ 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