Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
tenet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tetras MARS
tenet
Commits
3c6f9f99
Commit
3c6f9f99
authored
3 years ago
by
Aurélien Lamercerie
Browse files
Options
Downloads
Patches
Plain Diff
CTS update: compute of property uri for relation object
parent
69aec6dc
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
config/transduction-schemes.ttl
+50
-33
50 additions, 33 deletions
config/transduction-schemes.ttl
with
50 additions
and
33 deletions
config/transduction-schemes.ttl
+
50
−
33
View file @
3c6f9f99
...
...
@@ -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.0
1
;
.
...
...
@@ -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.3
2
;
.
...
...
@@ -588,6 +588,43 @@ WHERE {
}"""
;
sh:
order
3.0
2
;
.
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.0
1
;
.
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.3
2
;
.
...
...
@@ -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.3
1
;
.
...
...
This diff is collapsed.
Click to expand it.
Aurélien Lamercerie
@alam
mentioned in issue
#9 (closed)
·
3 years ago
mentioned in issue
#9 (closed)
mentioned in issue #9
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment