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
4ef011fc
Commit
4ef011fc
authored
Jul 21, 2022
by
Thodoris Nestoridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Complete 5 Main Auto REq - Change table -del rows
parent
a250d052
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
425 additions
and
194 deletions
+425
-194
boilerplate-details.component.html
...ts/boilerplate-details/boilerplate-details.component.html
+3
-2
boilerplate-details.component.ts
...ents/boilerplate-details/boilerplate-details.component.ts
+19
-8
boilerplate-list.component.html
...mponents/boilerplate-list/boilerplate-list.component.html
+25
-15
boilerplate-list.component.scss
...mponents/boilerplate-list/boilerplate-list.component.scss
+1
-1
boilerplate-list.component.ts
...components/boilerplate-list/boilerplate-list.component.ts
+18
-0
course-dialog-component.component.html
...e-dialog-component/course-dialog-component.component.html
+136
-5
course-dialog-component.component.ts
...rse-dialog-component/course-dialog-component.component.ts
+4
-1
main-details.component.html
...c/app/components/main-details/main-details.component.html
+174
-157
main-details.component.ts
...src/app/components/main-details/main-details.component.ts
+9
-2
main_req_views.py
.../api/reqman/apps/reqtool/rest_api/views/main_req_views.py
+36
-3
No files found.
reqtool/ReqmanAngular11/src/app/components/boilerplate-details/boilerplate-details.component.html
View file @
4ef011fc
...
...
@@ -167,7 +167,7 @@
<span
div
fxLayout=
"row"
fxLayoutAlign=
"space-around center"
>
{{instan.Instance}}
</span>
<div
style=
"margin-bottom: 4px;"
>
<button
*
ngIf=
"section.Name == 'Function' || section.Name == 'System' || section.Name == 'Item'"
*
ngIf=
"section.Name == 'Function' || section.Name == 'System' || section.Name == 'Item'
"
mat-mini-fab
color=
"primary"
style=
"margin-right: 8px;"
(
click
)="
openInstanceDialog
(
instan
.
Instance
,
section
.
Name
,
item
.
Class
,
'',
'',
'',
'')"
>
<mat-icon>
add
</mat-icon>
...
...
@@ -416,7 +416,8 @@
<mat-panel-title
class=
"d-flex justify-content-between"
>
<span
div
fxLayout=
"row"
fxLayoutAlign=
"space-around center"
>
{{genin.Instance}}
</span>
<div
style=
"margin-bottom: 4px;"
>
<button
*
ngIf=
"section.Name == 'Function' || section.Name == 'System' || section.Name == 'Item' "
<button
*
ngIf=
"section.Name == 'Function' || section.Name == 'System' || section.Name == 'Item' "
mat-mini-fab
color=
"primary"
style=
"margin-right: 8px;"
(
click
)="
openInstanceDialog
(
genin
.
Instance
,
section
.
Name
,
'',
'',
'',
'',
'')"
>
<mat-icon>
add
</mat-icon>
...
...
reqtool/ReqmanAngular11/src/app/components/boilerplate-details/boilerplate-details.component.ts
View file @
4ef011fc
...
...
@@ -494,22 +494,33 @@ export class BoilerplateDetailsComponent implements OnInit {
if
(
this
.
sufchild
)
{
this
.
sufchild
.
getflowchoices
(
this
.
route
.
snapshot
.
params
.
gb
);
}
//write requirements in the ontology (invokation, contain, belongsTo)
if
(
isInstance
)
{
this
.
mainService
.
setsecondaryrequirement
(
this
.
route
.
snapshot
.
params
.
gb
,
section
,
currentInstance
,
result
.
instance
,
" "
).
subscribe
(
data
=>
{
},
error
=>
{
if
(
error
.
error
.
text
==
'Update Instance'
)
{
}
else
{
this
.
notifier
.
notify
(
"warning"
,
(
JSON
.
stringify
(
error
.
error
.
detail
)));
}
})
if
(
result
.
selectedValue
)
{
this
.
mainService
.
setsecondaryrequirement
(
this
.
route
.
snapshot
.
params
.
gb
,
section
,
currentInstance
,
result
.
instance
,
result
.
selectedValue
).
subscribe
(
data
=>
{
},
error
=>
{
if
(
error
.
error
.
text
==
'Update Instance'
)
{
}
else
{
this
.
notifier
.
notify
(
"warning"
,
(
JSON
.
stringify
(
error
.
error
.
detail
)));
}
})
}
else
{
this
.
mainService
.
setsecondaryrequirement
(
this
.
route
.
snapshot
.
params
.
gb
,
section
,
currentInstance
,
result
.
instance
,
" "
).
subscribe
(
data
=>
{
},
error
=>
{
if
(
error
.
error
.
text
==
'Update Instance'
)
{
}
else
{
this
.
notifier
.
notify
(
"warning"
,
(
JSON
.
stringify
(
error
.
error
.
detail
)));
}
})
}
}
if
(
result
.
selectedValue
)
{
if
(
result
.
selectedValue
&&
!
result
.
selectedValue2
&&
!
isInstance
)
{
{
this
.
mainService
.
setsecondaryrequirement
(
this
.
route
.
snapshot
.
params
.
gb
,
section
,
result
.
instance
,
result
.
selectedValue
,
" "
).
subscribe
(
data
=>
{
},
error
=>
{
if
(
error
.
error
.
text
==
'Update Instance'
)
{
}
else
{
this
.
notifier
.
notify
(
"warning"
,
(
JSON
.
stringify
(
error
.
error
.
detail
)));
}
})
}
}
if
(
result
.
selectedValue2
)
{
{
this
.
mainService
.
setsecondaryrequirement
(
this
.
route
.
snapshot
.
params
.
gb
,
section
,
result
.
instance
,
result
.
selectedValue
,
result
.
selectedValue2
).
subscribe
(
data
=>
{
},
error
=>
{
if
(
error
.
error
.
text
==
'Update Instance'
)
{
}
else
{
this
.
notifier
.
notify
(
"warning"
,
(
JSON
.
stringify
(
error
.
error
.
detail
)));
}
})
}
}
}
else
{
this
.
notifier
.
notify
(
"warning"
,
(
JSON
.
stringify
(
error
.
error
.
detail
)));
}
});
//this.ngOnInit();
//Call to update instances
}
}
...
...
@@ -521,7 +532,7 @@ export class BoilerplateDetailsComponent implements OnInit {
openDialog
(
section
:
any
,
classes
:
any
,
subclass
:
any
,
subsubclass
:
any
,
subsubsubclass
:
any
,
subsubsubsubclass
:
any
)
{
const
dialogRef
=
this
.
dialog
.
open
(
CourseDialogComponentComponent
,
{
width
:
((
section
==
'StateValue'
)
?
'60%'
:
'auto'
),
width
:
((
section
==
'StateValue'
||
section
==
'State'
||
section
==
'Item'
)
?
'60%'
:
'auto'
),
data
:
{
name
:
section
+
(
classes
?
' : '
+
classes
:
''
)
+
(
subclass
?
' : '
+
subclass
:
''
)
+
(
subsubclass
?
' : '
+
subsubclass
:
''
)
+
(
subsubsubclass
?
' : '
+
subsubsubclass
:
''
)
+
(
subsubsubsubclass
?
' : '
+
subsubsubsubclass
:
''
),
instance
:
this
.
currentDialog
.
instance
,
comment
:
this
.
currentDialog
.
comment
,
isInstance
:
false
,
currentInstance
:
""
,
currentSection
:
section
...
...
reqtool/ReqmanAngular11/src/app/components/boilerplate-list/boilerplate-list.component.html
View file @
4ef011fc
...
...
@@ -5,24 +5,26 @@
</ol>
</nav>
<div
class=
"list row"
>
<div
class=
"col
-md-14
"
>
<div
class=
"col"
>
<div
fxFlex
fxLayout
fxHide
.
xs
fxLayoutAlign=
"end"
>
<input
type=
"text"
class=
"form-control"
placeholder=
"Search"
(
keyup
)="
applyFilter
($
event
)"
#
input
/>
</div>
<div
fxFlex
fxLayout
fxHide
.
xs
fxLayoutAlign=
"end"
>
<ul
fxLayout
fxLayoutGap=
"15px"
class=
"navigation-items"
>
<div>
<input
class=
"btn btn-success"
type=
"button"
value=
"Add Requirement"
routerLink=
"add-boilerplate"
/>
</div>
</ul>
</div>
<div
fxFlex
fxLayout
fxHide
.
xs
fxLayoutAlign=
"end"
>
<ul
*
ngFor=
"let inf of infer;"
fxLayout
fxLayoutGap=
"15px"
class=
"navigation-items"
>
<div>
<input
class=
"btn btn-info"
[
disabled
]="
exporting
"
type=
"button"
value=
"Inferencing"
(
click
)="
updateInfer
(
inf
.
id
)"
/>
</div>
</ul>
<div>
<div
fxFlex
fxLayout
fxHide
.
xs
fxLayoutAlign=
"end"
>
<ul
fxLayout
fxLayoutGap=
"15px"
class=
"navigation-items"
>
<div>
<input
class=
"btn btn-success"
type=
"button"
value=
"Add Requirement"
routerLink=
"add-boilerplate"
/>
</div>
</ul>
</div>
<div
fxFlex
fxLayout
fxHide
.
xs
fxLayoutAlign=
"end"
>
<ul
*
ngFor=
"let inf of infer;"
fxLayout
fxLayoutGap=
"15px"
class=
"navigation-items"
>
<div>
<input
class=
"btn btn-info"
[
disabled
]="
exporting
"
type=
"button"
value=
"Inferencing"
(
click
)="
updateInfer
(
inf
.
id
)"
/>
</div>
</ul>
</div>
</div>
<div
fxFlex
fxLayout
fxHide
.
xs
fxLayoutAlign=
"end"
>
<div>
...
...
@@ -30,6 +32,14 @@
(
click
)="
getCurrentOntology
()"
/>
</div>
</div>
<div
fxFlex
fxLayout
fxHide
.
xs
fxLayoutAlign=
"end"
*
ngIf=
"this.selection.selected.length >= 1"
>
<div>
<button
mat-mini-fab
color=
"warn"
(
click
)="
deleteBoilerplateList
()"
>
<mat-icon>
delete
</mat-icon>
</button>
</div>
</div>
</div>
</div>
...
...
reqtool/ReqmanAngular11/src/app/components/boilerplate-list/boilerplate-list.component.scss
View file @
4ef011fc
.list
{
text-align
:
left
;
max-width
:
750px
;
max-width
:
90%
;
margin
:
auto
;
}
...
...
reqtool/ReqmanAngular11/src/app/components/boilerplate-list/boilerplate-list.component.ts
View file @
4ef011fc
...
...
@@ -248,6 +248,7 @@ export class BoilerplateListComponent implements OnInit {
isAllSelected
()
{
const
numSelected
=
this
.
selection
.
selected
.
length
;
const
numRows
=
this
.
newdataSource
.
data
.
length
;
//console.log(this.selection.selected[0].id);
return
numSelected
===
numRows
;
}
...
...
@@ -257,5 +258,22 @@ export class BoilerplateListComponent implements OnInit {
this
.
selection
.
clear
()
:
this
.
newdataSource
.
data
.
forEach
(
row
=>
this
.
selection
.
select
(
row
));
}
deleteBoilerplateList
():
void
{
if
(
confirm
(
"Αre you sure you want to delete this list of Boilerplates?"
))
{
let
num
=
0
;
for
(
let
currentboilerplate
of
this
.
selection
.
selected
)
{
num
++
;
this
.
boilerplateService
.
delete
(
this
.
route
.
snapshot
.
params
.
gb
,
currentboilerplate
.
id
)
.
subscribe
(
response
=>
{
if
(
num
==
this
.
selection
.
selected
.
length
)
{
location
.
reload
();
}
},
error
=>
{
this
.
notifier
.
notify
(
"warning"
,
(
JSON
.
stringify
(
error
)));
});
}
}
// location.reload();
}
}
reqtool/ReqmanAngular11/src/app/components/course-dialog-component/course-dialog-component.component.html
View file @
4ef011fc
<h1
mat-dialog-title
>
{{data.name}}
</h1>
<mat-divider></mat-divider>
<div
*
ngIf=
"!data.isInstance && data.currentSection !== 'StateValue'"
class=
"text-center"
mat-dialog-content
>
<div
*
ngIf=
"!data.isInstance && data.currentSection !== 'StateValue' && data.currentSection !== 'State' && data.currentSection !== 'Item'"
class=
"text-center"
mat-dialog-content
>
<div
style=
"margin-top: 8px; "
>
<mat-form-field
appearance=
"fill"
>
<mat-label>
Instance name
</mat-label>
...
...
@@ -46,6 +48,18 @@
<p>
The current instance will add the above requirement in the ontology :
</p>
<h1><u>
{{data.currentInstance}} shall contain {{data.instance}}
</u></h1>
</div>
<div
class=
"col"
*
ngIf=
"data.currentSection == 'Item'"
>
<p>
The current instance will add the above requirement in the ontology :
</p>
<mat-form-field
style=
"width: 100%;"
appearance=
"fill"
>
<mat-label>
Select System
</mat-label>
<mat-select
required
[(
ngModel
)]="
data
.
selectedValue
"
name=
"system"
>
<mat-option
*
ngFor=
"let system of system"
[
value
]="
system
"
>
{{system}}
</mat-option>
</mat-select>
</mat-form-field>
<h1><u>
{{data.currentInstance}} shall be composed from {{data.instance}}
</u></h1>
</div>
</mat-grid-tile>
</mat-grid-list>
</div>
...
...
@@ -77,7 +91,58 @@
<h1><u>
{{data.instance}} belongs to
</u></h1>
<mat-form-field
style=
"width: 100%;"
appearance=
"fill"
>
<mat-label>
Select StateSet
</mat-label>
<mat-select
[(
ngModel
)]="
data
.
selectedValue
"
name=
"stateset"
>
<mat-select
required
[(
ngModel
)]="
data
.
selectedValue
"
name=
"stateset"
>
<mat-option
*
ngFor=
"let stateset of stateSet"
[
value
]="
stateset
"
>
{{stateset}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</mat-grid-tile>
</mat-grid-list>
<div
mat-dialog-actions
>
<button
mat-button
color=
"warn"
(
click
)="
onNoClick
()"
>
Cancel
</button>
<button
[
disabled
]="!
data
.
selectedValue
"
mat-button
color=
"primary"
[
mat-dialog-close
]="
data
"
cdkFocusInitial
>
Add
</button>
</div>
</div>
<div
*
ngIf=
"data.currentSection === 'State'"
>
<mat-grid-list
cols=
"2"
rowHeight=
"2:1"
>
<mat-grid-tile>
<div
mat-dialog-content
>
<div
style=
"margin-top: 8px; "
>
<mat-form-field
appearance=
"fill"
>
<mat-label>
Instance name
</mat-label>
<input
matInput
required
[(
ngModel
)]="
data
.
instance
"
>
</mat-form-field>
</div>
<div
style=
"margin-top: 8px;"
>
<mat-form-field
appearance=
"fill"
>
<mat-label>
Instance comment
</mat-label>
<textarea
matInput
required
[(
ngModel
)]="
data
.
comment
"
></textarea>
</mat-form-field>
</div>
</div>
<div
style=
"margin-left: 100px;"
>
<mat-divider
vertical
style=
"height:250px"
></mat-divider>
</div>
</mat-grid-tile>
<mat-grid-tile>
<div
class=
"col"
>
<p>
The current instance will add the above requirement in the ontology :
</p>
<mat-form-field
style=
"width: 100%;"
appearance=
"fill"
>
<mat-label>
Select System
</mat-label>
<mat-select
required
[(
ngModel
)]="
data
.
selectedValue
"
name=
"system1"
>
<mat-option
*
ngFor=
"let system1 of system"
[
value
]="
system1
"
>
{{system1}}
</mat-option>
</mat-select>
</mat-form-field>
<h1><u>
shall have state {{data.instance}} with values
</u></h1>
<mat-form-field
style=
"width: 100%;"
appearance=
"fill"
>
<mat-label>
Select StateSet
</mat-label>
<mat-select
required
[(
ngModel
)]="
data
.
selectedValue2
"
name=
"stateset"
>
<mat-option
*
ngFor=
"let stateset of stateSet"
[
value
]="
stateset
"
>
{{stateset}}
</mat-option>
...
...
@@ -86,9 +151,75 @@
</div>
</mat-grid-tile>
</mat-grid-list>
<div
mat-dialog-actions
>
<button
mat-button
color=
"warn"
(
click
)="
onNoClick
()"
>
Cancel
</button>
<button
[
disabled
]="!
data
.
selectedValue
||
!
data
.
selectedValue2
"
mat-button
color=
"primary"
[
mat-dialog-close
]="
data
"
cdkFocusInitial
>
Add
</button>
</div>
</div>
<div
*
ngIf=
"data.currentSection === 'Item' && !data.isInstance"
>
<mat-grid-list
cols=
"2"
rowHeight=
"2:1"
>
<mat-grid-tile>
<div
mat-dialog-content
>
<div
style=
"margin-top: 8px; "
>
<mat-form-field
appearance=
"fill"
>
<mat-label>
Instance name
</mat-label>
<input
matInput
required
[(
ngModel
)]="
data
.
instance
"
>
</mat-form-field>
</div>
<div
style=
"margin-top: 8px;"
>
<mat-form-field
appearance=
"fill"
>
<mat-label>
Instance comment
</mat-label>
<textarea
matInput
required
[(
ngModel
)]="
data
.
comment
"
></textarea>
</mat-form-field>
</div>
</div>
<div
style=
"margin-left: 100px;"
>
<mat-divider
vertical
style=
"height:250px"
></mat-divider>
</div>
</mat-grid-tile>
<mat-grid-tile>
<div
class=
"col"
>
<section
class=
"example-section"
>
<mat-checkbox
class=
"example-margin"
[(
ngModel
)]="
checked
"
>
Checked if the item can have State Values
</mat-checkbox>
</section>
<div
*
ngIf=
"checked"
>
<p>
The current instance will add the above requirement in the ontology :
</p>
<mat-form-field
style=
"width: 100%;"
appearance=
"fill"
>
<mat-label>
Select System
</mat-label>
<mat-select
required
[(
ngModel
)]="
data
.
selectedValue
"
name=
"system"
>
<mat-option
*
ngFor=
"let system of system"
[
value
]="
system
"
>
{{system}}
</mat-option>
</mat-select>
</mat-form-field>
<h1><u>
{{data.instance}} shall take values from
</u></h1>
<mat-form-field
style=
"width: 100%;"
appearance=
"fill"
>
<mat-label>
Select StateSet
</mat-label>
<mat-select
required
[(
ngModel
)]="
data
.
selectedValue2
"
name=
"stateset"
>
<mat-option
*
ngFor=
"let stateset of stateSet"
[
value
]="
stateset
"
>
{{stateset}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
</mat-grid-tile>
</mat-grid-list>
<div
mat-dialog-actions
>
<button
mat-button
color=
"warn"
(
click
)="
onNoClick
()"
>
Cancel
</button>
<button
[
disabled
]="
checked
&&
(!
data
.
selectedValue
||
!
data
.
selectedValue2
)"
mat-button
color=
"primary"
[
mat-dialog-close
]="
data
"
cdkFocusInitial
>
Add
</button>
</div>
</div>
<div
mat-dialog-actions
>
<button
mat-button
(
click
)="
onNoClick
()"
>
Cancel
</button>
<button
mat-button
[
mat-dialog-close
]="
data
"
cdkFocusInitial
>
Add
</button>
<div
mat-dialog-actions
*
ngIf=
"data.currentSection != 'StateValue' && data.currentSection !== 'State' && !(data.currentSection === 'Item' && !data.isInstance) "
>
<button
mat-button
color=
"warn"
(
click
)="
onNoClick
()"
>
Cancel
</button>
<button
[
disabled
]="
data
.
currentSection =
=
'
Item
'
&&
data
.
isInstance
&&
!
data
.
selectedValue
"
mat-button
color=
"primary"
[
mat-dialog-close
]="
data
"
cdkFocusInitial
>
Add
</button>
</div>
\ No newline at end of file
reqtool/ReqmanAngular11/src/app/components/course-dialog-component/course-dialog-component.component.ts
View file @
4ef011fc
import
{
Component
,
Inject
,
OnInit
}
from
'@angular/core'
;
import
{
MAT_DIALOG_DATA
,
MatDialogRef
}
from
'@angular/material/dialog'
;
import
{
statesetfordialog
}
from
'../main-details/main-details.component'
;
import
{
statesetfordialog
,
systemfordialog
}
from
'../main-details/main-details.component'
;
export
interface
DialogData
{
comment
:
string
;
...
...
@@ -10,6 +10,7 @@ export interface DialogData {
currentInstance
?:
any
,
currentSection
?:
any
,
selectedValue
?:
any
,
selectedValue2
?:
any
,
}
@
Component
({
...
...
@@ -19,6 +20,8 @@ export interface DialogData {
})
export
class
CourseDialogComponentComponent
implements
OnInit
{
stateSet
=
statesetfordialog
;
system
=
systemfordialog
;
checked
=
false
;
//selectedValue?: string;
...
...
reqtool/ReqmanAngular11/src/app/components/main-details/main-details.component.html
View file @
4ef011fc
This diff is collapsed.
Click to expand it.
reqtool/ReqmanAngular11/src/app/components/main-details/main-details.component.ts
View file @
4ef011fc
...
...
@@ -9,6 +9,7 @@ import { map, startWith } from 'rxjs/operators';
import
{
NotifierService
}
from
"angular-notifier"
;
export
const
statesetfordialog
:
string
[]
=
[];
export
const
systemfordialog
:
string
[]
=
[];
@
Component
({
selector
:
'app-main-details'
,
...
...
@@ -93,6 +94,7 @@ export class MainDetailsComponent implements OnInit {
message
=
''
;
main
=
''
;
color_badge
=
'danger'
spinner
=
true
constructor
(
private
mainService
:
MainService
,
...
...
@@ -246,6 +248,8 @@ export class MainDetailsComponent implements OnInit {
this
.
numunitControl
.
setValue
(
this
.
currentmain
.
mumerical_units
);
this
.
fifuintsysstatsetControl
.
setValue
(
this
.
currentmain
.
flow_function_interface_item_system_state_stateset
);
this
.
stsysconsetControl
.
setValue
(
this
.
currentmain
.
statevalue_system_connection_stateset
);
this
.
spinner
=
false
;
},
error
=>
{
console
.
log
(
error
);
...
...
@@ -304,7 +308,7 @@ export class MainDetailsComponent implements OnInit {
this
.
getfifuintsysstatset
(
JSON
.
parse
(
data
[
0
].
system_choices
));
this
.
getfifuintsysstatset
(
JSON
.
parse
(
data
[
0
].
state_choices
));
this
.
getfifuintsysstatset
(
JSON
.
parse
(
data
[
0
].
state_set_choices
));
this
.
getfordialog
(
JSON
.
parse
(
data
[
0
].
state_set_choices
));
this
.
getfordialog
(
JSON
.
parse
(
data
[
0
].
state_set_choices
)
,
JSON
.
parse
(
data
[
0
].
system_choices
)
);
//stsysconset
this
.
getstsysconset
(
JSON
.
parse
(
data
[
0
].
state_set_choices
));
this
.
getstsysconset
(
JSON
.
parse
(
data
[
0
].
system_choices
));
...
...
@@ -384,10 +388,13 @@ export class MainDetailsComponent implements OnInit {
}
}
getfordialog
(
strIntoObj
:
any
):
void
{
getfordialog
(
strIntoObj
:
any
,
strIntoObj2
:
any
):
void
{
statesetfordialog
.
length
=
0
systemfordialog
.
length
=
0
for
(
let
x
=
0
;
x
<
strIntoObj
.
length
;
x
++
)
{
statesetfordialog
.
push
((
strIntoObj
[
x
][
1
]));
}
for
(
let
x
=
0
;
x
<
strIntoObj2
.
length
;
x
++
)
{
systemfordialog
.
push
((
strIntoObj2
[
x
][
1
]));
}
}
...
...
reqtool/reqman/api/reqman/apps/reqtool/rest_api/views/main_req_views.py
View file @
4ef011fc
...
...
@@ -207,10 +207,43 @@ class AddSecondaryRequirementAPIView(APIView):
print
(
per_instances
+
(
instance1
),
sao
+
"belongsTo"
,
per_instances
+
stateset
[
len
(
stateset
)
-
1
]
.
strip
())
g
.
add
((
per_instances
+
(
instance1
),
sao
+
"belongsTo"
,
per_instances
+
stateset
[
len
(
stateset
)
-
1
]
.
strip
()))
g
.
serialize
(
data
.
values
(
'ontology_file'
)[
0
][
'ontology_file'
],
format
=
"turtle"
)
if
(
section
==
'State'
):
system
=
instance2
.
rsplit
(
':'
)
stateset
=
instance3
.
rsplit
(
':'
)
g
.
add
((
per_instances
+
section
+
instance1
+
stateset
[
len
(
stateset
)
-
1
]
.
strip
()
+
system
[
len
(
system
)
-
1
]
.
strip
(),
RDF
.
type
,
rdo
+
'Requirement'
))
g
.
add
((
per_instances
+
section
+
instance1
+
stateset
[
len
(
stateset
)
-
1
]
.
strip
()
+
system
[
len
(
system
)
-
1
]
.
strip
(),
rdo
+
'hasMain'
,
per_instances
+
(
section
+
instance1
+
stateset
[
len
(
stateset
)
-
1
]
.
strip
()
+
system
[
len
(
system
)
-
1
]
.
strip
()
+
"_M12"
)))
g
.
add
((
per_instances
+
(
section
+
instance1
+
stateset
[
len
(
stateset
)
-
1
]
.
strip
()
+
system
[
len
(
system
)
-
1
]
.
strip
()
+
"_M12"
),
RDF
.
type
,
rbo
+
"M12"
))
g
.
add
((
per_instances
+
(
section
+
instance1
+
stateset
[
len
(
stateset
)
-
1
]
.
strip
()
+
system
[
len
(
system
)
-
1
]
.
strip
()
+
"_M12"
),
rbo
+
"isRelatedToState"
,
per_instances
+
instance1
))
g
.
add
((
per_instances
+
(
section
+
instance1
+
stateset
[
len
(
stateset
)
-
1
]
.
strip
()
+
system
[
len
(
system
)
-
1
]
.
strip
()
+
"_M12"
),
rbo
+
"isRelatedToStateSet"
,
per_instances
+
stateset
[
len
(
stateset
)
-
1
]
.
strip
()))
g
.
add
((
per_instances
+
(
section
+
instance1
+
stateset
[
len
(
stateset
)
-
1
]
.
strip
()
+
system
[
len
(
system
)
-
1
]
.
strip
()
+
"_M12"
),
rbo
+
"isRelatedToSubject"
,
per_instances
+
system
[
len
(
system
)
-
1
]
.
strip
()))
g
.
add
((
per_instances
+
(
section
+
instance1
+
stateset
[
len
(
stateset
)
-
1
]
.
strip
()
+
system
[
len
(
system
)
-
1
]
.
strip
()
+
"_M12"
),
rbo
+
"isRelatedToAction"
,
lo
+
"HaveState"
))
g
.
serialize
(
data
.
values
(
'ontology_file'
)[
0
][
'ontology_file'
],
format
=
"turtle"
)
if
(
section
==
'Item'
):
if
(
"StateSet"
in
instance3
):
item
=
instance1
system
=
instance2
.
rsplit
(
':'
)[
len
(
instance2
.
rsplit
(
':'
))
-
1
]
.
strip
()
stateset
=
instance3
.
rsplit
(
':'
)[
len
(
instance3
.
rsplit
(
':'
))
-
1
]
.
strip
()
g
.
add
((
per_instances
+
section
+
system
+
item
+
stateset
,
RDF
.
type
,
rdo
+
'Requirement'
))
g
.
add
((
per_instances
+
section
+
system
+
item
+
stateset
,
rdo
+
'hasMain'
,
per_instances
+
section
+
system
+
item
+
stateset
+
"_M14"
))
g
.
add
((
per_instances
+
section
+
system
+
item
+
stateset
+
"_M14"
,
RDF
.
type
,
rbo
+
"M14"
))
g
.
add
((
per_instances
+
section
+
system
+
item
+
stateset
+
"_M14"
,
rbo
+
"isRelatedToSubject"
,
per_instances
+
system
))
g
.
add
((
per_instances
+
section
+
system
+
item
+
stateset
+
"_M14"
,
rbo
+
"isRelatedToStateSet"
,
per_instances
+
stateset
))
g
.
add
((
per_instances
+
section
+
system
+
item
+
stateset
+
"_M14"
,
rbo
+
"isRelatedToSubjectItem"
,
per_instances
+
item
))
g
.
add
((
per_instances
+
section
+
system
+
item
+
stateset
+
"_M14"
,
rbo
+
"isRelatedToAction"
,
lo
+
"TakeValuesFrom"
))
g
.
serialize
(
data
.
values
(
'ontology_file'
)[
0
][
'ontology_file'
],
format
=
"turtle"
)
else
:
item
=
instance1
item2
=
instance2
system
=
instance3
.
rsplit
(
':'
)
g
.
add
((
per_instances
+
section
+
system
[
len
(
system
)
-
1
]
.
strip
()
+
item
+
item2
,
RDF
.
type
,
rdo
+
'Requirement'
))
g
.
add
((
per_instances
+
section
+
system
[
len
(
system
)
-
1
]
.
strip
()
+
item
+
item2
,
rdo
+
'hasMain'
,
(
per_instances
+
section
+
system
[
len
(
system
)
-
1
]
.
strip
()
+
item
+
item2
+
"_M15"
)))
g
.
add
((
per_instances
+
section
+
system
[
len
(
system
)
-
1
]
.
strip
()
+
item
+
item2
+
"_M15"
,
RDF
.
type
,
rbo
+
"M15"
))
g
.
add
((
per_instances
+
section
+
system
[
len
(
system
)
-
1
]
.
strip
()
+
item
+
item2
+
"_M15"
,
rbo
+
"isRelatedToSubject"
,
per_instances
+
system
[
len
(
system
)
-
1
]
.
strip
()))
g
.
add
((
per_instances
+
section
+
system
[
len
(
system
)
-
1
]
.
strip
()
+
item
+
item2
+
"_M15"
,
rbo
+
"isRelatedToAction"
,
lo
+
"BeComposedFrom"
))
g
.
add
((
per_instances
+
section
+
system
[
len
(
system
)
-
1
]
.
strip
()
+
item
+
item2
+
"_M15"
,
rbo
+
"isRelatedToSubjectItem"
,
per_instances
+
item
))
g
.
add
((
per_instances
+
section
+
system
[
len
(
system
)
-
1
]
.
strip
()
+
item
+
item2
+
"_M15"
,
rbo
+
"isRelatedToTraversingConcept"
,
per_instances
+
item2
))
g
.
serialize
(
data
.
values
(
'ontology_file'
)[
0
][
'ontology_file'
],
format
=
"turtle"
)
#print(section)
return
HttpResponse
(
'Update Instance'
)
...
...
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