Commit e52b17aa authored by Thodoris Nestoridis's avatar Thodoris Nestoridis

Bug fixes

parent 30b459f4
......@@ -23,7 +23,8 @@ const routes: Routes = [
{ path: 'groupboilerplates/:gb/boilerplates/details/:id', component: BoilerplateDetailsComponent, canActivate: [AuthGuard] },
{ path: 'groupboilerplates/:gb/boilerplates/add-boilerplate', component: AddBoilerplateComponent, canActivate: [AuthGuard] },
{ path: 'groupboilerplates/add-groupboil', component: AddGroupboilComponent, canActivate: [AuthGuard] },
{ path: 'dictionary', component: InstancesListComponent, canActivate: [AuthGuard] }
{ path: '**', redirectTo: 'groupboilerplates'}
//{ path: 'dictionary', component: InstancesListComponent, canActivate: [AuthGuard] }
];
......
......@@ -41,7 +41,7 @@ export class AddGroupboilComponent implements OnInit {
console.log(error);
//error, warning, success, info, default
this.submitted = false;
this.notifier.notify("warning", (JSON.stringify(error["error"]["title"][0])));
this.notifier.notify("warning", (JSON.stringify(error["error"]["title_bgroup"][0])));
});
}
newBoilerplate(): void {
......
......@@ -77,6 +77,36 @@
</div>
<mat-tab-group mat-align-tabs="center">
<div *ngFor="let section of systems| filter:searchText">
<div *ngIf= "section.Name == 'System' ">
<mat-tab label=Syntax>
<div *ngFor="let items of syntax| filter:searchText">
<mat-accordion>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>
{{ items.pos }}
</mat-panel-title>
</mat-expansion-panel-header>
<div *ngFor="let item of items.data| filter:searchText">
<mat-accordion>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>
{{ item.name }}
</mat-panel-title>
<mat-panel-description >
<h5>{{ item.details }}</h5>
</mat-panel-description>
</mat-expansion-panel-header>
<p>Details : {{item.explanation}}</p>
</mat-expansion-panel>
</mat-accordion>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</mat-tab>
</div>
<mat-tab label={{section.Name}}>
<div *ngFor="let item of section.TheClasses| filter:searchText">
<div *ngIf="item.Class">
......@@ -110,7 +140,9 @@
</div>
</ul>
<ul>
<h4><b>Subclasses</b></h4>
<div *ngIf=checklen(item.Subclass)>
<h4><b>Subclasses</b></h4>
</div>
<div *ngFor="let sub of item.Subclass| filter:searchText">
<li>
<mat-expansion-panel hideToggle>
......
......@@ -214,4 +214,39 @@ export class BoilerplateDetailsComponent implements OnInit {
});
}
prefixs = [
{name: 'P1', details: "If/Unless <logical expression>", explanation: 'Expresses a logical condition. Paraphrases: in case, provided that, on condition that.'},
{name: 'P2', details: "As soon as <occuring functionality>", explanation: 'Expresses a temporal stimulation concerned with the point in time of an completed occuring functionality. Paraphrases: in the moment, immediately, once.'},
{name: 'P3', details: "As long as <occuring functionality>", explanation: 'Expresses a temporal condition concerned with a period. The prefix clause and the main clause take place simultaneously. Paraphrases: meanwhile'},
];
mains = [
{name: 'M1', details: "system/function shall [not] set [<quantifier>] item [to stateValue]", explanation: 'Sets item Paraphrases: initiate, reset, update.'},
{name: 'M2', details: "system/function shall [not] set state to stateValue", explanation: 'Sets state to value Paraphrases: initiate, reset, update.'},
{name: 'M3', details: "system/function shall [not] send [<quantifier>] item", explanation: 'Sends item Paraphrases: forward.'},
{name: 'M4', details: "system/function shall [not] receive [<quantifier>] item", explanation: 'Receives item Paraphrases: accept, acquire.'},
{name: 'M5', details: "system/function shall [not] ingest flow", explanation: 'Ingests flow. Paraphrases: get.'},
{name: 'M6', details: "system/function shall [not] emit flow", explanation: 'Emits flow. Paraphrases: produce.'},
{name: 'M7', details: "system shall [not] perform function", explanation: 'System requirement. Paraphrases: execute.'},
{name: 'M8', details: "function shall [not] invoke function", explanation: 'Function invokes another function. Paraphrases: call, request'},
{name: 'M9', details: "system shall [not] present interface [to system]", explanation: 'Presents interface. Paraphrases: provide'},
{name: 'M10', details: "system/interface shall [not] transfer flow/item", explanation: 'Transfers TraversingConcept. Paraphrases: transmit, broadcast'},
{name: 'M11', details: "system shall [not] interact with system [using <connection>] [as defined in <text>]", explanation: 'System requirement expressing interface interraction'},
{name: 'M12', details: "system shall [not] have state state [with values stateSet]", explanation: 'System requirement expressing system modes'},
{name: 'M13', details: "system state stateValue shall [not] have substate state [with values stateSet]", explanation: 'System requirement expressing system sub modes per mode'},
{name: 'M14', details: "system item shall [not] take values from stateSet", explanation: 'System requirement expressing item stateSet'},
{name: 'M15', details: "system item shall [not] be composed from item", explanation: 'System requirement expressing item decomposition stateSet'},
{name: 'M16', details: "system shall [not] contain system", explanation: 'System decomposition.'},
];
suffixs = [
{name: 'S1', details: "<numerical-afirmative> j <closed-interval> [per <time-unit>]", explanation: ''},
{name: 'S2', details: "after/before flow", explanation: ''},
{name: 'S3', details: "[every/for a period of/within/for at least] <number> <time-unit> [from flow]", explanation: ''},
{name: 'S4', details: "at the beginning/at the end", explanation: ''},
{name: 'S5', details: "at even intervals", explanation: ''},
{name: 'S6', details: "sequentially", explanation: ''},
];
syntax = [{pos:"Prefix", data: this.prefixs}, {pos:"Main", data: this.mains}, {pos:"Suffix", data: this.suffixs}]
}
......@@ -46,9 +46,9 @@
<!-- 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}} <span
<td mat-cell *matCellDef="let element" matTooltip={{get_metrics(element.title_data)}} > {{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">&nbsp;&nbsp; </span>
matBadgeColor="warn" matBadgeSize="small" position="above"> &nbsp;&nbsp; </span>
</td>
</ng-container>
......@@ -73,7 +73,7 @@
<tr mat-header-row *matHeaderRowDef="newdisplayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: newdisplayedColumns;"></tr>
</table>
<mat-paginator #paginator [pageSizeOptions]="[10, 20]" showFirstLastButtons></mat-paginator>
<mat-paginator #paginator [pageSizeOptions]="[20, 50]" showFirstLastButtons></mat-paginator>
</div>
<div echarts [options]="chartOption" class="demo-chart"></div>
......
......@@ -266,7 +266,7 @@ export class MainDetailsComponent implements OnInit {
this.message = response.message;
},
error => {
this.notifier.notify("warning", ("MAIN " + JSON.stringify(error["error"])));
this.notifier.notify("warning", ("MAIN " + JSON.stringify(error["error"]["detail"])));
});
}
......
......@@ -147,7 +147,7 @@ export class PrefixDetailsComponent implements OnInit {
this.message = response.message;
},
error => {
this.notifier.notify("warning", ("PREFIX " + JSON.stringify(error["error"])));
this.notifier.notify("warning", ("PREFIX " + JSON.stringify(error["error"]['detail'])));
});
}
}
......
......@@ -16,7 +16,7 @@ import { environment } from '../../environments/environment';
export class AuthService {
private apiRoot = 'http://155.207.131.19:8000/auth/';
private apiRoot = environment.apiroot +'auth/';
constructor(private http: HttpClient, private router:Router) { }
......
......@@ -5,10 +5,10 @@ import { Observable } from 'rxjs';
import { Boilerplate } from '../models/boilerplate.model';
import { GroupBoilerplate } from '../models/boilerplate.model';
import { InferenceResults } from '../models/boilerplate.model';
import { environment } from '../../environments/environment';
const baseUrl = '/boilerplates/';
const inferUrl = '/infer/';
const baseUrlgb = 'http://155.207.131.19:8000/api-auth/groupboilerplates/';
const baseUrlgb = environment.apiroot+'api-auth/groupboilerplates/';
@Injectable({
providedIn: 'root'
......
......@@ -2,9 +2,10 @@ import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { Main } from '../models/main.model';
import { environment } from '../../environments/environment';
const baseUrl = 'http://155.207.131.19:8000/api-auth/groupboilerplates/0/boilerplates/';
const baseUrl2 = 'http://155.207.131.19:8000/api-auth/groupboilerplates/';
const baseUrl = environment.apiroot + 'api-auth/groupboilerplates/0/boilerplates/';
const baseUrl2 = environment.apiroot + 'api-auth/groupboilerplates/';
const Url = '/main/';
@Injectable({
......@@ -38,123 +39,123 @@ export class MainService {
}
getsubject(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/main/choices/subject/`);
return this.http.get(environment.apiroot +`api-auth/main/choices/subject/`);
}
getstateitem(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/main/choices/stateitem/`);
return this.http.get(environment.apiroot +`api-auth/main/choices/stateitem/`);
}
getstatevalue(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/main/choices/statevalue/`);
return this.http.get(environment.apiroot +`api-auth/main/choices/statevalue/`);
}
getshall(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/main/choices/shall/`);
return this.http.get(environment.apiroot +`api-auth/main/choices/shall/`);
}
getverb(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/main/choices/verb/`);
return this.http.get(environment.apiroot +`api-auth/main/choices/verb/`);
}
getquantifier(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/main/choices/quantifier/`);
return this.http.get(environment.apiroot +`api-auth/main/choices/quantifier/`);
}
getnumunit(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/main/choices/numunit/`);
return this.http.get(environment.apiroot +`api-auth/main/choices/numunit/`);
}
getfifuintsysstatset(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/main/choices/fifuintsysstatset/`);
return this.http.get(environment.apiroot +`api-auth/main/choices/fifuintsysstatset/`);
}
getstsysconset(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/main/choices/stsysconset/`);
return this.http.get(environment.apiroot +`api-auth/main/choices/stsysconset/`);
}
getclasssystem(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/class/system`);
return this.http.get(environment.apiroot +`api-auth/class/system`);
}
getsubclassystem(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/class/system/subclasses`);
return this.http.get(environment.apiroot +`api-auth/class/system/subclasses`);
}
getinstancesystem(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/class/system/instance`);
return this.http.get(environment.apiroot +`api-auth/class/system/instance`);
}
getclassfunction(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/class/function`);
return this.http.get(environment.apiroot +`api-auth/class/function`);
}
getsubclasfunction(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/class/function/subclasses`);
return this.http.get(environment.apiroot +`api-auth/class/function/subclasses`);
}
getinstancefunction(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/class/function/instance`);
return this.http.get(environment.apiroot +`api-auth/class/function/instance`);
}
getclassitem(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/class/item`);
return this.http.get(environment.apiroot +`api-auth/class/item`);
}
getsubclasitem(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/class/item/subclasses`);
return this.http.get(environment.apiroot +`api-auth/class/item/subclasses`);
}
getinstanceitem(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/class/item/instance`);
return this.http.get(environment.apiroot +`api-auth/class/item/instance`);
}
getclassinterface(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/class/interface`);
return this.http.get(environment.apiroot +`api-auth/class/interface`);
}
getsubclasinterface(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/class/interface/subclasses`);
return this.http.get(environment.apiroot +`api-auth/class/interface/subclasses`);
}
getinstanceinterface(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/class/interface/instance`);
return this.http.get(environment.apiroot +`api-auth/class/interface/instance`);
}
getclassconnection(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/class/connection`);
return this.http.get(environment.apiroot +`api-auth/class/connection`);
}
getsubclasconnection(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/class/connection/subclasses`);
return this.http.get(environment.apiroot +`api-auth/class/connection/subclasses`);
}
getinstanceconnection(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/class/connection/instance`);
return this.http.get(environment.apiroot +`api-auth/class/connection/instance`);
}
getclassflow(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/class/flow`);
return this.http.get(environment.apiroot +`api-auth/class/flow`);
}
getsubclasflow(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/class/flow/subclasses`);
return this.http.get(environment.apiroot +`api-auth/class/flow/subclasses`);
}
getinstanceflow(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/class/flow/instance`);
return this.http.get(environment.apiroot +`api-auth/class/flow/instance`);
}
getclassstate(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/class/state`);
return this.http.get(environment.apiroot +`api-auth/class/state`);
}
getsubclasstate(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/class/state/subclasses`);
return this.http.get(environment.apiroot +`api-auth/class/state/subclasses`);
}
getinstancestate(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/class/state/instance`);
return this.http.get(environment.apiroot +`api-auth/class/state/instance`);
}
getdictionary(gb : any): Observable<any> {
......@@ -162,7 +163,7 @@ export class MainService {
}
getmainsyntax(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/mainsyntax`);
return this.http.get(environment.apiroot +`api-auth/mainsyntax`);
}
setinstances(gb : any, instance: any, comment:any): Observable<any> {
......
......@@ -2,9 +2,10 @@ import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { Prefix } from '../models/prefix.model';
import { environment } from '../../environments/environment';
const baseUrl = 'http://155.207.131.19:8000/api-auth/groupboilerplates/0/boilerplates/';
const baseUrl2 = 'http://155.207.131.19:8000/api-auth/groupboilerplates/';
const baseUrl = environment.apiroot + 'api-auth/groupboilerplates/0/boilerplates/';
const baseUrl2 = environment.apiroot + 'api-auth/groupboilerplates/';
const Url = '/prefix/';
@Injectable({
......
......@@ -2,8 +2,9 @@ import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { Suffix } from '../models/suffix.model';
import { environment } from '../../environments/environment';
const baseUrl = 'http://155.207.131.19:8000/api-auth/groupboilerplates/0/boilerplates/';
const baseUrl = environment.apiroot + 'api-auth/groupboilerplates/0/boilerplates/';
const Url = '/suffix/';
@Injectable({
......@@ -34,15 +35,15 @@ export class SuffixService {
}
getsuffix(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/suffix/choices/suffix/`);
return this.http.get(environment.apiroot +`api-auth/suffix/choices/suffix/`);
}
getnumunits(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/suffix/choices/numunits/`);
return this.http.get(environment.apiroot +`api-auth/suffix/choices/numunits/`);
}
getflow(): Observable<any> {
return this.http.get(`http://155.207.131.19:8000/api-auth/suffix/choices/flow/`);
return this.http.get(environment.apiroot +`api-auth/suffix/choices/flow/`);
}
}
......@@ -3,6 +3,7 @@
// The list of file replacements can be found in `angular.json`.
export const environment = {
apiroot : "http://155.207.131.19:8000/",
production: false
};
......
......@@ -96,18 +96,6 @@ class MainDetailsAPIView(RetrieveUpdateDestroyAPIView):
numunit_data = data.values('number_unit_choices')[0]['number_unit_choices']
if( instance['mumerical_units'] not in numunit_data):
raise APIException("MAIN : Instance of Number Unit does not exist")
#remove requirement if exists in the ontology
g = Graph()
g.load(data.values('ontology_file')[0]['ontology_file'], format="turtle")
rdo_instance= URIRef("http://delab.csd.auth.gr/ontologies/2018/RDO-instances#" + boildata.values('title_data')[0]['title_data'])
g.remove((rdo_instance, None, None))
g.remove((None, None, rdo_instance))
main = Main.objects.filter(boilerplate_of_main = instance['boilerplate_of_main'])
rdo_instance= URIRef("http://delab.csd.auth.gr/ontologies/2018/RDO-instances#" + boildata.values('title_data')[0]['title_data'] +'_'+ main.values('main_choices')[0]['main_choices'])
g.remove((rdo_instance, None, None))
g.remove((None, None, rdo_instance))
g.serialize(data.values('ontology_file')[0]['ontology_file'], format='turtle')
#
curmain_choices = inference.getclassofmain(instance)
if curmain_choices[0] == 'ERROR':
raise APIException("Main choices not in [M1-M16]")
......@@ -295,3 +283,17 @@ class MainSyntaxViewSet(APIView):
return response
''' #remove requirement if exists in the ontology
g = Graph()
g.load(data.values('ontology_file')[0]['ontology_file'], format="turtle")
rdo_instance= URIRef("http://delab.csd.auth.gr/ontologies/2018/RDO-instances#" + boildata.values('title_data')[0]['title_data'])
g.remove((rdo_instance, None, None))
g.remove((None, None, rdo_instance))
main = Main.objects.filter(boilerplate_of_main = instance['boilerplate_of_main'])
rdo_instance= URIRef("http://delab.csd.auth.gr/ontologies/2018/RDO-instances#" + boildata.values('title_data')[0]['title_data'] +'_'+ main.values('main_choices')[0]['main_choices'])
g.remove((rdo_instance, None, None))
g.remove((None, None, rdo_instance))
g.serialize(data.values('ontology_file')[0]['ontology_file'], format='turtle')
#'''
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment