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

CTS update: compute of property uri for relation object

parent 69aec6dc
No related branches found
No related tags found
No related merge requests found
......@@ -244,6 +244,7 @@ cts:batch_execution
sh:rule cts:compute-class-uri-of-net-object ;
sh:rule cts:compute-domain-of-relation-property ;
sh:rule cts:compute-instance-uri-of-net-object ;
sh:rule cts:compute-property-uri-of-relation-object ;
sh:rule cts:compute-range-of-relation-property ;
sh:rule cts:create-atom-net ;
sh:rule cts:create-relation-net ;
......@@ -496,6 +497,7 @@ CONSTRUCT {
WHERE {
# object
?object a net:Object.
?object net:objectType ?objectType.
?object net:has_mother_class ?motherClass.
?object net:has_parent_class ?parentClass.
?object net:has_class ?objectClass.
......@@ -508,6 +510,10 @@ WHERE {
BIND (uri( ?s1) AS ?motherClassUri).
BIND (uri( ?s2) AS ?parentClassUri).
BIND (uri(?s3) AS ?objectClassUri).
}
VALUES ?objectType {
net:atom
net:composite
}""" ;
sh:order 3.01 ;
.
......@@ -536,7 +542,7 @@ WHERE {
?net1 net:type net:relation.
?net1 net:relationOf ?relationMother.
?net1 net:has_relation ?relationObject.
?relationObject net:has_concept ?relationConcept.
?relationObject net:has_property_uri ?newPropertyUri.
# -- Domain
?net1 net:has_possible_domain ?possibleDomainLabel1.
?domainClass rdfs:label ?possibleDomainLabel1.
......@@ -547,12 +553,6 @@ WHERE {
?anotherDomainClass rdfs:subClassOf ?domainClass.
}
)
# URI (for object property)
sys:Relation sys:has_frame_uri ?frameURI.
?relationMother sys:has_reference ?relationReference.
BIND (concat( ?frameURI, ?relationReference) AS ?o1).
BIND (concat(?o1, '_', ?relationConcept) AS ?o2).
BIND (uri( ?o2) AS ?newPropertyUri).
}""" ;
sh:order 3.32 ;
.
......@@ -588,6 +588,43 @@ WHERE {
}""" ;
sh:order 3.02 ;
.
cts:compute-property-uri-of-relation-object
rdf:type sh:SPARQLRule ;
rdfs:label "compute-property-uri-of-relation-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:has_property_uri ?objectPropertyUri.
}
WHERE {
# Object of type Relation
?object a net:Object.
?object net:objectType ?objectType.
?object net:has_parent_property ?parentProperty.
?object net:has_concept ?objectConcept.
# URI (for object property)
sys:Relation sys:has_frame_uri ?frameURI.
?parentProperty sys:has_reference ?relationReference.
BIND (concat( ?frameURI, ?relationReference) AS ?o1).
BIND (concat(?o1, '_', ?objectConcept) AS ?o2).
BIND (uri( ?o2) AS ?objectPropertyUri).
}
VALUES ?objectType {
net:relation
}""" ;
sh:order 3.01 ;
.
cts:compute-range-of-relation-property
rdf:type sh:SPARQLRule ;
rdfs:label "compute-range-of-relation-property" ;
......@@ -613,7 +650,7 @@ WHERE {
?net1 net:type net:relation.
?net1 net:relationOf ?relationMother.
?net1 net:has_relation ?relationObject.
?relationObject net:has_concept ?relationConcept.
?relationObject net:has_property_uri ?newPropertyUri.
# -- Range
?net1 net:has_possible_range ?possibleRangeLabel1.
?rangeClass rdfs:label ?possibleRangeLabel1 .
......@@ -624,12 +661,6 @@ WHERE {
?anotherRangeClass rdfs:subClassOf ?rangeClass.
}
)
# URI (for object property)
sys:Relation sys:has_frame_uri ?frameURI.
?relationMother sys:has_reference ?relationReference.
BIND (concat( ?frameURI, ?relationReference) AS ?o1).
BIND (concat(?o1, '_', ?relationConcept) AS ?o2).
BIND (uri( ?o2) AS ?newPropertyUri).
}""" ;
sh:order 3.32 ;
.
......@@ -715,9 +746,7 @@ CONSTRUCT {
?newObject a net:Object.
?newObject net:objectType net:relation.
?newObject net:has_node ?uw1.
?newObject net:has_mother_class ?verbMother.
?newObject net:has_parent_class ?verbParentClass.
?newObject net:has_class ?verbConcept.
?newObject net:has_parent_property ?relationMother.
?newObject net:has_concept ?verbConcept.
# create: Relation Net
?newNet a net:Instance.
......@@ -1062,19 +1091,12 @@ WHERE {
# -- Relation Object
?net1 net:has_relation ?relationObject.
?relationObject net:has_concept ?relationConcept.
# -- old --- ?relationObject net:has_parent_class ?relationParentClass.
# -- Source Object
?net1 net:has_source ?sourceObject.
?sourceObject net:has_concept ?sourceConcept.
# -- old --- ?sourceObject net:has_instance ?sourceInstance.
# -- old --- ?sourceObject net:has_instance_uri ?sourceInstanceUri.
# -- old --- ?sourceObject net:has_parent_class ?sourceParentClass.
# -- Target Object
?net1 net:has_target ?targetObject1.
?targetObject1 net:has_concept ?targetConcept.
# -- old --- ?targetObject1 net:has_instance ?targetInstance.
# -- old --- ?targetObject1 net:has_instance_uri ?targetInstanceUri.
# -- old --- ?targetObject1 net:has_parent_class ?targetParentClass.
# Label: event
BIND (concat(?sourceConcept, '-', ?relationConcept) AS ?e1).
BIND (concat(?e1, '-', ?targetConcept) AS ?eventLabel).
......@@ -1106,7 +1128,7 @@ PREFIX fprm: <https://unsel.tetras-libre.fr/tenet/frame/parameters#>
CONSTRUCT {
# update: Relation Property
?newPropertyUri a owl:ObjectProperty.
?newPropertyUri rdfs:subPropertyOf ?relationMother.
?newPropertyUri rdfs:subPropertyOf ?parentProperty.
?newPropertyUri rdfs:label ?relationConcept.
?newPropertyUri sys:from_structure ?req.
?sourceInstanceUri ?newPropertyUri ?targetInstanceUri.
......@@ -1119,19 +1141,14 @@ WHERE {
?net1 net:has_structure ?req.
# -- Relation Object
?net1 net:has_relation ?relationObject.
?relationObject net:has_concept ?relationConcept.
?relationObject net:has_parent_property ?parentProperty.
?relationObject net:has_property_uri ?newPropertyUri.
# -- Source Object
?net1 net:has_source ?sourceObject.
?sourceObject net:has_instance_uri ?sourceInstanceUri.
# -- Target Object
?net1 net:has_target ?targetObject.
?targetObject net:has_instance_uri ?targetInstanceUri.
# URI (for object property)
sys:Relation sys:has_frame_uri ?frameURI.
?relationMother sys:has_reference ?relationReference.
BIND (concat( ?frameURI, ?relationReference) AS ?o1).
BIND (concat(?o1, '_', ?relationConcept) AS ?o2).
BIND (uri( ?o2) AS ?newPropertyUri).
}""" ;
sh:order 3.31 ;
.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment