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
7524bcf9
Commit
7524bcf9
authored
Mar 09, 2023
by
Thodoris Nestoridis
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://depend.csd.auth.gr:8443/nestorid/requirement-tool
parents
0b415de0
8d8ed690
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
92 additions
and
32 deletions
+92
-32
boilerplate-details.component.html
...ts/boilerplate-details/boilerplate-details.component.html
+8
-8
boilerplate-details.component.scss
...ts/boilerplate-details/boilerplate-details.component.scss
+6
-1
boilerplate-list.component.html
...mponents/boilerplate-list/boilerplate-list.component.html
+10
-4
boilerplate-list.component.scss
...mponents/boilerplate-list/boilerplate-list.component.scss
+11
-0
boilerplate-list.component.ts
...components/boilerplate-list/boilerplate-list.component.ts
+37
-2
inference.py
...an/api/reqman/apps/reqtool/rest_api/services/inference.py
+10
-15
teoProjectUbuntu.jar
.../reqtool/rest_api/services/inference/teoProjectUbuntu.jar
+0
-0
requirements_views.py
.../reqman/apps/reqtool/rest_api/views/requirements_views.py
+1
-1
user_views.py
...qman/api/reqman/apps/reqtool/rest_api/views/user_views.py
+9
-1
No files found.
reqtool/ReqmanAngular11/src/app/components/boilerplate-details/boilerplate-details.component.html
View file @
7524bcf9
...
...
@@ -238,27 +238,27 @@
<ul>
<button
mat-button
[
matMenuTriggerFor
]="
menu
"
[
matMenuTriggerData
]="{
section:
section
.
Name
,
class:
item
.
Class
,
subclass:
sub
.
SubClass_name
,
subsubclass:subsub
.
SubSubClass_name
,
subsubsubclass:
subsubsub
.
SubSubClass_name
,
subsubsubsubclass:
subsubsubsub
.
SubSubClass_name
}"
#
menuTrigger
>
<h5>
Instances
</h5>
<h5>
AAA-
Instances
</h5>
</button>
<div
*
ngFor=
"let subsubsubsubinstansub of subsubsubsub.SubInstanceOfSubclass| filter:searchText"
>
<li>
<mat-expansion-panel
hideToggle
>
<mat-expansion-panel-header>
<mat-panel-title
class=
"d-flex justify-content-between"
>
<mat-panel-title
class=
"d-flex justify-content-between"
>
<span
div
fxLayout=
"row"
fxLayoutAlign=
"space-around center"
>
{{subsubsubsubinstansub.Instance}}
</span>
<div
style=
"margin-bottom: 4px;"
>
<button
*
ngIf=
"section.Name == 'Function' || section.Name == 'System' || section.Name == 'Item' "
mat-mini-fab
color=
"primary"
style=
"margin-right: 8px;"
(
click
)="
openInstanceDialog
(
subsubsubsubinstansub
.
Instance
,
section
.
Name
,
item
.
Class
,
sub
.
SubClass_name
,
subsub
.
SubSubClass_name
,
subsubsub
.
SubSubClass_name
,
subsubsubsub
.
SubSubClass_name
)"
>
<mat-icon>
add
</mat-icon>
*
ngIf=
"section.Name == 'Function' || section.Name == 'System' || section.Name == 'Item' "
mat-mini-fab
color=
"primary"
style=
"margin-right: 8px;"
(
click
)="
openInstanceDialog
(
subsubsubsubinstansub
.
Instance
,
section
.
Name
,
item
.
Class
,
sub
.
SubClass_name
,
subsub
.
SubSubClass_name
,
subsubsub
.
SubSubClass_name
,
subsubsubsub
.
SubSubClass_name
)"
>
<mat-icon>
add
</mat-icon>
</button>
<button
mat-mini-fab
color=
"warn"
(
click
)="
deleteInstance
(
section
.
Name
,
item
.
Class
,
sub
.
SubClass_name
,
subsub
.
SubSubClass_name
,
subsubsub
.
SubSubClass_name
,
subsubsubsub
.
SubSubClass_name
,
subsubsubsubinstansub
.
Instance
,
subsubsubsubinstansub
.
Comment
)"
>
(
click
)="
deleteInstance
(
section
.
Name
,
item
.
Class
,
sub
.
SubClass_name
,
subsub
.
SubSubClass_name
,
subsubsub
.
SubSubClass_name
,
subsubsubsub
.
SubSubClass_name
,
subsubsubsubinstansub
.
Instance
,
subsubsubsubinstansub
.
Comment
)"
>
<mat-icon>
delete
</mat-icon>
<mat-icon>
delete
</mat-icon>
</button>
</div>
</mat-panel-title>
...
...
reqtool/ReqmanAngular11/src/app/components/boilerplate-details/boilerplate-details.component.scss
View file @
7524bcf9
...
...
@@ -27,5 +27,10 @@
top
:
1%
;
right
:
0px
;
height
:
100%
;
overflow
:auto
;
overflow
:auto
;
}
.d-flex
{
overflow-x
:
auto
;
white-space
:
nowrap
;
}
\ No newline at end of file
reqtool/ReqmanAngular11/src/app/components/boilerplate-list/boilerplate-list.component.html
View file @
7524bcf9
...
...
@@ -69,22 +69,26 @@
</ng-container>
<!-- Name Column -->
<ng-container
matColumnDef=
"prefix_data"
>
<ng-container
matColumnDef=
"prefix_data"
>
<th
mat-header-cell
*
matHeaderCellDef
>
Prefix
</th>
<td
mat-cell
*
matCellDef=
"let element"
>
{{element.prefix_data}}
</td>
<td
mat-cell
*
matCellDef=
"let element"
[
matTooltip
]="
element
.
prefix_data
&&
element
.
prefix_data
.
length
>
70 ? element.prefix_data : null"
matTooltipClass="custom-tooltip" matTooltipPosition="above">{{element.prefix_data
&&
element.prefix_data.length > 70 ? element.prefix_data.substr(0, 70) +'...': element.prefix_data}}
</td>
</ng-container>
<!-- Name Column -->
<ng-container
matColumnDef=
"title_data"
>
<th
mat-header-cell
*
matHeaderCellDef
>
Title
</th>
<td
mat-cell
*
matCellDef=
"let element"
matTooltip=
{{get_metrics(element.title_data)}}
>
{{element.title_data}}
<td
mat-cell
*
matCellDef=
"let element"
[
matTooltip
]="
get_metrics
(
element
.
title_data
).
length
>
0 ? get_metrics(element.title_data) : null"
> {{element.title_data}}
<span
*
ngIf=
"get_metrics(element.title_data).length > 0"
matBadge=
{{get_metrics(element.title_data).length}}
matBadgeColor=
"warn"
matBadgeSize=
"small"
position=
"above"
>
</span>
<span
*
ngIf=
"get_secondary_metrics(element.title_data).length > 0"
matBadge=
{{get_secondary_metrics(element.title_data).length}}
matBadgeColor=
"accent"
matBadgeSize=
"small"
position=
"above"
>
</span>
</td>
</ng-container>
<ng-container
matColumnDef=
"main_data"
>
<th
mat-header-cell
*
matHeaderCellDef
>
Main
</th>
<td
mat-cell
*
matCellDef=
"let element"
>
{{element.main_data}}
</td>
<td
mat-cell
*
matCellDef=
"let element"
[
matTooltip
]="
element
.
main_data
&&
element
.
main_data
.
length
>
70 ? element.main_data : null"
matTooltipClass="custom-tooltip" matTooltipPosition="above">{{element.main_data
&&
element.main_data.length > 70 ? element.main_data.substr(0, 70) +'...': element.main_data}}
</td>
</ng-container>
<ng-container
matColumnDef=
"suffix_data"
>
...
...
@@ -107,7 +111,9 @@
<mat-paginator
#
paginator
[
pageSizeOptions
]="[
20
,
50
]"
showFirstLastButtons
></mat-paginator>
</div>
<div
*
ngIf=
"!this.spinnerchart"
>
<div
echarts
[
options
]="
chartOption
"
class=
"demo-chart"
></div>
</div>
<div
class=
"content"
>
<div
fxLayout=
"row wrap"
>
...
...
reqtool/ReqmanAngular11/src/app/components/boilerplate-list/boilerplate-list.component.scss
View file @
7524bcf9
...
...
@@ -24,4 +24,15 @@ table {
.mat-row
:hover
.mat-cell
{
border-color
:
currentColor
;
}
::ng-deep
.custom-tooltip
{
background-color
:
#333
;
color
:
#fff
;
font-size
:
14px
;
padding
:
8px
;
border-radius
:
4px
;
max-width
:
600px
!
important
;
white-space
:
normal
;
word-wrap
:
break-word
;
}
\ No newline at end of file
reqtool/ReqmanAngular11/src/app/components/boilerplate-list/boilerplate-list.component.ts
View file @
7524bcf9
...
...
@@ -43,6 +43,8 @@ export class BoilerplateListComponent implements OnInit {
}
],
};
spinnerchart
=
true
;
private
readonly
notifier
:
NotifierService
;
boilerplates
?:
Boilerplate
[];
boilerplatesdata
?:
BoilerplateData
[];
...
...
@@ -67,6 +69,8 @@ export class BoilerplateListComponent implements OnInit {
list_of_inference_metrics
=
[
"IncompleteRequirement"
,
"AmbiguousRequirement"
,
"InconsistentRequirement"
,
"NoisyRequirement"
,
"OpaqueRequirement"
,
"RedundantRequirement"
]
list_of_primary_inference_metrics
=
[
"IncompleteRequirement"
,
"AmbiguousRequirement"
,
"InconsistentRequirement"
,
"RedundantRequirement"
]
list_of_secondary_inference_metrics
=
[
"NoisyRequirement"
,
"OpaqueRequirement"
]
@
ViewChild
(
MatPaginator
)
paginator
=
this
.
newdataSource
.
paginator
;
...
...
@@ -186,12 +190,13 @@ export class BoilerplateListComponent implements OnInit {
}
}
//console.log(final);
this
.
chartOption
.
series
=
[{
type
:
'pie'
,
radius
:
[
'40%'
,
'70%'
],
data
:
final
,
}]
this
.
spinnerchart
=
false
;
},
error
=>
{
console
.
log
(
error
);
...
...
@@ -227,12 +232,42 @@ export class BoilerplateListComponent implements OnInit {
get_metrics
(
i
:
any
):
any
{
if
(
this
.
currentInfer
?.
inference_data
)
{
const
obj
=
JSON
.
parse
(
this
.
currentInfer
[
'inference_data'
].
replace
(
/'/g
,
"
\"
"
))
var
final
=
[]
if
(
obj
[
i
])
{
for
(
let
j
in
obj
[
i
]){
//console.log(obj[i][j])
if
(
this
.
list_of_primary_inference_metrics
.
includes
(
obj
[
i
][
j
])){
final
.
push
(
obj
[
i
][
j
])
}
}
//return obj[i]
}
//final.push({ value: obj[i].length, name: i })
return
final
;
}
return
0
}
get_secondary_metrics
(
i
:
any
):
any
{
if
(
this
.
currentInfer
?.
inference_data
)
{
const
obj
=
JSON
.
parse
(
this
.
currentInfer
[
'inference_data'
].
replace
(
/'/g
,
"
\"
"
))
var
final
=
[]
if
(
obj
[
i
])
{
return
obj
[
i
]
for
(
let
j
in
obj
[
i
]){
//console.log(obj[i][j])
if
(
this
.
list_of_secondary_inference_metrics
.
includes
(
obj
[
i
][
j
])){
final
.
push
(
obj
[
i
][
j
])
}
}
//return obj[i]
}
//final.push({ value: obj[i].length, name: i })
return
final
;
}
return
0
}
getnumreq
():
any
{
return
this
.
boilerplatesdata
?.
length
}
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/services/inference.py
View file @
7524bcf9
...
...
@@ -285,6 +285,7 @@ def exportboiltottl(ontfile,project, prefix, boilerplate, main, suffix):
g
.
serialize
(
destination
=
save_path
+
file_name
+
'.ttl'
,
format
=
'turtle'
)
return
(
save_path
+
file_name
)
#print(g.serialize(format="turtle").decode("utf-8"))
import
time
def
shacl
(
ontotlogy_file
):
metrics_dict
=
{}
...
...
@@ -294,21 +295,15 @@ def shacl(ontotlogy_file):
shutil
.
copyfile
(
file1
,
target
)
final_result
=
''
target1
=
target
.
replace
(
" "
,
"
\
"
)
for
i
in
range
(
30
):
print
(
i
+
1
,
'Cycle of inferencing'
)
#result = subprocess.check_output(["./reqman/apps/reqtool/rest_api/services/shacl-1.3.2/bin/shaclinfer.sh", "-datafile", target])
try
:
result
=
subprocess
.
check_output
(
"./reqman/apps/reqtool/rest_api/services/shacl-1.4.2/bin/shaclinfer.sh -datafile "
+
target1
+
" | grep -v -e 'WARN OntDocumentManager' -e 'at org.' -e 'org.apache.' -e '@' "
,
shell
=
True
,
timeout
=
360
)
except
:
raise
APIException
(
"Problem during the Inferencing"
)
if
(
result
==
final_result
):
break
final_result
=
result
file_object
=
open
(
target
,
'a'
)
res
=
str
(
result
,
'utf-8'
)
file_object
.
write
(
res
.
strip
())
file_object
.
close
()
open
(
'tempOnt.ttl'
,
'w'
)
.
close
()
shutil
.
copyfile
(
target1
,
'tempOnt.ttl'
)
cmd
=
[
'java'
,
'-jar'
,
'reqman/apps/reqtool/rest_api/services/inference/teoProjectUbuntu.jar'
]
try
:
output
=
subprocess
.
check_output
(
cmd
)
except
:
raise
APIException
(
"Problem during the Inferencing"
)
shutil
.
copyfile
(
'ontology.ttl'
,
target
)
os
.
remove
(
'ontology.ttl'
)
#need to fiil with all the metrics
g
=
Graph
()
gon
=
Graph
()
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/services/inference/teoProjectUbuntu.jar
0 → 100755
View file @
7524bcf9
File added
reqtool/reqman/api/reqman/apps/reqtool/rest_api/views/requirements_views.py
View file @
7524bcf9
...
...
@@ -292,7 +292,7 @@ class InferDetailsAPIView(RetrieveUpdateDestroyAPIView):
maindata
.
append
(
self
.
getmaindata
(
id
.
boilerplate_data_id
.
id
))
suffixdata
.
append
(
self
.
getsuffixdata
(
id
.
boilerplate_data_id
.
id
))
#try:
metrics
,
onto_file
=
inference
.
inferencing
(
instance
[
'ontology_file'
],
project_title
,
boildata
,
prefixdata
,
maindata
,
suffixdata
)
metrics
,
onto_file
=
(
inference
.
inferencing
(
instance
[
'ontology_file'
],
project_title
,
boildata
,
prefixdata
,
maindata
,
suffixdata
)
)
#except:
# raise APIException("Not all instances in the Ontology")
instance
.
update
(
inference_data
=
metrics
,
ontology_file
=
onto_file
)
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/views/user_views.py
View file @
7524bcf9
...
...
@@ -25,9 +25,17 @@ def signup(request):
mail
=
data
[
'email'
]
username
=
data
[
'username'
]
password
=
data
[
'password1'
]
user
=
User
.
objects
.
create_user
(
email
=
mail
,
password
=
password
)
send_mail
(
'Welcome to our site'
,
f
'Hi {username},
\n\n
Thanks for signing up for our site!'
,
settings
.
EMAIL_HOST_USER
,
[
mail
],
fail_silently
=
False
,
)
send_mail
(
'New register from Requirement tool'
,
' Username :'
+
username
+
'
\n
Mail:'
+
mail
+
'
\n
Password:'
+
password
,
' Username :'
+
username
+
'
\n
Mail:'
+
mail
+
'
\n
Fullname:'
+
username
+
'/n'
,
settings
.
EMAIL_HOST_USER
,
[
'nestorid@gapps.auth.gr'
],
fail_silently
=
False
,
...
...
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