Commit c53b3dfa authored by Thodoris Nestoridis's avatar Thodoris Nestoridis

refresh models

parent d879829f
...@@ -37,10 +37,13 @@ QUANTIFIER_CHOICES = ( ("none","NONE"), ("all", "ALL"), ("only", "ONLY"), ...@@ -37,10 +37,13 @@ QUANTIFIER_CHOICES = ( ("none","NONE"), ("all", "ALL"), ("only", "ONLY"),
NUMBER_UNITS_CHOICES = (("",""), ("meters","METERS"), ("kilometers","KILOMETERS"), ("volt","VOLT")) NUMBER_UNITS_CHOICES = (("",""), ("meters","METERS"), ("kilometers","KILOMETERS"), ("volt","VOLT"))
ITEM_CHOICES = get_instances("SAO#Item") ITEM_CHOICES = get_instances("SAO#Item")
STATE_VALUE_CHOICES =get_instances("SAO#StateValue") STATE_VALUE_CHOICES =get_instances("SAO#StateValue")
STATE_CHOICES = get_instances("SAO#State")#tuple( [ x for x in find_extra_keywords(":State", 2) if x not in STATE_VALUE_CHOICES ]) STATE_CHOICES = get_instances("SAO#State")
#state set not working
STATE_SET_CHOICES = get_instances("SAO#StateSet")
FLOW_CHOICES = get_instances("SAO#Flow") FLOW_CHOICES = get_instances("SAO#Flow")
INTERFACE_CHOICES = get_instances("SAO#Interface") INTERFACE_CHOICES = get_instances("SAO#Interface")
CONNECTION_CHOICES = get_instances("SAO#Connection") CONNECTION_CHOICES = get_instances("SAO#Connection")
#add automatic function ot get verbs
VERB_CHOICES = (("set","set"),("send","send"),("receive","receive"),("ingest","ingest"),("emit","emit"),("perform","perform"),("invoke","invoke"), VERB_CHOICES = (("set","set"),("send","send"),("receive","receive"),("ingest","ingest"),("emit","emit"),("perform","perform"),("invoke","invoke"),
("present","present"),("transfer","transfer"),("interact with","interact with"),("have state","have state"),("have substate","have substate"), ("present","present"),("transfer","transfer"),("interact with","interact with"),("have state","have state"),("have substate","have substate"),
("take values from","take values from"),("be composed","be composed"),("contain","contain")) ("take values from","take values from"),("be composed","be composed"),("contain","contain"))
...@@ -70,26 +73,21 @@ class Main(models.Model): ...@@ -70,26 +73,21 @@ class Main(models.Model):
boilerplate_of_main = models.ForeignKey('reqtool.Boilerplate', related_name='main_boilerplate', on_delete=models.CASCADE) boilerplate_of_main = models.ForeignKey('reqtool.Boilerplate', related_name='main_boilerplate', on_delete=models.CASCADE)
main_owner = models.ForeignKey(User, related_name='main_owner', on_delete=models.CASCADE) main_owner = models.ForeignKey(User, related_name='main_owner', on_delete=models.CASCADE)
#Subject #Subject
sys_fun_inter = models.CharField(choices=SYSTEM_FUNCTION_INTERFACE_CHOICES, max_length=100) sys_fun_inter = models.CharField(choices=SYSTEM_CHOICES + FUNCTION_CHOICES + INTERFACE_CHOICES, max_length=100)
#Between Subject - Verb #Between Subject - Verb
state_before_verb = models.CharField(choices=STATE_CHOICES, max_length=100, blank=True) state_item_before_verb = models.CharField(choices=STATE_CHOICES + ITEM_CHOICES, max_length=100, blank=True)
statevalue_before_verb = models.CharField(choices=STATE_VALUE_CHOICES, max_length=100, blank=True) statevalue_before_verb = models.CharField(choices=STATE_VALUE_CHOICES, max_length=100, blank=True)
item_before_verb = models.CharField(choices=ITEM_CHOICES, max_length=100, blank=True )
#Verb #Verb
shall = models.CharField(choices=SHALL_CHOICES, max_length=100) shall = models.CharField(choices=SHALL_CHOICES, max_length=100)
verb = models.CharField(choices=VERB_CHOICES, max_length=100) verb = models.CharField(choices=VERB_CHOICES, max_length=100)
#Between Verb - Object #Between Verb - Object
quantifier = models.CharField(choices=QUANTIFIER_CHOICES, max_length=100, blank=True) quantifier = models.CharField(choices=QUANTIFIER_CHOICES, max_length=100, blank=True)
numerical = models.IntegerField(default=0, blank=True) numerical = models.IntegerField(blank=True, null=True)
mumerical_units = models.CharField(choices=NUMBER_UNITS_CHOICES, max_length=100) mumerical_units = models.CharField(choices=NUMBER_UNITS_CHOICES, max_length=100, blank=True)
item = models.CharField(choices=ITEM_CHOICES, max_length=100, blank=True)
state = models.CharField(choices=STATE_CHOICES, max_length=100, blank=True)
statevalue = models.CharField(choices=STATE_VALUE_CHOICES, max_length=100, blank=True)
#Οbject #Οbject
#add stateSet flow_function_interface_item_system_state_stateset = models.CharField(choices=FLOW_CHOICES + FUNCTION_CHOICES + INTERFACE_CHOICES + ITEM_CHOICES + SYSTEM_CHOICES +STATE_CHOICES + STATE_SET_CHOICES, max_length=100)
flow_function_interface_item_system_state = models.CharField(choices=FLOW_FUNCTION_INTERFACE_ITEM_SYSTEM_STATE_CHOICES, max_length=100, blank=True)
#last definitions #last definitions
connection = models.CharField(choices=CONNECTION_CHOICES, max_length=100, blank=True) statevalue_system_connection_stateset = models.CharField(choices=STATE_VALUE_CHOICES + SYSTEM_CHOICES + CONNECTION_CHOICES + STATE_SET_CHOICES, max_length=100, blank=True)
#ID [M1-M16] #ID [M1-M16]
main_choices = models.CharField(choices=MAIN_CHOICES, max_length=100) main_choices = models.CharField(choices=MAIN_CHOICES, max_length=100)
......
from django.db import models from django.db import models
#from reqman.apps.common.models import CoreModel #from reqman.apps.common.models import CoreModel
from reqman.apps.account.models import User from reqman.apps.account.models import User
from reqman.apps.reqtool.models.main_req import create_main, ITEM_CHOICES,STATE_VALUE_CHOICES, STATE_CHOICES, SYSTEM_CHOICES, SYSTEM_OR_FUNCTION_CHOICES, ITEM_FLOW_FUNCTION from reqman.apps.reqtool.models.main_req import create_main, ITEM_CHOICES, STATE_VALUE_CHOICES, STATE_CHOICES, SYSTEM_CHOICES, FUNCTION_CHOICES, FLOW_CHOICES
from reqman.apps.reqtool.models.suffix_req import create_suffix from reqman.apps.reqtool.models.suffix_req import create_suffix
from pygments.formatters.html import HtmlFormatter from pygments.formatters.html import HtmlFormatter
...@@ -93,13 +93,13 @@ class Prefix(models.Model): ...@@ -93,13 +93,13 @@ class Prefix(models.Model):
prefix_boilerplate = models.ForeignKey(Boilerplate, related_name='prefix_boilerplate', on_delete=models.CASCADE) prefix_boilerplate = models.ForeignKey(Boilerplate, related_name='prefix_boilerplate', on_delete=models.CASCADE)
prefix = models.CharField(choices=PREFIX_CHOICES, max_length=100) prefix = models.CharField(choices=PREFIX_CHOICES, max_length=100)
#state value constraint #state value constraint
system_fun_item = models.CharField(choices= (ITEM_CHOICES + SYSTEM_OR_FUNCTION_CHOICES), max_length=100, blank=True) system_fun_item = models.CharField(choices= (ITEM_CHOICES + SYSTEM_CHOICES + FUNCTION_CHOICES), max_length=100, blank=True)
state_or_verb = models.CharField(choices=STATE_CHOICES + VERB_CHOICES, max_length=100, blank=True) state_or_verb = models.CharField(choices=STATE_CHOICES + VERB_CHOICES, max_length=100, blank=True)
#state_value = models.CharField(choices=STATE_VALUE_CHOICES, max_length=100, blank=True) #state_value = models.CharField(choices=STATE_VALUE_CHOICES, max_length=100, blank=True)
#occuring functionality #occuring functionality
#sys_fun = models.CharField(choices=, max_length=100, blank=True) #sys_fun = models.CharField(choices=, max_length=100, blank=True)
#verb = models.CharField(choices=VERB_CHOICES, max_length=100, blank=True) #verb = models.CharField(choices=VERB_CHOICES, max_length=100, blank=True)
item_function_flow_statevalue = models.CharField(choices=ITEM_FLOW_FUNCTION + STATE_VALUE_CHOICES, max_length=100, blank=True) item_function_flow_statevalue = models.CharField(choices=ITEM_CHOICES + FLOW_CHOICES + FUNCTION_CHOICES + STATE_VALUE_CHOICES, max_length=100, blank=True)
#Prefix value P1/P2/P3 #Prefix value P1/P2/P3
logical_expression = models.CharField(choices=LOGICAL_EXPRESSION, max_length=100, blank=True) logical_expression = models.CharField(choices=LOGICAL_EXPRESSION, max_length=100, blank=True)
#Info for prefix #Info for prefix
......
...@@ -50,7 +50,7 @@ class Suffix(models.Model): ...@@ -50,7 +50,7 @@ class Suffix(models.Model):
#prefix templates #prefix templates
s_choices = models.CharField(choices=S_CHOICES, max_length=100, blank=True) s_choices = models.CharField(choices=S_CHOICES, max_length=100, blank=True)
#if S1 #if S1
numerical = models.IntegerField(default=0, blank=True) numerical = models.IntegerField(blank=True, null=True)
mumerical_units = models.CharField(choices=NUMBER_UNITS_CHOICES, max_length=100, blank=True) mumerical_units = models.CharField(choices=NUMBER_UNITS_CHOICES, max_length=100, blank=True)
time_units = models.CharField(choices=TIME_UNITS_CHOICES, max_length=100, blank=True) time_units = models.CharField(choices=TIME_UNITS_CHOICES, max_length=100, blank=True)
#if S2/S3 #if S2/S3
......
...@@ -23,10 +23,11 @@ for subj, obj in g.subject_objects(predicate=RDFS.subClassOf): ...@@ -23,10 +23,11 @@ for subj, obj in g.subject_objects(predicate=RDFS.subClassOf):
subClass = subj + "$"+ obj + "\n" subClass = subj + "$"+ obj + "\n"
file2.write(subClass) file2.write(subClass)
l = get_instances("SAO#System") l = get_instances("SAO#StateSet")
print(l)
for i in l: for i in l:
p = URIRef("http://delab.csd.auth.gr/ontologies/2018/DSO#" +i) p = URIRef("http://delab.csd.auth.gr/ontologies/2018/SAO#StateSet")
for s, p, o in g.triples((None, RDF.type, p)): for s, p, o in g.triples((None, RDF.type, p)):
print(s) print(s)
......
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