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
b5a70ddf
Commit
b5a70ddf
authored
Apr 05, 2021
by
Thodoris Nestoridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Search for Dict - completed
parent
a624c3df
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
171 additions
and
981 deletions
+171
-981
package-lock.json
reqtool/ReqmanAngular11/package-lock.json
+5
-0
package.json
reqtool/ReqmanAngular11/package.json
+1
-0
app.module.ts
reqtool/ReqmanAngular11/src/app/app.module.ts
+2
-1
boilerplate-details.component.html
...ts/boilerplate-details/boilerplate-details.component.html
+35
-752
boilerplate-details.component.ts
...ents/boilerplate-details/boilerplate-details.component.ts
+8
-212
boilerplate.model.ts
reqtool/ReqmanAngular11/src/app/models/boilerplate.model.ts
+23
-0
main.service.ts
reqtool/ReqmanAngular11/src/app/services/main.service.ts
+4
-1
parse_ontologies.py
...reqman/apps/reqtool/rest_api/services/parse_ontologies.py
+83
-15
urls.py
reqtool/reqman/api/reqman/apps/reqtool/rest_api/urls.py
+3
-0
main_req_views.py
.../api/reqman/apps/reqtool/rest_api/views/main_req_views.py
+7
-0
No files found.
reqtool/ReqmanAngular11/package-lock.json
View file @
b5a70ddf
...
...
@@ -8298,6 +8298,11 @@
"integrity"
:
"sha1-yobR/ogoFpsBICCOPchCS524NCw="
,
"dev"
:
true
},
"ng2-search-filter"
:
{
"version"
:
"0.5.1"
,
"resolved"
:
"https://registry.npmjs.org/ng2-search-filter/-/ng2-search-filter-0.5.1.tgz"
,
"integrity"
:
"sha512-noN8R+Gyxo5ZuboEOvq+u0zKio6pEf1IVYQTCZfAfXm6ONmzWu/M2xK0di9oVUprDbPBQXCGUuvD5i2GD+35HA=="
},
"nice-try"
:
{
"version"
:
"1.0.5"
,
"resolved"
:
"https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz"
,
...
...
reqtool/ReqmanAngular11/package.json
View file @
b5a70ddf
...
...
@@ -28,6 +28,7 @@
"bootstrap"
:
"^4.6.0"
,
"jwt-decode"
:
"^3.1.2"
,
"moment"
:
"^2.29.1"
,
"ng2-search-filter"
:
"^0.5.1"
,
"rxjs"
:
"~6.6.0"
,
"tslib"
:
"^2.0.0"
,
"zone.js"
:
"~0.11.3"
...
...
reqtool/ReqmanAngular11/src/app/app.module.ts
View file @
b5a70ddf
...
...
@@ -33,7 +33,7 @@ import { SuffixDetailsComponent } from './components/suffix-details/suffix-detai
import
{
GroupboilComponent
}
from
'./components/groupboil/groupboil.component'
;
import
{
AddGroupboilComponent
}
from
'./components/add-groupboil/add-groupboil.component'
;
import
{
InstancesListComponent
}
from
'./components/instances-list/instances-list.component'
;
import
{
Ng2SearchPipeModule
}
from
'ng2-search-filter'
;
@
NgModule
({
...
...
@@ -62,6 +62,7 @@ import { InstancesListComponent } from './components/instances-list/instances-li
AppRoutingModule
,
ReactiveFormsModule
,
FormsModule
,
Ng2SearchPipeModule
,
HttpClientModule
,
NgbModule
,
NotifierModule
,
...
...
reqtool/ReqmanAngular11/src/app/components/boilerplate-details/boilerplate-details.component.html
View file @
b5a70ddf
This diff is collapsed.
Click to expand it.
reqtool/ReqmanAngular11/src/app/components/boilerplate-details/boilerplate-details.component.ts
View file @
b5a70ddf
...
...
@@ -2,6 +2,7 @@
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
ActivatedRoute
,
Router
}
from
'@angular/router'
;
import
{
Boilerplate
}
from
'src/app/models/boilerplate.model'
;
import
{
Sections
}
from
'src/app/models/boilerplate.model'
;
import
{
BoilerplateService
}
from
'src/app/services/boilerplate.service'
;
import
{
MainService
}
from
'src/app/services/main.service'
;
...
...
@@ -18,41 +19,18 @@ export class BoilerplateDetailsComponent implements OnInit {
subjects
:
string
[]
=
[];
systems
:
string
[]
=
[];
subclassystems
:
string
[]
=
[];
instacesystems
:
string
[]
=
[];
functions
:
string
[]
=
[];
subclasfunctions
:
string
[]
=
[];
instacefunctions
:
string
[]
=
[];
items
:
string
[]
=
[];
subclasitems
:
string
[]
=
[];
instaceitems
:
string
[]
=
[];
interfaces
:
string
[]
=
[];
subclasinterfaces
:
string
[]
=
[];
instaceinterfaces
:
string
[]
=
[];
connections
:
string
[]
=
[];
subclasconnections
:
string
[]
=
[];
instaceconnections
:
string
[]
=
[];
flows
:
string
[]
=
[];
subclasflows
:
string
[]
=
[];
instaceflows
:
string
[]
=
[];
states
:
string
[]
=
[];
subclasstates
:
string
[]
=
[];
instacestates
:
string
[]
=
[];
systems
?:
Sections
[];
currentboilerplate
:
Boilerplate
=
{
has_prefix
:
false
,
has_main
:
false
,
has_suffix
:
false
};
message
=
''
;
searchText
=
''
;
searchTextinstances
=
''
;
constructor
(
private
mainService
:
MainService
,
...
...
@@ -66,6 +44,7 @@ export class BoilerplateDetailsComponent implements OnInit {
this
.
getBoilerplate
(
this
.
route
.
snapshot
.
params
.
gb
,
this
.
route
.
snapshot
.
params
.
id
);
}
getBoilerplate
(
gb
:
any
,
id
:
number
):
void
{
this
.
boilerplateService
.
get
(
gb
,
id
)
.
subscribe
(
...
...
@@ -107,7 +86,7 @@ export class BoilerplateDetailsComponent implements OnInit {
getchoices
():
void
{
//System
this
.
mainService
.
get
classsystem
()
this
.
mainService
.
get
dictionary
()
.
subscribe
(
data
=>
{
this
.
systems
=
data
...
...
@@ -115,189 +94,6 @@ export class BoilerplateDetailsComponent implements OnInit {
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getinstancesystem
()
.
subscribe
(
data
=>
{
this
.
instacesystems
=
data
},
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getsubclassystem
()
.
subscribe
(
data
=>
{
this
.
subclassystems
=
data
},
error
=>
{
console
.
log
(
error
);
});
//Function
this
.
mainService
.
getclassfunction
()
.
subscribe
(
data
=>
{
this
.
functions
=
data
},
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getinstancefunction
()
.
subscribe
(
data
=>
{
this
.
instacefunctions
=
data
},
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getsubclasfunction
()
.
subscribe
(
data
=>
{
this
.
subclasfunctions
=
data
},
error
=>
{
console
.
log
(
error
);
});
//Item
this
.
mainService
.
getclassitem
()
.
subscribe
(
data
=>
{
this
.
items
=
data
},
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getinstanceitem
()
.
subscribe
(
data
=>
{
this
.
instaceitems
=
data
},
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getsubclasitem
()
.
subscribe
(
data
=>
{
this
.
subclasitems
=
data
},
error
=>
{
console
.
log
(
error
);
});
//Interface
this
.
mainService
.
getclassinterface
()
.
subscribe
(
data
=>
{
this
.
interfaces
=
data
},
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getinstanceinterface
()
.
subscribe
(
data
=>
{
this
.
instaceinterfaces
=
data
},
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getsubclasinterface
()
.
subscribe
(
data
=>
{
this
.
subclasinterfaces
=
data
},
error
=>
{
console
.
log
(
error
);
});
//Connection
this
.
mainService
.
getclassconnection
()
.
subscribe
(
data
=>
{
this
.
connections
=
data
},
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getinstanceconnection
()
.
subscribe
(
data
=>
{
this
.
instaceconnections
=
data
},
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getsubclasconnection
()
.
subscribe
(
data
=>
{
this
.
subclasconnections
=
data
},
error
=>
{
console
.
log
(
error
);
});
//Flow
this
.
mainService
.
getclassflow
()
.
subscribe
(
data
=>
{
this
.
flows
=
data
},
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getinstanceflow
()
.
subscribe
(
data
=>
{
this
.
instaceflows
=
data
},
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getsubclasflow
()
.
subscribe
(
data
=>
{
this
.
subclasflows
=
data
},
error
=>
{
console
.
log
(
error
);
});
//State
this
.
mainService
.
getclassstate
()
.
subscribe
(
data
=>
{
this
.
states
=
data
},
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getinstancestate
()
.
subscribe
(
data
=>
{
this
.
instacestates
=
data
console
.
log
(
data
)
},
error
=>
{
console
.
log
(
error
);
});
this
.
mainService
.
getsubclasstate
()
.
subscribe
(
data
=>
{
this
.
subclasstates
=
data
},
error
=>
{
console
.
log
(
error
);
});
}
checkeven
(
i
:
any
):
any
{
...
...
reqtool/ReqmanAngular11/src/app/models/boilerplate.model.ts
View file @
b5a70ddf
...
...
@@ -24,4 +24,27 @@ export class InferenceResults {
id
?:
any
;
infer_group_of_boilerplate
?:
any
;
inference_data
?:
string
;
}
export
class
Sections
{
Name
?:
string
;
TheClasses
?:
Classes
[];
GeneralInstances
?:
Instances
[];
}
export
class
Classes
{
Class
?:
string
;
Comment
?:
string
;
Subclass
?:
SubClasses
[];
Instance_of_Class
?:
Instances
[];
}
export
class
SubClasses
{
SubClass_name
?:
string
;
SubclassComment
?:
string
InstanceOfSubclass
?:
Instances
[];
}
export
class
Instances
{
Instance
?:
any
;
}
\ No newline at end of file
reqtool/ReqmanAngular11/src/app/services/main.service.ts
View file @
b5a70ddf
...
...
@@ -152,5 +152,8 @@ export class MainService {
getinstancestate
():
Observable
<
any
>
{
return
this
.
http
.
get
(
`http://155.207.131.19:8000/api-auth/class/state/instance`
);
}
getdictionary
():
Observable
<
any
>
{
return
this
.
http
.
get
(
`http://155.207.131.19:8000/api-auth/dictionary`
);
}
}
reqtool/reqman/api/reqman/apps/reqtool/rest_api/services/parse_ontologies.py
View file @
b5a70ddf
...
...
@@ -13,6 +13,9 @@ list_of_DSO = ["http://delab.csd.auth.gr/ontologies/2018/SAO#","http://delab.csd
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#"
]
Dictionary_Data
=
{}
Dictionary_Data_list
=
[]
g
=
Graph
()
g
.
load
(
Ontology_file
,
format
=
"turtle"
)
...
...
@@ -97,6 +100,8 @@ def get_file_and_instances(keyword):
#Instances and Comments
def
get_dmo_instance_and_comment
(
keyword
):
dmo_dic
=
{}
dic_list
=
[]
mid_list
=
[]
out_list_com
=
[]
keywordspl
=
keyword
.
split
(
"#"
)
...
...
@@ -115,6 +120,8 @@ def get_dmo_instance_and_comment(keyword):
uri
=
spl
[
len
(
spl
)
-
2
]
.
split
(
"/"
)
mid_list
.
append
(
extra
)
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 descreption!!!!!
#for now it returns only the instances
for
extra
in
mid_list
:
...
...
@@ -125,40 +132,101 @@ def get_dmo_instance_and_comment(keyword):
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
return
dic_list
#Classes and Comments
def
get_dmo_classes_and_comment
(
keyword
):
dmo_dic
=
{}
dic_list
=
[]
dmo_dic_in
=
{}
dic_list_in
=
[]
dmo_dic_backup
=
{}
dic_list_backup
=
[]
out_list_instance
=
[]
out_list_instance_backup
=
[]
out_list_com
=
[]
keywordspl
=
keyword
.
split
(
"#"
)
in_list
=
[
keywordspl
[
len
(
keywordspl
)
-
1
]]
section
=
keywordspl
[
len
(
keywordspl
)
-
1
]
in_list
=
[
section
]
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
])
out_list_instance_backup
.
append
(
spl
[
len
(
spl
)
-
1
])
out_list_instance_backup
.
append
(
" "
)
dmo_dic_backup
=
{
"Class"
:
str
(
spl
[
len
(
spl
)
-
1
]),
"Comment"
:
''
,
'Subclass'
:
''
,
'Instance_of_Class'
:
''
}
dic_list_backup
.
append
(
dmo_dic_backup
)
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
(
"/"
)
dmo_dic_in
=
{
'GeneralInstances'
:
spl
[
len
(
spl
)
-
1
]}
dic_list_in
.
append
(
dmo_dic_in
)
for
comment
in
out_list_instance
:
instance_list
=
[]
instance_dict
=
{}
for
uri
in
list_of_DSO
:
per
=
URIRef
(
uri
+
comment
)
for
s2
,
p2
,
o2
in
g
.
triples
((
None
,
RDF
.
type
,
per
)):
spl
=
s2
.
split
(
"#"
)
instance_dict
=
{
"Instance"
:
spl
[
len
(
spl
)
-
1
]}
instance_list
.
append
(
instance_dict
)
name_class
=
""
comment_class
=
""
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
))
name_class
=
str
(
comment
)
out_list_com
.
append
((
str
(
o
)
.
replace
(
"
\r
"
,
""
))
.
replace
(
"
\n
"
,
""
))
comment_class
=
(
str
(
o
)
.
replace
(
"
\r
"
,
""
))
.
replace
(
"
\n
"
,
""
)
suclass_dict
=
{}
subclass_list
=
[]
sub_ins
=
[]
sub_ins_dict
=
{}
for
uri
in
list_of_DSO
:
subclas_name
=
""
per2
=
URIRef
(
uri
+
comment
)
for
s1
,
p1
,
o1
in
g
.
triples
((
None
,
RDFS
.
subClassOf
,
per2
)):
spl1
=
s1
.
split
(
"#"
)
#subclass_list.append(spl1[len(spl1) - 1])
subclas_name
=
spl1
[
len
(
spl1
)
-
1
]
kop
=
URIRef
(
uri
+
spl1
[
len
(
spl1
)
-
1
])
find_comment
=
""
for
q
,
w
,
m
in
g
.
triples
((
kop
,
RDFS
.
comment
,
None
)):
find_comment
=
(
str
(
m
)
.
replace
(
"
\r
"
,
""
))
.
replace
(
"
\n
"
,
""
)
per3
=
uri
+
spl1
[
len
(
spl1
)
-
1
]
for
s2
,
p2
,
o2
in
g
.
triples
((
None
,
RDF
.
type
,
per3
)):
spl2
=
s2
.
split
(
"#"
)
sub_ins_dict
=
{
"Instance"
:
spl2
[
len
(
spl2
)
-
1
]}
sub_ins
.
append
(
sub_ins_dict
)
suclass_dict
=
{
'SubClass_name'
:
subclas_name
,
'SubclassComment'
:
find_comment
,
'InstanceOfSubclass'
:
sub_ins
}
subclass_list
.
append
(
suclass_dict
)
dmo_dic
=
{
"Class"
:
name_class
,
"Comment"
:
comment_class
,
'Subclass'
:
subclass_list
,
'Instance_of_Class'
:
instance_list
}
dic_list
.
append
(
dmo_dic
)
if
out_list_com
:
return
out_list_com
Dictionary_Data
=
{
"Name"
:
section
,
"TheClasses"
:
dic_list
,
"GeneralInstances"
:
dic_list_in
}
Dictionary_Data_list
.
append
(
Dictionary_Data
)
return
dic_list
else
:
if
out_list_instance_backup
:
return
out_list_instance_backup
if
dic_list_backup
:
Dictionary_Data
=
{
"Name"
:
section
,
"TheClasses"
:
dic_list_backup
,
"GeneralInstances"
:
dic_list_in
}
Dictionary_Data_list
.
append
(
Dictionary_Data
)
return
dic_list_backup
else
:
out_list_instance_backup
.
append
(
" "
)
return
out_list_instance_backup
dmo_dic_backup
=
{
"Class"
:
" "
,
"Comment"
:
" "
}
dic_list_backup
.
append
(
dmo_dic_backup
)
Dictionary_Data
=
{
"Name"
:
section
,
"TheClasses"
:
dic_list_backup
,
"GeneralInstances"
:
dic_list_in
}
Dictionary_Data_list
.
append
(
Dictionary_Data
)
return
dic_list_backup
#Classes of classes and Comments
def
get_dmo_classes_of_classes_and_comment
(
keyword
):
dmo_dic
=
{}
dic_list
=
[]
out_list_instance
=
[]
out_list_com
=
[]
mid_list
=
[]
...
...
@@ -179,13 +247,13 @@ def get_dmo_classes_of_classes_and_comment(keyword):
out_list_com
.
append
(
str
(
comment
))
out_list_com
.
append
(
spl
[
len
(
spl
)
-
1
])
kop
=
URIRef
(
uri
+
spl
[
len
(
spl
)
-
1
])
find_comment
=
False
find_comment
=
""
for
q
,
w
,
m
in
g
.
triples
((
kop
,
RDFS
.
comment
,
None
)):
out_list_com
.
append
((
str
(
m
)
.
replace
(
"
\r
"
,
""
))
.
replace
(
"
\n
"
,
""
))
find_comment
=
True
if
find_comment
==
False
:
out_list_com
.
append
(
" "
)
return
(
out_list_com
)
find_comment
=
(
str
(
m
)
.
replace
(
"
\r
"
,
""
))
.
replace
(
"
\n
"
,
""
)
dmo_dic
=
{
"Class"
:
str
(
comment
),
'Subclass'
:
spl
[
len
(
spl
)
-
1
],
"SubclassComment"
:
find_comment
}
dic_list
.
append
(
dmo_dic
)
return
(
dic_list
)
'''Get Instaces - return list'''
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/urls.py
View file @
b5a70ddf
...
...
@@ -86,5 +86,8 @@ urlpatterns = [
path
(
'class/state'
,
main_req_views
.
StateClassViewSet
.
as_view
(),
name
=
'class_state'
),
path
(
'class/state/subclasses'
,
main_req_views
.
StateSubclasesViewSet
.
as_view
(),
name
=
'subclass_state'
),
path
(
'class/state/instance'
,
main_req_views
.
StateInstancesViewSet
.
as_view
(),
name
=
'instances_of_state'
),
#Dictionary
path
(
'dictionary/'
,
main_req_views
.
DictionaryViewSet
.
as_view
(),
name
=
'dictionary'
),
]
\ No newline at end of file
reqtool/reqman/api/reqman/apps/reqtool/rest_api/views/main_req_views.py
View file @
b5a70ddf
...
...
@@ -10,6 +10,7 @@ from reqman.apps.reqtool.rest_api.serializers.main_req import MainSerializer
from
reqman.apps.permissions
import
IsOwnerOrReadOnly
from
reqman.apps.reqtool.rest_api.services
import
fuseki
,
inference
from
reqman.apps.reqtool.rest_api.services.parse_ontologies
import
Dictionary_Data_list
from
rest_framework.response
import
Response
from
rest_framework.views
import
APIView
...
...
@@ -278,4 +279,10 @@ class StateInstancesViewSet(APIView):
def
get
(
self
,
request
):
response
=
Response
(
STATE_INSTANCES_COMMENTS
)
return
response
class
DictionaryViewSet
(
APIView
):
def
get
(
self
,
request
):
response
=
Response
(
Dictionary_Data_list
)
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