Commit b5a70ddf authored by Thodoris Nestoridis's avatar Thodoris Nestoridis

Search for Dict - completed

parent a624c3df
......@@ -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",
......
......@@ -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"
......
......@@ -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,
......
......@@ -86,804 +86,87 @@
<!-- Dictionary -->
<div class="second">
<div class="search-hero">
<input class="form-control" type="text" name="search" [(ngModel)]="searchText" autocomplete="off" placeholder="&#61442; Start searching for a hero by id or name or country">
</div>
<mat-tab-group mat-align-tabs="center">
<mat-tab label="System">
<div *ngFor="let item of systems; let i = index">
<div *ngIf="checkeven(i)">
<div *ngFor="let section of systems| filter:searchText">
<mat-tab label={{section.Name}}>
<div *ngFor="let item of section.TheClasses| filter:searchText">
<mat-accordion>
<mat-expansion-panel hideToggle>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>
{{ item }}
{{ item.Class }}
</mat-panel-title>
<mat-panel-description>
<!-- only mini description-->
</mat-panel-description>
</mat-expansion-panel-header>
{{ systems [i+1] }}
{{ item.Comment }}
<ul> <h4><b>Instances</b></h4>
<div *ngFor="let instan of instacesystems; let y = index">
<div *ngIf="item == instan">
<div *ngFor="let instan of item.Instance_of_Class| filter:searchText">
<li>
<mat-expansion-panel hideToggle>
<p>Description.</p>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instacesystems[y+1] }}
{{instan.Instance}}
</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">
<div *ngFor="let sub of item.Subclass| filter:searchText">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ subclassystems[y+1] }}
{{sub.SubClass_name}}
</mat-panel-title>
</mat-expansion-panel-header>
<p>{{subclassystems[y+2]}}</p>
<p>{{sub.SubclassComment}}</p>
<ul> <h5>Instances</h5>
<div *ngFor="let instan of instacesystems; let y = index">
<div *ngIf="sub == instan">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instacesystems[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>
<!-- Function -->
<mat-tab label="Function">
<div *ngIf= "checklen(functions); else down">
<div *ngFor="let item of functions; 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>
{{ functions [i+1] }}
<ul> <div *ngIf= checklen(instacefunctions)><h4><b>Instances</b></h4></div>
<div *ngFor="let instan of instacefunctions; let y = index">
<div *ngIf="item == instan">
<li>
<mat-expansion-panel hideToggle>
<p>Description.</p>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instacefunctions[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
<ul> <div *ngIf= checklen(subclasfunctions)><h4><b>Subclasses</b></h4></div>
<div *ngFor="let sub of subclasfunctions; let y = index">
<div *ngIf="item == sub">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ subclasfunctions[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
<p>{{subclasfunctions[y+2]}}</p>
<ul> <div *ngIf= checklen(instacefunctions)><h5><b>Instances</b></h5></div>
<div *ngFor="let instan of instacefunctions; let y = index">
<div *ngIf="sub == instan">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instacefunctions[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>
</div>
<ng-template #down>
<div *ngIf= checklen(instacefunctions)>
<ul> <div *ngIf= checklen(instacefunctions)><h4><b>Instances</b></h4></div>
<div *ngFor="let instan of instacefunctions; let y = index">
<div *ngIf="checkeven(y)">
<li>
<mat-expansion-panel hideToggle>
<p>Description.</p>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instacefunctions[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
</div>
<div *ngIf= checklen(subclasfunctions)>
<ul> <div *ngIf= checklen(subclasfunctions)><h4><b>Subclasses</b></h4></div>
<div *ngFor="let sub of subclasfunctions; let y = index">
<div *ngIf="checkthree(y)">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ subclasfunctions[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
<p>{{subclasfunctions[y+2]}}</p>
<ul> <div *ngIf= checklen(instacefunctions)><h5><b>Instances</b></h5></div>
<div *ngFor="let instan of instacefunctions; let y = index">
<div *ngIf="sub == instan">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instacefunctions[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
</div>
</ng-template>
</mat-tab>
<!-- Interface -->
<mat-tab label="Interface">
<div *ngIf= "checklen(interfaces); else down1">
<div *ngFor="let item of interfaces; 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>
{{ interfaces [i+1] }}
<ul> <div *ngIf= checklen(instaceinterfaces)><h4><b>Instances</b></h4></div>
<div *ngFor="let instan of instaceinterfaces; let y = index">
<div *ngIf="item == instan">
<li>
<mat-expansion-panel hideToggle>
<p>Description.</p>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instaceinterfaces[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
<ul> <div *ngIf= checklen(subclasinterfaces)><h4><b>Subclasses</b></h4></div>
<div *ngFor="let sub of subclasinterfaces; let y = index">
<div *ngIf="item == sub">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ subclasinterfaces[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
<p>{{subclasinterfaces[y+2]}}</p>
<ul> <div *ngIf= checklen(instaceinterfaces)><h5><b>Instances</b></h5></div>
<div *ngFor="let instan of instaceinterfaces; let y = index">
<div *ngIf="sub == instan">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instaceinterfaces[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>
</div>
<ng-template #down1>
<div *ngIf= checklen(instaceinterfaces)>
<ul> <div *ngIf= checklen(instaceinterfaces)><h4><b>Instances</b></h4></div>
<div *ngFor="let instan of instaceinterfaces; let y = index">
<div *ngIf="checkeven(y)">
<li>
<mat-expansion-panel hideToggle>
<p>Description.</p>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instaceinterfaces[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
</div>
<div *ngIf= checklen(subclasinterfaces)>
<ul> <div *ngIf= checklen(subclasinterfaces)><h4><b>Subclasses</b></h4></div>
<div *ngFor="let sub of subclasinterfaces; let y = index">
<div *ngIf="checkthree(y)">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ subclasinterfaces[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
<p>{{subclasinterfaces[y+2]}}</p>
<ul> <div *ngIf= checklen(instaceinterfaces)><h5><b>Instances</b></h5></div>
<div *ngFor="let instan of instaceinterfaces; let y = index">
<div *ngIf="sub == instan">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instaceinterfaces[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
</div>
</ng-template>
</mat-tab>
<!-- Item -->
<mat-tab label="Item">
<div *ngIf= "checklen(items); else down2">
<div *ngFor="let item of items; 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>
{{ items [i+1] }}
<ul> <div *ngIf= checklen(instaceitems)><h4><b>Instances</b></h4></div>
<div *ngFor="let instan of instaceitems; let y = index">
<div *ngIf="item == instan">
<li>
<mat-expansion-panel hideToggle>
<p>Description.</p>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instaceitems[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
<ul> <div *ngIf= checklen(subclasitems)><h4><b>Subclasses</b></h4></div>
<div *ngFor="let sub of subclasitems; let y = index">
<div *ngIf="item == sub">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ subclasitems[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
<p>{{subclasitems[y+2]}}</p>
<ul> <div *ngIf= checklen(instaceitems)><h5><b>Instances</b></h5></div>
<div *ngFor="let instan of instaceitems; let y = index">
<div *ngIf="sub == instan">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instaceitems[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>
</div>
<ng-template #down2>
<div *ngIf= checklen(instaceitems)>
<ul> <div *ngIf= checklen(instaceitems)><h4><b>Instances</b></h4></div>
<div *ngFor="let instan of instaceitems; let y = index">
<div *ngIf="checkeven(y)">
<li>
<mat-expansion-panel hideToggle>
<p>Description.</p>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instaceitems[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
</div>
<div *ngIf= checklen(subclasitems)>
<ul> <div *ngIf= checklen(subclasitems)><h4><b>Subclasses</b></h4></div>
<div *ngFor="let sub of subclasitems; let y = index">
<div *ngIf="checkthree(y)">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ subclasitems[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
<p>{{subclasitems[y+2]}}</p>
<ul> <div *ngIf= checklen(instaceitems)><h5><b>Instances</b></h5></div>
<div *ngFor="let instan of instaceitems; let y = index">
<div *ngIf="sub == instan">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instaceitems[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
</div>
</ng-template>
</mat-tab>
<!-- Connection -->
<mat-tab label="Connection">
<div *ngIf= "checklen(connections); else down3">
<div *ngFor="let item of connections; 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>
{{ connections [i+1] }}
<ul> <div *ngIf= checklen(instaceconnections)><h4><b>Instances</b></h4></div>
<div *ngFor="let instan of instaceconnections; let y = index">
<div *ngIf="item == instan">
<li>
<mat-expansion-panel hideToggle>
<p>Description.</p>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instaceconnections[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
<ul> <div *ngIf= checklen(subclasconnections)><h4><b>Subclasses</b></h4></div>
<div *ngFor="let sub of subclasconnections; let y = index">
<div *ngIf="item == sub">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ subclasconnections[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
<p>{{subclasconnections[y+2]}}</p>
<ul> <div *ngIf= checklen(instaceconnections)><h5><b>Instances</b></h5></div>
<div *ngFor="let instan of instaceconnections; let y = index">
<div *ngIf="sub == instan">
<div *ngFor="let instansub of sub.InstanceOfSubclass| filter:searchText">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instaceconnections[y+1] }}
{{ instansub.instance}}
</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>
</div>
<ng-template #down3>
<div *ngIf= checklen(instaceconnections)>
<ul> <div *ngIf= checklen(instaceconnections)><h4><b>Instances</b></h4></div>
<div *ngFor="let instan of instaceconnections; let y = index">
<div *ngIf="checkeven(y)">
<li>
<mat-expansion-panel hideToggle>
<p>Description.</p>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instaceconnections[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
</div>
<div *ngIf= checklen(subclasconnections)>
<ul> <div *ngIf= checklen(subclasconnections)><h4><b>Subclasses</b></h4></div>
<div *ngFor="let sub of subclasconnections; let y = index">
<div *ngIf="checkthree(y)">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ subclasconnections[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
<p>{{subclasconnections[y+2]}}</p>
<ul> <div *ngIf= checklen(instaceconnections)><h5><b>Instances</b></h5></div>
<div *ngFor="let instan of instaceconnections; let y = index">
<div *ngIf="sub == instan">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instaceconnections[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
</div>
</ng-template>
</mat-tab>
<!-- Flow -->
<mat-tab label="Flow">
<div *ngIf= "checklen(flows); else down4">
<div *ngFor="let item of flows; 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>
{{ flows [i+1] }}
<ul> <div *ngIf= checklen(instaceflows)><h4><b>Instances</b></h4></div>
<div *ngFor="let instan of instaceflows; let y = index">
<div *ngIf="item == instan">
<li>
<mat-expansion-panel hideToggle>
<p>Description.</p>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instaceflows[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
<ul> <div *ngIf= checklen(subclasflows)><h4><b>Subclasses</b></h4></div>
<div *ngFor="let sub of subclasflows; let y = index">
<div *ngIf="item == sub">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ subclasflows[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
<p>{{subclasflows[y+2]}}</p>
<ul> <div *ngIf= checklen(instaceflows)><h5><b>Instances</b></h5></div>
<div *ngFor="let instan of instaceflows; let y = index">
<div *ngIf="sub == instan">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instaceflows[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>
</div>
<ng-template #down4>
<div *ngIf= checklen(instaceflows)>
<ul> <div *ngIf= checklen(instaceflows)><h4><b>Instances</b></h4></div>
<div *ngFor="let instan of instaceflows; let y = index">
<div *ngIf="checkeven(y)">
<ul> <div *ngIf= checklen(section.GeneralInstances)><h4><b>Instances</b></h4></div>
<div *ngFor="let genin of section.GeneralInstances| filter:searchText">
<li>
<mat-expansion-panel hideToggle>
<p>Description.</p>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instaceflows[y+1] }}
{{genin.GeneralInstances}}
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
</div>
<div *ngIf= checklen(subclasflows)>
<ul> <div *ngIf= checklen(subclasflows)><h4><b>Subclasses</b></h4></div>
<div *ngFor="let sub of subclasflows; let y = index">
<div *ngIf="checkthree(y)">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ subclasflows[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
<p>{{subclasflows[y+2]}}</p>
<ul> <div *ngIf= checklen(instaceflows)><h5><b>Instances</b></h5></div>
<div *ngFor="let instan of instaceflows; let y = index">
<div *ngIf="sub == instan">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instaceflows[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
</div>
</ng-template>
</mat-tab>
<!-- State -->
<mat-tab label="State">
<div *ngIf= "checklen(states); else down5">
<div *ngFor="let item of states; 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>
{{ states [i+1] }}
<ul> <div *ngIf= checklen(instacestates)><h4><b>Instances</b></h4></div>
<div *ngFor="let instan of instacestates; let y = index">
<div *ngIf="item == instan">
<li>
<mat-expansion-panel hideToggle>
<p>Description.</p>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instacestates[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
<ul> <div *ngIf= checklen(subclasstates)><h4><b>Subclasses</b></h4></div>
<div *ngFor="let sub of subclasstates; let y = index">
<div *ngIf="item == sub">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ subclasstates[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
<p>{{subclasstates[y+2]}}</p>
<ul> <div *ngIf= checklen(instacestates)><h5><b>Instances</b></h5></div>
<div *ngFor="let instan of instacestates; let y = index">
<div *ngIf="sub == instan">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instacestates[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>
</div>
<ng-template #down5>
<div *ngIf= checklen(instacestates)>
<ul> <div *ngIf= checklen(instacestates)><h4><b>Instances</b></h4></div>
<div *ngFor="let instan of instacestates; let y = index">
<div *ngIf="checkeven(y)">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instacestates[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
</div>
<div *ngIf= checklen(subclasstates)>
<ul> <div *ngIf= checklen(subclasstates)><h4><b>Subclasses</b></h4></div>
<div *ngFor="let sub of subclasstates; let y = index">
<div *ngIf="checkthree(y)">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ subclasstates[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
<p>{{subclasstates[y+2]}}</p>
<ul> <div *ngIf= checklen(instacestates)><h5><b>Instances</b></h5></div>
<div *ngFor="let instan of instacestates; let y = index">
<div *ngIf="sub == instan">
<li>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>
<mat-panel-title>
{{ instacestates[y+1] }}
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
</mat-expansion-panel>
</li>
</div>
</div>
</ul>
</div>
</ng-template>
</mat-tab>
</mat-tab-group>
</div>
\ No newline at end of file
......@@ -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.getclasssystem()
this.mainService.getdictionary()
.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 {
......
......@@ -25,3 +25,26 @@ export class InferenceResults {
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
......@@ -153,4 +153,7 @@ export class MainService {
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`);
}
}
......@@ -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'''
......
......@@ -87,4 +87,7 @@ urlpatterns = [
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
......@@ -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
......@@ -279,3 +280,9 @@ 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
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