Skip to content
Snippets Groups Projects
Commit b2046d8b authored by Aurélien Lamercerie's avatar Aurélien Lamercerie
Browse files

Compute domain/range of event/stateProperty object properties

parent f4aa20e6
No related branches found
No related tags found
No related merge requests found
......@@ -45,6 +45,11 @@ net:class
rdfs:label "class" ;
rdfs:subClassOf net:Type ;
.
net:classUri
rdf:type rdf:Property ;
rdfs:label "class uri" ;
rdfs:subPropertyOf net:objectValue ;
.
net:class_list
rdf:type owl:Class ;
rdfs:label "classList" ;
......@@ -165,6 +170,11 @@ net:has_verb
rdfs:label "has verb" ;
rdfs:subPropertyOf net:has_object ;
.
net:instanceUri
rdf:type rdf:Property ;
rdfs:label "instance uri" ;
rdfs:subPropertyOf net:objectValue ;
.
net:listGuiding
rdf:type rdf:Property ;
rdfs:label "Guiding connector of a list (or, and)" ;
......@@ -199,6 +209,11 @@ net:objectValue
rdfs:label "valuations"@fr ;
rdfs:subPropertyOf net:objectAttribute ;
.
net:parentClassUri
rdf:type rdf:Property ;
rdfs:label "parent class uri" ;
rdfs:subPropertyOf net:objectValue ;
.
net:property
rdf:type rdf:Property ;
rdfs:label "netProperty" ;
......
......@@ -316,10 +316,12 @@ WHERE {
?actorObject1 net:entityClass ?actorClass.
?actorObject1 net:concept ?actorConcept.
?actorObject1 net:entityInstance ?actorInstance.
?actorObject1 net:instanceUri ?actorInstanceUri.
?net1 net:has_target ?targetObject1.
?targetObject1 net:entityClass ?targetClass.
?targetObject1 net:concept ?targetConcept.
?targetObject1 net:entityInstance ?targetInstance.
?targetObject1 net:instanceUri ?targetInstanceUri.
# Label: event
BIND (concat(?actorConcept, '-', ?verbConcept) AS ?e1).
BIND (concat(?e1, '-', ?targetConcept) AS ?eventLabel).
......@@ -330,30 +332,31 @@ WHERE {
BIND (concat(?c1, '_', ?eventLabel) AS ?c2).
BIND (uri( ?c1) AS ?eventClassUri).
BIND (uri(?c2) AS ?newEventUri).
# URI (for instance)
# -- old --- BIND (concat( ?frameURI, ?eventClass) AS ?i1).
# -- old --- BIND (concat(?i1, '_', ?mainInstance) AS ?i2).
# -- old --- BIND (uri(?i2) AS ?mainInstanceUri).
# URI (for object property)
fprm:System_Ontology fprm:frameURI ?frameURI.
fprm:System_Event fprm:objectProperty ?eventObjectProperty.
BIND (concat( ?frameURI, ?eventObjectProperty) AS ?o1).
BIND (concat(?o1, '#', ?verbConcept) AS ?o2).
BIND (uri( ?o1) AS ?eventObjectPropertyUri).
BIND (uri( ?o2) AS ?newEventObjectPropertyUri).
# URI (for instance)
# -- old --- BIND (concat( ?frameURI, ?eventClass) AS ?i1).
# -- old --- BIND (concat(?i1, '_', ?mainInstance) AS ?i2).
# -- old --- BIND (uri(?i2) AS ?mainInstanceUri).
# URI (for Entity classes)
fprm:System_Ontology fprm:frameURI ?frameURI.
BIND (concat( ?frameURI, ?actorClass) AS ?e1a).
BIND (concat(?e1a, '#', ?actorConcept) AS ?e1b).
BIND (concat(?e1a, '_', ?actorInstance) AS ?e1c).
BIND (uri(?e1a) AS ?actorClassUri).
BIND (uri(?e1b) AS ?actorUri).
BIND (uri(?e1c) AS ?actorInstanceUri).
BIND (concat( ?frameURI, ?targetClass) AS ?e2a).
BIND (concat(?e2a, '#', ?targetConcept) AS ?e2b).
BIND (concat(?e2a, '_', ?targetInstance) AS ?e2c).
BIND (uri(?e2a) AS ?targetClassUri).
BIND (uri(?e2b) AS ?targetUri).
BIND (uri(?e2c) AS ?targetInstanceUri).
# -- old --- fprm:System_Ontology fprm:frameURI ?frameURI.
# -- old --- BIND (concat( ?frameURI, ?actorClass) AS ?e1a).
# -- old --- BIND (concat(?e1a, '#', ?actorConcept) AS ?e1b).
# -- old --- BIND (concat(?e1a, '_', ?actorInstance) AS ?e1c).
# -- old --- BIND (uri(?e1a) AS ?actorClassUri).
# -- old --- BIND (uri(?e1b) AS ?actorUri).
# -- old --- BIND (uri(?e1c) AS ?actorInstanceUri).
# -- old --- BIND (concat( ?frameURI, ?targetClass) AS ?e2a).
# -- old --- BIND (concat(?e2a, '#', ?targetConcept) AS ?e2b).
# -- old --- BIND (concat(?e2a, '_', ?targetInstance) AS ?e2c).
# -- old --- BIND (uri(?e2a) AS ?targetClassUri).
# -- old --- BIND (uri(?e2b) AS ?targetUri).
# -- old --- BIND (uri(?e2c) AS ?targetInstanceUri).
}""" ;
sh:order 3.1 ;
.
......@@ -497,10 +500,12 @@ WHERE {
?actorObject1 net:entityClass ?actorClass.
?actorObject1 net:concept ?actorConcept.
?actorObject1 net:entityInstance ?actorInstance.
?actorObject1 net:instanceUri ?actorInstanceUri.
?net1 net:has_target ?targetObject1.
?targetObject1 net:entityClass ?targetClass.
?targetObject1 net:concept ?targetConcept.
?targetObject1 net:entityInstance ?targetInstance.
?targetObject1 net:instanceUri ?targetInstanceUri.
# Label: event
BIND (concat(?actorConcept, '-', ?verbConcept) AS ?e1).
BIND (concat(?e1, '-', ?targetConcept) AS ?statePropertyLabel).
......@@ -511,30 +516,30 @@ WHERE {
BIND (concat(?c1, '_', ?statePropertyLabel) AS ?c2).
BIND (uri( ?c1) AS ?statePropertyClassUri).
BIND (uri(?c2) AS ?newStatePropertyUri).
# URI (for instance)
# -- old --- BIND (concat( ?frameURI, ?eventClass) AS ?i1).
# -- old --- BIND (concat(?i1, '_', ?mainInstance) AS ?i2).
# -- old --- BIND (uri(?i2) AS ?mainInstanceUri).
# URI (for object property)
fprm:System_State_Property fprm:objectProperty ?statePropertyObjectProperty.
BIND (concat( ?frameURI, ?statePropertyObjectProperty) AS ?o1).
BIND (concat(?o1, '#', ?verbConcept) AS ?o2).
BIND (uri( ?o1) AS ?statePropertyObjectPropertyUri).
BIND (uri( ?o2) AS ?newStatePropertyObjectPropertyUri).
# URI (for instance)
# -- old --- BIND (concat( ?frameURI, ?eventClass) AS ?i1).
# -- old --- BIND (concat(?i1, '_', ?mainInstance) AS ?i2).
# -- old --- BIND (uri(?i2) AS ?mainInstanceUri).
# URI (for Entity classes)
fprm:System_Ontology fprm:frameURI ?frameURI.
BIND (concat( ?frameURI, ?actorClass) AS ?e1a).
BIND (concat(?e1a, '#', ?actorConcept) AS ?e1b).
BIND (concat(?e1a, '_', ?actorInstance) AS ?e1c).
BIND (uri(?e1a) AS ?actorClassUri).
BIND (uri(?e1b) AS ?actorUri).
BIND (uri(?e1c) AS ?actorInstanceUri).
BIND (concat( ?frameURI, ?targetClass) AS ?e2a).
BIND (concat(?e2a, '#', ?targetConcept) AS ?e2b).
BIND (concat(?e2a, '_', ?targetInstance) AS ?e2c).
BIND (uri(?e2a) AS ?targetClassUri).
BIND (uri(?e2b) AS ?targetUri).
BIND (uri(?e2c) AS ?targetInstanceUri).
# -- old --- fprm:System_Ontology fprm:frameURI ?frameURI.
# -- old --- BIND (concat( ?frameURI, ?actorClass) AS ?e1a).
# -- old --- BIND (concat(?e1a, '#', ?actorConcept) AS ?e1b).
# -- old --- BIND (concat(?e1a, '_', ?actorInstance) AS ?e1c).
# -- old --- BIND (uri(?e1a) AS ?actorClassUri).
# -- old --- BIND (uri(?e1b) AS ?actorUri).
# -- old --- BIND (uri(?e1c) AS ?actorInstanceUri).
# -- old --- BIND (concat( ?frameURI, ?targetClass) AS ?e2a).
# -- old --- BIND (concat(?e2a, '#', ?targetConcept) AS ?e2b).
# -- old --- BIND (concat(?e2a, '_', ?targetInstance) AS ?e2c).
# -- old --- BIND (uri(?e2a) AS ?targetClassUri).
# -- old --- BIND (uri(?e2b) AS ?targetUri).
# -- old --- BIND (uri(?e2c) AS ?targetInstanceUri).
}""" ;
sh:order 3.1 ;
.
......@@ -610,6 +615,10 @@ cts:batch_execution
sh:rule cts:compose-entity-modlist-1 ;
sh:rule cts:compose-entity-modlist-2 ;
sh:rule cts:compose-entity-modlist-3 ;
sh:rule cts:compute-class-uri-of-entity-net-object ;
sh:rule cts:compute-domain-range-of-event-object-properties ;
sh:rule cts:compute-domain-range-of-state-property-object-properties ;
sh:rule cts:compute-instance-uri-of-entity-net-object ;
sh:rule cts:create-abstraction-net ;
sh:rule cts:create-entity-net ;
sh:rule cts:create-feature-net ;
......@@ -1146,6 +1155,186 @@ WHERE {
}""" ;
sh:order 2.6 ;
.
cts:compute-class-uri-of-entity-net-object
rdf:type sh:SPARQLRule ;
rdfs:label "compute-class-uri-of-entity-net-object" ;
sh:construct """PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX unl: <https://unl.tetras-libre.fr/rdf/schema#>
PREFIX net: <https://unsel.tetras-libre.fr/tenet/semantic-net#>
PREFIX cprm: <https://unsel.tetras-libre.fr/tenet/config/parameters#>
PREFIX req: <https://unsel.tetras-libre.fr/tenet/frame/requirement-ontology#>
PREFIX sys: <https://unsel.tetras-libre.fr/tenet/frame/system-ontology/>
PREFIX fprm: <https://unsel.tetras-libre.fr/tenet/frame/parameters#>
# -- Compute useful URI
CONSTRUCT {
# Net Object URI
?object net:parentClassUri ?parentClassUri.
?object net:classUri ?objectClassUri.
}
WHERE {
# net1: entity
?object a net:Object.
?object net:entityClass ?objectClass.
?object net:concept ?objectConcept.
# URI (for classes and instance)
fprm:System_Ontology fprm:frameURI ?frameURI.
BIND (concat( ?frameURI, ?objectClass) AS ?s1).
BIND (concat(?s1, '#', ?objectConcept) AS ?s2).
BIND (uri( ?s1) AS ?parentClassUri).
BIND (uri(?s2) AS ?objectClassUri).
}""" ;
sh:order 3.01 ;
.
cts:compute-domain-range-of-event-object-properties
rdf:type sh:SPARQLRule ;
rdfs:label "compute-domain-range-of-object-properties" ;
sh:construct """PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX unl: <https://unl.tetras-libre.fr/rdf/schema#>
PREFIX net: <https://unsel.tetras-libre.fr/tenet/semantic-net#>
PREFIX cprm: <https://unsel.tetras-libre.fr/tenet/config/parameters#>
PREFIX req: <https://unsel.tetras-libre.fr/tenet/frame/requirement-ontology#>
PREFIX sys: <https://unsel.tetras-libre.fr/tenet/frame/system-ontology/>
PREFIX fprm: <https://unsel.tetras-libre.fr/tenet/frame/parameters#>
# -- Compute domain/range of object properties
CONSTRUCT {
# Object Property: domain, range and relation between domain/range classes
?newEventObjectPropertyUri rdfs:domain ?domainClass.
?newEventObjectPropertyUri rdfs:range ?rangeClass.
?domainClass ?newEventObjectPropertyUri ?rangeClass. # relation between domain/range classes
}
WHERE {
# net1: event
?net1 a net:Instance.
?net1 net:type net:event.
?net1 net:has_structure ?req.
?net1 net:has_verb ?verbObject1.
?verbObject1 net:concept ?verbConcept.
# domain
?net1 net:has_possible_domain ?possibleDomainLabel1.
?domainClass rdfs:label ?possibleDomainLabel1 .
FILTER (
NOT EXISTS {
?net2 net:has_possible_domain ?possibleDomainLabel2 .
?anotherDomainClass rdfs:label ?possibleDomainLabel2 .
?anotherDomainClass rdfs:subClassOf ?domainClass.
}
)
# range
?net1 net:has_possible_range ?possibleRangeLabel1.
?rangeClass rdfs:label ?possibleRangeLabel1 .
FILTER (
NOT EXISTS {
?net2 net:has_possible_domain ?possibleRangeLabel2 .
?anotherRangeClass rdfs:label ?possibleRangeLabel2 .
?anotherRangeClass rdfs:subClassOf ?rangeClass.
}
)
# URI (for object property)
fprm:System_Ontology fprm:frameURI ?frameURI.
fprm:System_Event fprm:objectProperty ?eventObjectProperty.
BIND (concat( ?frameURI, ?eventObjectProperty) AS ?o1).
BIND (concat(?o1, '#', ?verbConcept) AS ?o2).
BIND (uri( ?o2) AS ?newEventObjectPropertyUri).
}""" ;
sh:order 3.5 ;
.
cts:compute-domain-range-of-state-property-object-properties
rdf:type sh:SPARQLRule ;
rdfs:label "compute-domain-range-of-object-properties" ;
sh:construct """PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX unl: <https://unl.tetras-libre.fr/rdf/schema#>
PREFIX net: <https://unsel.tetras-libre.fr/tenet/semantic-net#>
PREFIX cprm: <https://unsel.tetras-libre.fr/tenet/config/parameters#>
PREFIX req: <https://unsel.tetras-libre.fr/tenet/frame/requirement-ontology#>
PREFIX sys: <https://unsel.tetras-libre.fr/tenet/frame/system-ontology/>
PREFIX fprm: <https://unsel.tetras-libre.fr/tenet/frame/parameters#>
# -- Compute domain/range of object properties
CONSTRUCT {
# Object Property: domain, range and relation between domain/range classes
?objectPropertyUri rdfs:domain ?domainClass.
?objectPropertyUri rdfs:range ?rangeClass.
?domainClass ?objectPropertyUri ?rangeClass. # relation between domain/range classes
}
WHERE {
# net1: event
?net1 a net:Instance.
?net1 net:type net:state_property.
?net1 net:has_structure ?req.
?net1 net:has_verb ?verbObject1.
?verbObject1 net:concept ?verbConcept.
# domain
?net1 net:has_possible_domain ?possibleDomainLabel1.
?domainClass rdfs:label ?possibleDomainLabel1 .
FILTER (
NOT EXISTS {
?net2 net:has_possible_domain ?possibleDomainLabel2 .
?anotherDomainClass rdfs:label ?possibleDomainLabel2 .
?anotherDomainClass rdfs:subClassOf ?domainClass.
}
)
# range
?net1 net:has_possible_range ?possibleRangeLabel1.
?rangeClass rdfs:label ?possibleRangeLabel1 .
FILTER (
NOT EXISTS {
?net2 net:has_possible_domain ?possibleRangeLabel2 .
?anotherRangeClass rdfs:label ?possibleRangeLabel2 .
?anotherRangeClass rdfs:subClassOf ?rangeClass.
}
)
# URI (for object property)
fprm:System_Ontology fprm:frameURI ?frameURI.
fprm:System_State_Property fprm:objectProperty ?objectPropertyRef.
BIND (concat( ?frameURI, ?objectPropertyRef) AS ?o1).
BIND (concat(?o1, '#', ?verbConcept) AS ?o2).
BIND (uri( ?o2) AS ?objectPropertyUri).
}""" ;
sh:order 3.5 ;
.
cts:compute-instance-uri-of-entity-net-object
rdf:type sh:SPARQLRule ;
rdfs:label "compute-instance-uri-of-entity-net-object" ;
sh:construct """PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX unl: <https://unl.tetras-libre.fr/rdf/schema#>
PREFIX net: <https://unsel.tetras-libre.fr/tenet/semantic-net#>
PREFIX cprm: <https://unsel.tetras-libre.fr/tenet/config/parameters#>
PREFIX req: <https://unsel.tetras-libre.fr/tenet/frame/requirement-ontology#>
PREFIX sys: <https://unsel.tetras-libre.fr/tenet/frame/system-ontology/>
PREFIX fprm: <https://unsel.tetras-libre.fr/tenet/frame/parameters#>
# -- Compute useful URI
CONSTRUCT {
# Net Object URI
?object net:instanceUri ?objectInstanceUri.
}
WHERE {
# net1: entity
?object a net:Object.
?object net:entityClass ?objectClass.
?object net:entityInstance ?objectInstance.
# URI (for classes and instance)
fprm:System_Ontology fprm:frameURI ?frameURI.
BIND (concat( ?frameURI, ?objectClass) AS ?s1).
BIND (concat(?s1, '_', ?objectInstance) AS ?s3).
BIND (uri(?s3) AS ?objectInstanceUri).
}""" ;
sh:order 3.02 ;
.
cts:create-abstraction-net
rdf:type sh:SPARQLRule ;
sh:construct """PREFIX owl: <http://www.w3.org/2002/07/owl#>
......@@ -1468,6 +1657,10 @@ cts:generation
sh:rule cts:add-state-property ;
sh:rule cts:add-verb ;
sh:rule cts:complement-list-of-entity-classes ;
sh:rule cts:compute-class-uri-of-entity-net-object ;
sh:rule cts:compute-domain-range-of-event-object-properties ;
sh:rule cts:compute-domain-range-of-state-property-object-properties ;
sh:rule cts:compute-instance-uri-of-entity-net-object ;
.
cts:init-mod-list
rdf:type sh:SPARQLRule ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment