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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tetras MARS
tenet
Commits
b2046d8b
Commit
b2046d8b
authored
Sep 16, 2021
by
Aurélien Lamercerie
Browse files
Options
Downloads
Patches
Plain Diff
Compute domain/range of event/stateProperty object properties
parent
f4aa20e6
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/semantic-net.ttl
+15
-0
15 additions, 0 deletions
config/semantic-net.ttl
config/transduction-schemes.ttl
+229
-36
229 additions, 36 deletions
config/transduction-schemes.ttl
with
244 additions
and
36 deletions
config/semantic-net.ttl
+
15
−
0
View file @
b2046d8b
...
...
@@ -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"
;
...
...
This diff is collapsed.
Click to expand it.
config/transduction-schemes.ttl
+
229
−
36
View file @
b2046d8b
...
...
@@ -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.0
1
;
.
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.0
2
;
.
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
;
...
...
This diff is collapsed.
Click to expand it.
Aurélien Lamercerie
@alam
mentioned in issue
#11 (closed)
·
Sep 16, 2021
mentioned in issue
#11 (closed)
mentioned in issue #11
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