Commit 7c0f0c79 authored by Thodoris Nestoridis's avatar Thodoris Nestoridis

bugs + Quantifier prefix

parent 1c14e01a
reqtool/Ontologies/2022_AOCS.ttl
reqtool/Ontologies/Autonomy_v1.ttl
reqtool/Ontologies/instances_subclass.txt
reqtool/Ontologies/instances.txt
reqtool/Ontologies/AA/AA.ttl
reqtool/Ontologies/AA/AA.ttl.ttl
reqtool/Ontologies/AA/AA.ttlinfer.ttl
reqtool/Ontologies/Class/Class.ttl
reqtool/Ontologies/OO/OO.ttl
reqtool/Ontologies/QQQ/QQQ.ttl
reqtool/Ontologies/QQQ/QQQ.ttl.ttl
reqtool/Ontologies/QQQ/QQQ.ttlinfer.ttl
reqtool/Ontologies/sA/sA.ttl
reqtool/Ontologies/sA/sA.ttl.ttl
reqtool/Ontologies/sA/sA.ttlinfer.ttl
reqtool/Ontologies/sasa/sasa.ttl
reqtool/Ontologies/sasa/sasa.ttl.ttl
reqtool/Ontologies/sasa/sasa.ttlinfer.ttl
reqtool/reqman/Ontologies/2022_AOCS.ttl
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -1782,7 +1782,7 @@ RBO:EmitOccuringFunctionality ...@@ -1782,7 +1782,7 @@ RBO:EmitOccuringFunctionality
owl:unionOf ( owl:unionOf (
RBO:System RBO:System
RBO:Function RBO:Function
RBO:Item RBO:Flow
RBO:Action RBO:Action
) ; ) ;
] ; ] ;
...@@ -1796,7 +1796,7 @@ RBO:EmitOccuringFunctionality ...@@ -1796,7 +1796,7 @@ RBO:EmitOccuringFunctionality
rdfs:subClassOf [ rdfs:subClassOf [
a owl:Restriction ; a owl:Restriction ;
owl:cardinality "1"^^xsd:nonNegativeInteger ; owl:cardinality "1"^^xsd:nonNegativeInteger ;
owl:onProperty RBO:isRelatedToItem ; owl:onProperty RBO:isRelatedToFlow ;
] ; ] ;
rdfs:subClassOf [ rdfs:subClassOf [
a owl:Restriction ; a owl:Restriction ;
...@@ -1860,7 +1860,7 @@ RBO:IngestOccuringFunctionality ...@@ -1860,7 +1860,7 @@ RBO:IngestOccuringFunctionality
owl:unionOf ( owl:unionOf (
RBO:System RBO:System
RBO:Function RBO:Function
RBO:Item RBO:Flow
RBO:Action RBO:Action
) ; ) ;
] ; ] ;
...@@ -1874,7 +1874,7 @@ RBO:IngestOccuringFunctionality ...@@ -1874,7 +1874,7 @@ RBO:IngestOccuringFunctionality
rdfs:subClassOf [ rdfs:subClassOf [
a owl:Restriction ; a owl:Restriction ;
owl:cardinality "1"^^xsd:nonNegativeInteger ; owl:cardinality "1"^^xsd:nonNegativeInteger ;
owl:onProperty RBO:isRelatedToItem ; owl:onProperty RBO:isRelatedToFlow ;
] ; ] ;
rdfs:subClassOf [ rdfs:subClassOf [
a owl:Restriction ; a owl:Restriction ;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
<form class="form-group form-inline" <form class="form-group form-inline"
[ngStyle]="(verbControlisDivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden'}"> [ngStyle]="(verbControlisDivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden'}">
<mat-form-field class="example-full-width"> <mat-form-field class="example-full-width">
<mat-label *ngIf="verbControl.value !=null">Verb : {{this.verbControl.value.split(':')[0]}}</mat-label> <mat-label *ngIf="verbControl.value !=null">Verb : {{this.verbControl.value.split(':')[0]}}:{{this.verbControl.value.split(':')[1]}}</mat-label>
<input type="text" placeholder="Pick one" aria-label="Number" matInput [formControl]="verbControl" required <input type="text" placeholder="Pick one" aria-label="Number" matInput [formControl]="verbControl" required
[matAutocomplete]="autoverb"> [matAutocomplete]="autoverb">
<mat-autocomplete autoActiveFirstOption #autoverb="matAutocomplete" showPanel="true" [displayWith]="displayFn"> <mat-autocomplete autoActiveFirstOption #autoverb="matAutocomplete" showPanel="true" [displayWith]="displayFn">
......
...@@ -3,14 +3,8 @@ ...@@ -3,14 +3,8 @@
<form class="form-group form-inline" ngNativeValidate> <form class="form-group form-inline" ngNativeValidate>
<mat-form-field class="example-full-width"> <mat-form-field class="example-full-width">
<mat-label>Prefix</mat-label> <mat-label>Prefix</mat-label>
<input type="text" <input type="text" placeholder="Pick one" aria-label="Number" matInput required
placeholder="Pick one" [formControl]="simpleprefixControl" [matAutocomplete]="autosimpleprefix">
aria-label="Number"
matInput
required
[formControl]="simpleprefixControl"
[matAutocomplete]="autosimpleprefix"
>
<mat-autocomplete autoActiveFirstOption #autosimpleprefix="matAutocomplete"> <mat-autocomplete autoActiveFirstOption #autosimpleprefix="matAutocomplete">
<mat-option *ngFor="let option of simpleprefixfilteredOptions | async" [value]="option"> <mat-option *ngFor="let option of simpleprefixfilteredOptions | async" [value]="option">
{{option}} {{option}}
...@@ -22,15 +16,10 @@ ...@@ -22,15 +16,10 @@
<div class="col" style="width: 300px;"> <div class="col" style="width: 300px;">
<form class="form-group form-inline"> <form class="form-group form-inline">
<mat-form-field class="example-full-width"> <mat-form-field class="example-full-width">
<mat-label *ngIf="subjectsControl.value !=null">Subject : {{this.subjectsControl.value.split(':')[0]}}:{{this.subjectsControl.value.split(':')[1]}}</mat-label> <mat-label *ngIf="subjectsControl.value !=null">Subject :
<input type="text" {{this.subjectsControl.value.split(':')[0]}}:{{this.subjectsControl.value.split(':')[1]}}</mat-label>
placeholder="Pick one" <input type="text" placeholder="Pick one" aria-label="Number" matInput [formControl]="subjectsControl" required
aria-label="Number" [matAutocomplete]="autosub">
matInput
[formControl]="subjectsControl"
required
[matAutocomplete]="autosub"
>
<mat-autocomplete autoActiveFirstOption #autosub="matAutocomplete" showPanel="true" [displayWith]="displayFn"> <mat-autocomplete autoActiveFirstOption #autosub="matAutocomplete" showPanel="true" [displayWith]="displayFn">
<mat-option *ngFor="let option of subjectsfilteredOptions | async" [value]="option"> <mat-option *ngFor="let option of subjectsfilteredOptions | async" [value]="option">
{{option.split(" : ").pop()}} {{option.split(" : ").pop()}}
...@@ -46,14 +35,8 @@ ...@@ -46,14 +35,8 @@
<mat-form-field class="example-full-width"> <mat-form-field class="example-full-width">
<mat-label>Verb or State</mat-label> <mat-label>Verb or State</mat-label>
<mat-label *ngIf="verbsControl.value !=null">Subject : {{this.verbsControl.value.split(':')[0]}}</mat-label> <mat-label *ngIf="verbsControl.value !=null">Subject : {{this.verbsControl.value.split(':')[0]}}</mat-label>
<input type="text" <input type="text" placeholder="Pick one" aria-label="Number" matInput required [formControl]="verbsControl"
placeholder="Pick one" [matAutocomplete]="autoverb">
aria-label="Number"
matInput
required
[formControl]="verbsControl"
[matAutocomplete]="autoverb"
>
<mat-autocomplete autoActiveFirstOption #autoverb="matAutocomplete" showPanel="true" [displayWith]="displayFn"> <mat-autocomplete autoActiveFirstOption #autoverb="matAutocomplete" showPanel="true" [displayWith]="displayFn">
<mat-option *ngFor="let option of verbsfilteredOptions | async" [value]="option"> <mat-option *ngFor="let option of verbsfilteredOptions | async" [value]="option">
{{option.split(" : ").pop()}} {{option.split(" : ").pop()}}
...@@ -62,21 +45,59 @@ ...@@ -62,21 +45,59 @@
</mat-form-field> </mat-form-field>
</form> </form>
</div> </div>
<div class="col" [ngStyle]="(numericalisDivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden'}">
<form class="form-group form-inline">
<mat-form-field class="example-full-width">
<mat-label>Quantifier</mat-label>
<input placeholder="Pick one" aria-label="Number" matInput [formControl]="prefix_quantifierControl" type="text"
[matAutocomplete]="autoprefix_quantifier">
<mat-autocomplete autoActiveFirstOption #autoprefix_quantifier="matAutocomplete" showPanel="true"
[displayWith]="displayFn">
<mat-option *ngFor="let option of prefix_quantifierfilteredOptions | async" [value]="option">
{{option.split(" : ").pop()}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
</form>
</div>
<div class="col">
<form class="form-group form-inline"
[ngStyle]="(numericalisDivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden'}">
<mat-form-field class="example-full-width">
<mat-label>Numerical Value</mat-label>
<input type="text" matInput [(ngModel)]="currentprefix.prefix_numerical" name="numerical">
</mat-form-field>
</form>
</div>
<div class="col">
<form class="form-group form-inline"
[ngStyle]="(numericalisDivVisible) ? {'visibility': 'visible'} : {'visibility': 'hidden'}">
<mat-form-field class="example-full-width">
<mat-label>Number Unit</mat-label>
<input type="text" placeholder="Pick one" aria-label="Number" matInput
[formControl]="prefix_mumerical_unitsControl" [matAutocomplete]="autoprefix_mumerical_units">
<mat-autocomplete autoActiveFirstOption #autoprefix_mumerical_units="matAutocomplete" showPanel="true"
[displayWith]="displayFn">
<mat-option *ngFor="let option of prefix_mumerical_unitsfilteredOptions | async" [value]="option">
{{option.split(" : ").pop()}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
</form>
</div>
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="col"> <div class="col">
<form class="form-group form-inline"> <form class="form-group form-inline">
<mat-form-field class="example-full-width"> <mat-form-field class="example-full-width">
<mat-label *ngIf="objectsControl.value !=null">Object : {{this.objectsControl.value.split(':')[0]}}:{{this.objectsControl.value.split(':')[1]}}</mat-label> <mat-label *ngIf="objectsControl.value !=null">Object :
<input type="text" {{this.objectsControl.value.split(':')[0]}}:{{this.objectsControl.value.split(':')[1]}}</mat-label>
placeholder="Pick one" <input type="text" placeholder="Pick one" aria-label="Number" matInput required [formControl]="objectsControl"
aria-label="Number" [matAutocomplete]="autobjects">
matInput <mat-autocomplete autoActiveFirstOption #autobjects="matAutocomplete" showPanel="true"
required [displayWith]="displayFn">
[formControl]="objectsControl"
[matAutocomplete]="autobjects"
>
<mat-autocomplete autoActiveFirstOption #autobjects="matAutocomplete" showPanel="true" [displayWith]="displayFn">
<mat-option *ngFor="let option of objectsfilteredOptions | async" [value]="option"> <mat-option *ngFor="let option of objectsfilteredOptions | async" [value]="option">
{{option.split(" : ").pop()}} {{option.split(" : ").pop()}}
</mat-option> </mat-option>
...@@ -85,17 +106,12 @@ ...@@ -85,17 +106,12 @@
</form> </form>
</div> </div>
<div class="col"> <div class="col">
<form matTooltip="Under development" matTooltipPosition="right" class="form-group form-inline" > <form matTooltip="Under development" matTooltipPosition="right" class="form-group form-inline">
<fieldset disabled> <fieldset disabled>
<mat-form-field class="example-full-width"> <mat-form-field class="example-full-width">
<mat-label>Logic connectivity</mat-label> <mat-label>Logic connectivity</mat-label>
<input type="text" <input type="text" placeholder="Pick one" aria-label="Number" matInput [formControl]="logic_conControl"
placeholder="Pick one" [matAutocomplete]="autolog_con">
aria-label="Number"
matInput
[formControl]="logic_conControl"
[matAutocomplete]="autolog_con"
>
<mat-autocomplete autoActiveFirstOption #autolog_con="matAutocomplete"> <mat-autocomplete autoActiveFirstOption #autolog_con="matAutocomplete">
<mat-option *ngFor="let option of logic_confilteredOptions | async" [value]="option"> <mat-option *ngFor="let option of logic_confilteredOptions | async" [value]="option">
{{option}} {{option}}
...@@ -105,7 +121,7 @@ ...@@ -105,7 +121,7 @@
</fieldset> </fieldset>
</form> </form>
</div> </div>
</div> </div>
<!-- <!--
......
...@@ -23,6 +23,14 @@ export class PrefixDetailsComponent implements OnInit { ...@@ -23,6 +23,14 @@ export class PrefixDetailsComponent implements OnInit {
subjects: string[] = []; subjects: string[] = [];
subjectsfilteredOptions: Observable<string[]>; subjectsfilteredOptions: Observable<string[]>;
prefix_quantifierControl = new FormControl();
prefix_quantifier: string[] = [];
prefix_quantifierfilteredOptions: Observable<string[]>;
prefix_mumerical_unitsControl = new FormControl();
prefix_mumerical_units: string[] = [];
prefix_mumerical_unitsfilteredOptions: Observable<string[]>;
verbsControl = new FormControl(); verbsControl = new FormControl();
verbs: string[] = []; verbs: string[] = [];
verbsfilteredOptions: Observable<string[]>; verbsfilteredOptions: Observable<string[]>;
...@@ -46,12 +54,16 @@ export class PrefixDetailsComponent implements OnInit { ...@@ -46,12 +54,16 @@ export class PrefixDetailsComponent implements OnInit {
prefix: "", prefix: "",
system_fun_item: "", system_fun_item: "",
state_or_verb: "", state_or_verb: "",
prefix_quantifier: "",
prefix_numerical: 0,
prefix_mumerical_units: "",
item_function_flow_statevalue: "", item_function_flow_statevalue: "",
logical_expression: "", logical_expression: "",
logic_connective: "", logic_connective: "",
simple_prefix: "", simple_prefix: "",
}; };
message = ''; message = '';
numericalisDivVisible = false
constructor(private prefixService: PrefixService, private route: ActivatedRoute, constructor(private prefixService: PrefixService, private route: ActivatedRoute,
...@@ -69,6 +81,14 @@ export class PrefixDetailsComponent implements OnInit { ...@@ -69,6 +81,14 @@ export class PrefixDetailsComponent implements OnInit {
startWith(""), startWith(""),
map(value => this._filter(this.verbs, value)) map(value => this._filter(this.verbs, value))
); );
this.prefix_quantifierfilteredOptions = this.prefix_quantifierControl.valueChanges.pipe(
startWith(""),
map(value => this._filter(this.prefix_quantifier, value))
);
this.prefix_mumerical_unitsfilteredOptions = this.prefix_mumerical_unitsControl.valueChanges.pipe(
startWith(""),
map(value => this._filter(this.prefix_mumerical_units, value))
);
this.objectsfilteredOptions = this.objectsControl.valueChanges.pipe( this.objectsfilteredOptions = this.objectsControl.valueChanges.pipe(
startWith(""), startWith(""),
map(value => this._filter(this.objects, value)) map(value => this._filter(this.objects, value))
...@@ -93,6 +113,17 @@ export class PrefixDetailsComponent implements OnInit { ...@@ -93,6 +113,17 @@ export class PrefixDetailsComponent implements OnInit {
return ""; return "";
} }
ngDoCheck() {
this.dis();
}
dis(): any {
if (this.verbsControl.value?.split(" : ")[0] == "Set" || this.verbsControl.value?.split(" : ")[0] == "Send" || this.verbsControl.value?.split(" : ")[0] == "Receive") {
this.numericalisDivVisible = true;
}
else (this.numericalisDivVisible = false);
}
private _filter(data: string[], value: string): string[] { private _filter(data: string[], value: string): string[] {
const filterValue = value.toLowerCase(); const filterValue = value.toLowerCase();
return data.filter(option => option.toLowerCase().includes(filterValue)); return data.filter(option => option.toLowerCase().includes(filterValue));
...@@ -125,6 +156,8 @@ export class PrefixDetailsComponent implements OnInit { ...@@ -125,6 +156,8 @@ export class PrefixDetailsComponent implements OnInit {
this.simpleprefixControl.setValue(this.currentprefix.prefix); this.simpleprefixControl.setValue(this.currentprefix.prefix);
this.subjectsControl.setValue(this.currentprefix.system_fun_item); this.subjectsControl.setValue(this.currentprefix.system_fun_item);
this.verbsControl.setValue(this.currentprefix.state_or_verb); this.verbsControl.setValue(this.currentprefix.state_or_verb);
this.prefix_quantifierControl.setValue(this.currentprefix.prefix_quantifier);
this.prefix_mumerical_unitsControl.setValue(this.currentprefix.prefix_mumerical_units);
this.objectsControl.setValue(this.currentprefix.item_function_flow_statevalue); this.objectsControl.setValue(this.currentprefix.item_function_flow_statevalue);
this.logic_conControl.setValue(this.currentprefix.logic_connective); this.logic_conControl.setValue(this.currentprefix.logic_connective);
}, },
...@@ -138,6 +171,9 @@ export class PrefixDetailsComponent implements OnInit { ...@@ -138,6 +171,9 @@ export class PrefixDetailsComponent implements OnInit {
this.currentprefix.prefix = this.simpleprefixControl.value; this.currentprefix.prefix = this.simpleprefixControl.value;
this.currentprefix.system_fun_item = this.subjectsControl.value; this.currentprefix.system_fun_item = this.subjectsControl.value;
this.currentprefix.state_or_verb = this.verbsControl.value; this.currentprefix.state_or_verb = this.verbsControl.value;
if (this.numericalisDivVisible) { this.currentprefix.prefix_quantifier = this.prefix_quantifierControl.value } else { this.currentprefix.prefix_quantifier = '' }
if (this.numericalisDivVisible) { this.currentprefix.prefix_mumerical_units = this.prefix_mumerical_unitsControl.value; } else { this.currentprefix.prefix_mumerical_units = '' }
if (!this.numericalisDivVisible) { this.currentprefix.prefix_numerical = null }
this.currentprefix.item_function_flow_statevalue = this.objectsControl.value; this.currentprefix.item_function_flow_statevalue = this.objectsControl.value;
this.currentprefix.logic_connective = this.logic_conControl.value; this.currentprefix.logic_connective = this.logic_conControl.value;
for (let i = 0; i < PrefixDetailsComponent.id.length; i++) { for (let i = 0; i < PrefixDetailsComponent.id.length; i++) {
...@@ -165,6 +201,10 @@ export class PrefixDetailsComponent implements OnInit { ...@@ -165,6 +201,10 @@ export class PrefixDetailsComponent implements OnInit {
this.setsubject(JSON.parse(data[0].item_choices)); this.setsubject(JSON.parse(data[0].item_choices));
this.setsubject(JSON.parse(data[0].system_choices)); this.setsubject(JSON.parse(data[0].system_choices));
this.setsubject(JSON.parse(data[0].function_choices)); this.setsubject(JSON.parse(data[0].function_choices));
//set quantifier
this.getquantifier(JSON.parse(data[0].quantifier_choices));
// number_unit_choices
this.getnumunit(JSON.parse(data[0].number_unit_choices));
//set object choices //set object choices
this.setobject(JSON.parse(data[0].item_choices)); this.setobject(JSON.parse(data[0].item_choices));
this.setobject(JSON.parse(data[0].flow_choices)); this.setobject(JSON.parse(data[0].flow_choices));
...@@ -193,6 +233,13 @@ export class PrefixDetailsComponent implements OnInit { ...@@ -193,6 +233,13 @@ export class PrefixDetailsComponent implements OnInit {
} }
} }
} }
getquantifier(strIntoObj: any): void {
for (let x = 0; x < strIntoObj.length; x++) {
if (this.prefix_quantifier.indexOf(strIntoObj[x][1]) == -1) {
this.prefix_quantifier.push((strIntoObj[x][1]));
}
}
}
setsubject(strIntoObj: any): void { setsubject(strIntoObj: any): void {
for (let x = 0; x < strIntoObj.length; x++) { for (let x = 0; x < strIntoObj.length; x++) {
...@@ -219,4 +266,12 @@ export class PrefixDetailsComponent implements OnInit { ...@@ -219,4 +266,12 @@ export class PrefixDetailsComponent implements OnInit {
} }
} }
getnumunit(strIntoObj: any): void {
for (let x = 0; x < strIntoObj.length; x++) {
if (this.prefix_mumerical_units.indexOf(strIntoObj[x][1]) == -1) {
this.prefix_mumerical_units.push((strIntoObj[x][1]));
}
}
}
} }
\ No newline at end of file
export class Prefix { export class Prefix {
id?:any; id?: any;
prefix_boilerplate?:any; prefix_boilerplate?: any;
prefix_group?:any; prefix_group?: any;
prefix?: string; prefix?: string;
system_fun_item?: string; system_fun_item?: string;
state_or_verb?: string; state_or_verb?: string;
prefix_quantifier?: string;
prefix_numerical?: any;
prefix_mumerical_units?: string;
item_function_flow_statevalue?: string; item_function_flow_statevalue?: string;
logical_expression?: string; logical_expression?: string;
logic_connective?: string; logic_connective?: string;
......
# Generated by Django 2.2.4 on 2022-07-01 07:32
from django.db import migrations, models
import django.utils.timezone
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('created', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='created')),
('updated', models.DateTimeField(auto_now=True, verbose_name='updated')),
('email', models.EmailField(max_length=254, unique=True, verbose_name='email')),
('first_name', models.CharField(blank=True, max_length=30, null=True, verbose_name='first name')),
('last_name', models.CharField(blank=True, max_length=30, null=True, verbose_name='last name')),
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now)),
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
],
options={
'ordering': ('first_name', 'last_name'),
},
),
]
...@@ -121,7 +121,7 @@ def update_instances(instance): ...@@ -121,7 +121,7 @@ def update_instances(instance):
list_of_DSO.append("http://delab.csd.auth.gr/ontologies/2018/RDO-instances#") list_of_DSO.append("http://delab.csd.auth.gr/ontologies/2018/RDO-instances#")
#PREFIX_SYNTAX = get_prefix_syntax(g) #PREFIX_SYNTAX = get_prefix_syntax(g)
VERB_CHOICES_PREFIX = get_prefix_verbs(g) VERB_CHOICES_PREFIX = get_prefix_verbs(g)
VERB_CHOICES = get_verb_file_and_instances("LO#Verb", g) VERB_CHOICES = get_instances_g("LO#Action", g, ["http://delab.csd.auth.gr/ontologies/2018/LO#"])
SYSTEM_CHOICES = get_instances_g("SAO#System",g, list_of_DSO) SYSTEM_CHOICES = get_instances_g("SAO#System",g, list_of_DSO)
FUNCTION_CHOICES = get_instances_g("SAO#Function",g, list_of_DSO) FUNCTION_CHOICES = get_instances_g("SAO#Function",g, list_of_DSO)
ITEM_CHOICES = get_instances_g("SAO#Item",g, list_of_DSO) ITEM_CHOICES = get_instances_g("SAO#Item",g, list_of_DSO)
...@@ -230,6 +230,10 @@ class Prefix(models.Model): ...@@ -230,6 +230,10 @@ class Prefix(models.Model):
#state value constraint #state value constraint
system_fun_item = models.CharField(max_length=1000) system_fun_item = models.CharField(max_length=1000)
state_or_verb = models.CharField(max_length=1000) state_or_verb = models.CharField(max_length=1000)
#Between Verb - Object
prefix_quantifier = models.CharField(max_length=1000, blank=True)
prefix_numerical = models.CharField(blank=True, null=True, max_length=1000)
prefix_mumerical_units = models.CharField(max_length=1000, blank=True)
#occuring functionality #occuring functionality
item_function_flow_statevalue = models.CharField(max_length=1000) item_function_flow_statevalue = models.CharField(max_length=1000)
#state value constraint OR occuring functionality #state value constraint OR occuring functionality
......
...@@ -75,17 +75,11 @@ def get_verb_file_and_instances(keyword, g): ...@@ -75,17 +75,11 @@ def get_verb_file_and_instances(keyword, g):
keywordspl = keyword.split("#") keywordspl = keyword.split("#")
in_list = [] in_list = []
out_list = [] out_list = []
with open('../../Ontologies/instances.txt') as f: #for extra in in_list:
for data in f: per = URIRef("http://delab.csd.auth.gr/ontologies/2018/LO#" +keywordspl)
if (data.strip()).endswith(keyword):
spliter_1 = data.split('$')
spliter_2 = spliter_1[0].split("#")
in_list.append(spliter_2[len(spliter_2) - 1])
for extra in in_list:
per = URIRef("http://delab.csd.auth.gr/ontologies/2018/LO#" +extra)
for s, p, o in g.triples((None, RDF.type, per)): for s, p, o in g.triples((None, RDF.type, per)):
spl = s.split("#") spl = s.split("#")
out_list.append(extra + " : " + str(spl[1])) out_list.append(keywordspl + " : " + str(spl[1]))
return tuple((str(n), str(n)) for n in (out_list)) return tuple((str(n), str(n)) for n in (out_list))
...@@ -162,8 +156,9 @@ def get_file_and_instances(keyword, g): ...@@ -162,8 +156,9 @@ def get_file_and_instances(keyword, g):
per = URIRef(uri +extra) per = URIRef(uri +extra)
for s, p, o in g.triples((None, RDFS.subClassOf, per)): #subClassOf for s, p, o in g.triples((None, RDFS.subClassOf, per)): #subClassOf
spl = s.split("#") spl = s.split("#")
if(spl[len(spl) - 1] in in_list):
break
in_list.append(spl[len(spl) - 1]) in_list.append(spl[len(spl) - 1])
#print(in_list)
#find two layer down System: Subclass : Instance #find two layer down System: Subclass : Instance
for extra in in_list: for extra in in_list:
for uri in list_of_DSO: for uri in list_of_DSO:
......
...@@ -192,10 +192,18 @@ class PrefixDetailsAPIView(RetrieveUpdateDestroyAPIView): ...@@ -192,10 +192,18 @@ class PrefixDetailsAPIView(RetrieveUpdateDestroyAPIView):
def perform_update(self, serializer): def perform_update(self, serializer):
instance = serializer.validated_data instance = serializer.validated_data
#add data in thn Model BoilerplateData #add data in thn Model BoilerplateData
quantifier_instance,numunit_instance = [[""], [""]]
numinstance=''
es_instance = instance['system_fun_item'].rsplit(':', 1) es_instance = instance['system_fun_item'].rsplit(':', 1)
ev_instance =instance['state_or_verb'].rsplit(':', 1) ev_instance =instance['state_or_verb'].rsplit(':', 1)
ei_instance = instance['item_function_flow_statevalue'].rsplit(':', 1) ei_instance = instance['item_function_flow_statevalue'].rsplit(':', 1)
pr = (instance['prefix'] + ' ' + es_instance[len(es_instance)-1] + ' ' + ev_instance[len(ev_instance)-1] + ' ' + ei_instance[len(ei_instance)-1]) if instance['prefix_quantifier']:
quantifier_instance = instance['prefix_quantifier'].rsplit(':', 1)
if instance['prefix_mumerical_units']:
numunit_instance = instance['prefix_mumerical_units'].rsplit(':', 1)
if instance['prefix_numerical']:
numinstance= instance['prefix_numerical']
pr = (instance['prefix'] + ' ' + es_instance[len(es_instance)-1] + ' ' + ev_instance[len(ev_instance)-1] + ' ' + quantifier_instance[len(quantifier_instance)-1] +' '+numinstance +' ' + numunit_instance[len(numunit_instance)-1] + ' ' + ei_instance[len(ei_instance)-1])
boildata = BoilerplateData.objects.filter(owner_data=instance['prefix_boilerplate'].owner, boilerplate_data_id = instance['prefix_boilerplate']) boildata = BoilerplateData.objects.filter(owner_data=instance['prefix_boilerplate'].owner, boilerplate_data_id = instance['prefix_boilerplate'])
#get instances of the ontology that this boilerplate belongs #get instances of the ontology that this boilerplate belongs
data = BoilerplateGroupClassesInstances.objects.filter(classes_instances_owner= instance['prefix_boilerplate'].owner, classes_instances_group_of_boilerplate = boildata.values('group_of_boilerplate_data')[0]['group_of_boilerplate_data']) data = BoilerplateGroupClassesInstances.objects.filter(classes_instances_owner= instance['prefix_boilerplate'].owner, classes_instances_group_of_boilerplate = boildata.values('group_of_boilerplate_data')[0]['group_of_boilerplate_data'])
...@@ -205,6 +213,12 @@ class PrefixDetailsAPIView(RetrieveUpdateDestroyAPIView): ...@@ -205,6 +213,12 @@ class PrefixDetailsAPIView(RetrieveUpdateDestroyAPIView):
ev_data = data.values('state_choices')[0]['state_choices'] + data.values('prefix_verb_choices')[0]['prefix_verb_choices'] ev_data = data.values('state_choices')[0]['state_choices'] + data.values('prefix_verb_choices')[0]['prefix_verb_choices']
if( instance['state_or_verb'] not in ev_data): if( instance['state_or_verb'] not in ev_data):
raise APIException("PREFIX : Instance of State or Verb does not exist") raise APIException("PREFIX : Instance of State or Verb does not exist")
quantifier_data = data.values('quantifier_choices')[0]['quantifier_choices']
if( instance['prefix_quantifier'] not in quantifier_data):
raise APIException("MAIN : Instance of Quantifier does not exist")
numunit_data = data.values('number_unit_choices')[0]['number_unit_choices']
if( instance['prefix_mumerical_units'] not in numunit_data):
raise APIException("MAIN : Instance of Number Unit does not exist")
ei_data = data.values('function_choices')[0]['function_choices'] + data.values('item_choices')[0]['item_choices']+ data.values('flow_choices')[0]['flow_choices']+ data.values('state_value_choices')[0]['state_value_choices'] ei_data = data.values('function_choices')[0]['function_choices'] + data.values('item_choices')[0]['item_choices']+ data.values('flow_choices')[0]['flow_choices']+ data.values('state_value_choices')[0]['state_value_choices']
if( instance['item_function_flow_statevalue'] not in ei_data): if( instance['item_function_flow_statevalue'] not in ei_data):
raise APIException("PREFIX : Instance of Object does not exist") raise APIException("PREFIX : Instance of Object does not exist")
......
...@@ -69,6 +69,7 @@ django-jsonfield==1.4.1 ...@@ -69,6 +69,7 @@ django-jsonfield==1.4.1
djangorestframework-jwt==1.6 #djangorestframework-jwt==1.5.2 djangorestframework-jwt==1.6 #djangorestframework-jwt==1.5.2
drf-jwt==1.17.3 drf-jwt==1.17.3
django-cors-headers django-cors-headers
requests
# The following packages are considered to be unsafe in a requirements file: # The following packages are considered to be unsafe in a requirements file:
# setuptools==41.2.0 # via ipdb, ipython # setuptools==41.2.0 # via ipdb, ipython
...@@ -24,6 +24,9 @@ COPY build/docker-entrypoint-api.sh /api/ ...@@ -24,6 +24,9 @@ COPY build/docker-entrypoint-api.sh /api/
RUN ["chmod", "+x", "/api/docker-entrypoint-api.sh"] RUN ["chmod", "+x", "/api/docker-entrypoint-api.sh"]
RUN ["pip3", "install", "-r", "requirements/dev.txt"] RUN ["pip3", "install", "-r", "requirements/dev.txt"]
RUN ["apt-get", "install", "ruby-full", "-y"]
ENTRYPOINT ["/api/docker-entrypoint-api.sh"] ENTRYPOINT ["/api/docker-entrypoint-api.sh"]
EXPOSE 8000 EXPOSE 8000
...@@ -31,4 +34,4 @@ EXPOSE 8000 ...@@ -31,4 +34,4 @@ EXPOSE 8000
RUN ["pwd"] RUN ["pwd"]
RUN ["ls", "-l"] RUN ["ls", "-l"]
CMD ["gunicorn", "reqman.wsgi", "-b", "0.0.0.0:8000"] CMD ["gunicorn", "reqman.wsgi", "-b", "0.0.0.0:8000", "--timeout", "720"]
\ No newline at end of file \ No newline at end of file
...@@ -5,6 +5,7 @@ services: ...@@ -5,6 +5,7 @@ services:
build: build:
context: .. context: ..
dockerfile: build/Dockerfile.api dockerfile: build/Dockerfile.api
env_file: ../api/.env
depends_on: depends_on:
- postgres - postgres
environment: environment:
...@@ -21,17 +22,13 @@ services: ...@@ -21,17 +22,13 @@ services:
- POSTGRES_PASSWORD=reqman - POSTGRES_PASSWORD=reqman
ports: ports:
- "5432:5432" - "5432:5432"
# redis: fuseki:
# image: redis:latest image: stain/jena-fuseki
# elastic: environment:
# image: elasticsearch:7.2.0 - ADMIN_PASSWORD=pw!!!
# volumes: ports:
# - "reqman-elasticdata:/usr/share/elasticsearch/data" - "3030:3030"
# environment:
# - discovery.type=single-node
# ports:
# - "9200:9200"
# - "9300:9200"
volumes: volumes:
reqman-pgdata: reqman-pgdata:
......
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