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
6510dfcb
Commit
6510dfcb
authored
3 years ago
by
Aurélien Lamercerie
Browse files
Options
Downloads
Patches
Plain Diff
Generation with classification and instantiation
parent
13282653
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
config/transduction-schemes.ttl
+158
-27
158 additions, 27 deletions
config/transduction-schemes.ttl
with
158 additions
and
27 deletions
config/transduction-schemes.ttl
+
158
−
27
View file @
6510dfcb
...
...
@@ -40,11 +40,14 @@ PREFIX fprm: <https://unsel.tetras-libre.fr/tenet/frame/parameters#>
# -- Add Disjunctive Entity classes in System Ontology
CONSTRUCT {
# Classification
?subEntity23Uri rdfs:subClassOf ?mainEntityUri.
?subEntity23Uri rdfs:label ?subEntity23.
?subEntity23Uri
owl:equivalentClass [ a owl:Class ;
owl:intersectionOf ( ?subEntity2Uri ?subEntity3Uri ) ] .
# Instantiation (extension)
?mainInstanceUri rdf:type ?subEntity23Uri.
}
WHERE {
# net1: entity class list
...
...
@@ -56,9 +59,12 @@ WHERE {
?net1 net:class1 ?mainEntity.
?net1 net:class2 ?subEntity2.
?net1 net:class2 ?subEntity3.
?net1 net:entityInstance ?mainInstance.
# extension: disjunction of UW
?uw2 unl:and ?uw3.
# Label(s) / URI
# --old --- FILTER NOT EXISTS { ?net2 net:class2 ?mainEntity }.
# --old --- FILTER NOT EXISTS { ?subEntity23Uri owl:equivalentClass ?c }.
# Label(s) / URI (for classes)
?uw2 rdfs:label ?uw2Label.
?uw3 rdfs:label ?uw3Label.
BIND (strbefore(?uw2Label, '(') AS ?concept2)
...
...
@@ -80,8 +86,9 @@ WHERE {
BIND (uri(?s3) AS ?subEntity2Uri).
BIND (uri(?s4) AS ?subEntity3Uri).
BIND (uri(?s5) AS ?subEntity23Uri).
# --old --- FILTER NOT EXISTS { ?net2 net:class2 ?mainEntity }.
# --old --- FILTER NOT EXISTS { ?subEntity23Uri owl:equivalentClass ?c }.
# Label(s) / URI (for instance)
BIND (concat(?s1, '_', ?mainInstance) AS ?s6).
BIND (uri(?s6) AS ?mainInstanceUri).
}"""
;
sh:
order
"204"
^^
xsd:
decimal
;
.
...
...
@@ -101,11 +108,14 @@ PREFIX fprm: <https://unsel.tetras-libre.fr/tenet/frame/parameters#>
# -- Add Disjunctive Entity classes in System Ontology
CONSTRUCT {
# Classification
?subEntity23Uri rdfs:subClassOf ?mainEntityUri.
?subEntity23Uri rdfs:label ?subEntity23.
?subEntity23Uri
owl:equivalentClass [ a owl:Class ;
owl:unionOf ( ?subEntity2Uri ?subEntity3Uri ) ] .
# Instantiation (extension)
?mainInstanceUri rdf:type ?subEntity23Uri.
}
WHERE {
# net1: entity class list
...
...
@@ -117,9 +127,12 @@ WHERE {
?net1 net:class1 ?mainEntity.
?net1 net:class2 ?subEntity2.
?net1 net:class2 ?subEntity3.
?net1 net:entityInstance ?mainInstance.
# extension: disjunction of UW
?uw2 unl:or ?uw3.
# Label(s) / URI
# --old --- FILTER NOT EXISTS { ?net2 net:class2 ?mainEntity }.
# --old --- FILTER NOT EXISTS { ?subEntity23Uri owl:equivalentClass ?c }.
# Label(s) / URI (for classes)
?uw2 rdfs:label ?uw2Label.
?uw3 rdfs:label ?uw3Label.
BIND (strbefore(?uw2Label, '(') AS ?concept2)
...
...
@@ -141,8 +154,9 @@ WHERE {
BIND (uri(?s3) AS ?subEntity2Uri).
BIND (uri(?s4) AS ?subEntity3Uri).
BIND (uri(?s5) AS ?subEntity23Uri).
# --old --- FILTER NOT EXISTS { ?net2 net:class2 ?mainEntity }.
# --old --- FILTER NOT EXISTS { ?subEntity23Uri owl:equivalentClass ?c }.
# Label(s) / URI (for instance)
BIND (concat(?s1, '_', ?mainInstance) AS ?s6).
BIND (uri(?s6) AS ?mainInstanceUri).
}"""
;
sh:
order
"203"
^^
xsd:
decimal
;
.
...
...
@@ -222,10 +236,14 @@ 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#>
# -- Add Entity classe
s
in System Ontology
# -- Add Entity class
/ instanc
e in System Ontology
CONSTRUCT {
# Classification
?mainEntityUri rdfs:subClassOf ?entityUri.
?mainEntityUri rdfs:label ?mainEntity.
# Instantiation
?mainInstanceUri a ?mainEntityUri.
?mainInstanceUri rdfs:label ?mainInstance.
}
WHERE {
# net1: entity
...
...
@@ -233,16 +251,20 @@ WHERE {
?net1 net:type net:entity.
?net1 net:entityClass ?entityClass.
?net1 net:concept ?mainEntity.
# Label(s) / URI
?net1 net:entityInstance ?mainInstance.
# Filter: entity not present in a class list
FILTER NOT EXISTS { ?net2 net:class2 ?mainEntity}
# Label(s) / URI (for classes)
cprm:Config_Parameters cprm:baseURI ?baseURI.
fprm:System_Ontology fprm:frameURI ?frameURI.
fprm:System_Entity rdfs:label ?entityLabel.
# -- old ---
fprm:System_Entity rdfs:label ?entityLabel.
BIND (concat( ?frameURI, ?entityClass) AS ?s1).
BIND (concat(?s1, '_', ?mainEntity) AS ?s2).
BIND (uri( ?s1) AS ?entityUri).
BIND (uri(?s2) AS ?mainEntityUri).
# Filter: entity not present in a class list
FILTER NOT EXISTS { ?net2 net:class2 ?mainEntity}
# Label(s) / URI (for instance)
BIND (concat(?s1, '_', ?mainInstance) AS ?s3).
BIND (uri(?s3) AS ?mainInstanceUri).
}"""
;
sh:
order
"201"
^^
xsd:
decimal
;
.
...
...
@@ -261,10 +283,13 @@ PREFIX fprm: <https://unsel.tetras-libre.fr/tenet/frame/parameters#>
# -- Add Entity classes in System Ontology
CONSTRUCT {
#
-- old --- ?mainEntityUri rdfs:subClassOf ?entityUri.
#
Classification
?subEntityUri rdfs:subClassOf ?mainEntityUri.
# -- old --- ?mainEntityUri rdfs:label ?mainEntity.
?subEntityUri rdfs:label ?subEntity.
# -- old --- ?mainEntityUri rdfs:subClassOf ?entityUri.
# -- old --- ?mainEntityUri rdfs:label ?mainEntity.
# Instantiation (extension)
?mainInstanceUri rdf:type ?subEntityUri.
}
WHERE {
# net1: entity class list
...
...
@@ -273,7 +298,9 @@ WHERE {
?net1 net:entityClass ?entityClass.
?net1 net:class1 ?mainEntity.
?net1 net:class2 ?subEntity.
# Label(s) / URI
?net1 net:entityInstance ?mainInstance.
# Filter -- old --- FILTER NOT EXISTS { ?net2 net:class2 ?mainEntity}
# Label(s) / URI (for classes)
# -- old --- BIND (concat(?concept2, '_', ?mainEntity) AS ?subEntity).
# -- old --- cprm:Config_Parameters cprm:baseURI ?baseURI.
fprm:System_Ontology fprm:frameURI ?frameURI.
...
...
@@ -284,8 +311,9 @@ WHERE {
# -- old --- BIND (uri( ?s1) AS ?entityUri).
BIND (uri(?s2) AS ?mainEntityUri).
BIND (uri(?s3) AS ?subEntityUri).
# Filter
# -- old --- FILTER NOT EXISTS { ?net2 net:class2 ?mainEntity}
# Label(s) / URI (for instance)
BIND (concat(?s1, '_', ?mainInstance) AS ?s4).
BIND (uri(?s4) AS ?mainInstanceUri).
}"""
;
sh:
order
"202"
^^
xsd:
decimal
;
.
...
...
@@ -313,6 +341,20 @@ WHERE {
} """
;
sh:
order
"001"
^^
xsd:
decimal
;
.
cts:
classification
rdf:
type
owl:
Class
;
rdf:
type
sh:
NodeShape
;
rdfs:
label
"generation"
;
rdfs:
subClassOf
cts:
generation
;
sh:
rule
cts:
add-conjunctive-entity-classes
;
sh:
rule
cts:
add-disjunctive-entity-classes
;
sh:
rule
cts:
add-entity-classes
;
sh:
rule
cts:
add-list-of-entity-classes
;
.
cts:
classification_1
rdf:
type
cts:
classification
;
rdfs:
label
"classification 1"
;
.
cts:
compose-entity-modlist-1
rdf:
type
sh:
SPARQLRule
;
sh:
construct
"""PREFIX owl: <http://www.w3.org/2002/07/owl#>
...
...
@@ -339,6 +381,7 @@ CONSTRUCT {
?newNet net:class1 ?mainEntity.
?newNet net:class2 ?subEntity2.
?newNet net:class2 ?subEntity3.
?newNet net:entityInstance ?instanceName.
}
WHERE {
# net1: entity
...
...
@@ -348,6 +391,7 @@ WHERE {
?net1 net:node ?uw1.
?net1 net:entityClass ?entityClass.
?net1 net:concept ?mainEntity.
?net1 net:entityInstance ?instanceName.
# net2: complement modList
?net2 a net:Instance.
?net2 net:type net:complement_mod_list.
...
...
@@ -408,6 +452,7 @@ CONSTRUCT {
?newNet net:class1 ?mainEntity.
?newNet net:class2 ?subEntity2.
?newNet net:class2 ?subEntity3.
?newNet net:entityInstance ?instanceName.
}
WHERE {
# net1: agent
...
...
@@ -417,6 +462,7 @@ WHERE {
?net1 net:node ?uw1.
?net1 net:entityClass ?entityClass1.
?net1 net:concept ?mainEntity.
?net1 net:entityInstance ?instanceName.
# net2: entity modList
?net2 a net:Instance.
?net2 net:type net:entity_mod_list.
...
...
@@ -480,6 +526,7 @@ CONSTRUCT {
?newNet net:class1 ?mainEntity.
?newNet net:class2 ?subEntity2.
?newNet net:class2 ?subEntity3.
?newNet net:entityInstance ?instanceName.
}
WHERE {
# net1: agent
...
...
@@ -489,6 +536,7 @@ WHERE {
?net1 net:node ?uw1.
?net1 net:entityClass ?entityClass1.
?net1 net:concept ?mainEntity.
?net1 net:entityInstance ?instanceName.
# net2: entity modList
?net2 a net:Instance.
?net2 net:type net:entity_mod_list.
...
...
@@ -591,6 +639,49 @@ cts:entity_extraction_1
rdf:
type
cts:
entity_extraction
;
rdfs:
label
"entity extraction 1"
;
.
cts:
extend-instantiation-to-subclasses
rdf:
type
sh:
SPARQLRule
;
rdfs:
label
"Extend Instantiatiation to Entity SubClasses"
;
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#>
# -- Add Entity classes in System Ontology
CONSTRUCT {
?mainInstanceUri a ?mainEntityUri.
?mainInstanceUri a ?subEntityUri.
?mainInstanceUri rdfs:label ?mainInstance.
}
WHERE {
# net1: entity class list
?net1 a net:Instance.
?net1 net:type net:entity_class_list.
?net1 net:entityClass ?entityClass.
?net1 net:class1 ?mainEntity.
?net1 net:class2 ?subEntity.
?net1 net:entityInstance ?mainInstance.
# Label(s) / URI
cprm:Config_Parameters cprm:baseURI ?baseURI.
fprm:System_Ontology fprm:frameURI ?frameURI.
fprm:System_Entity rdfs:label ?entityLabel.
BIND (concat( ?frameURI, ?entityClass) AS ?s1).
BIND (concat(?s1, '_', ?mainEntity) AS ?s2).
BIND (concat(?s1, '_', ?subEntity) AS ?s3).
BIND (concat(?s1, '_', ?mainInstance) AS ?s4).
BIND (uri( ?s1) AS ?entityUri).
BIND (uri(?s2) AS ?mainEntityUri).
BIND (uri(?s3) AS ?subEntityUri).
BIND (uri(?s4) AS ?mainInstanceUri).
}"""
;
sh:
order
"302"
^^
xsd:
decimal
;
.
cts:
extend-list-of-entity-classes--old
rdf:
type
sh:
SPARQLRule
;
sh:
construct
"""PREFIX owl: <http://www.w3.org/2002/07/owl#>
...
...
@@ -681,14 +772,6 @@ cts:generation
rdf:
type
sh:
NodeShape
;
rdfs:
label
"generation"
;
rdfs:
subClassOf
cts:
Transduction_Schemes
;
sh:
rule
cts:
add-conjunctive-entity-classes
;
sh:
rule
cts:
add-disjunctive-entity-classes
;
sh:
rule
cts:
add-entity-classes
;
sh:
rule
cts:
add-list-of-entity-classes
;
.
cts:
generation_1
rdf:
type
cts:
generation
;
rdfs:
label
"generation 1"
;
.
cts:
init-mod-list
rdf:
type
sh:
SPARQLRule
;
...
...
@@ -731,6 +814,47 @@ WHERE {
}"""
;
sh:
order
"111"
^^
xsd:
decimal
;
.
cts:
instantiate-entity-classes
rdf:
type
sh:
SPARQLRule
;
rdfs:
label
"Instantiate Entity Classes"
;
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#>
# -- Add Entity classes in System Ontology
CONSTRUCT {
?mainInstanceUri a ?mainEntityUri.
?mainInstanceUri rdfs:label ?mainInstance.
}
WHERE {
# net1: entity
?net1 a net:Instance.
?net1 net:type net:entity.
?net1 net:entityClass ?entityClass.
?net1 net:concept ?mainEntity.
?net1 net:entityInstance ?mainInstance.
# Label(s) / URI
cprm:Config_Parameters cprm:baseURI ?baseURI.
fprm:System_Ontology fprm:frameURI ?frameURI.
fprm:System_Entity rdfs:label ?entityLabel.
BIND (concat( ?frameURI, ?entityClass) AS ?s1).
BIND (concat(?s1, '_', ?mainEntity) AS ?s2).
BIND (concat(?s1, '_', ?mainInstance) AS ?s3).
BIND (uri( ?s1) AS ?entityUri).
BIND (uri(?s2) AS ?mainEntityUri).
BIND (uri(?s3) AS ?mainInstanceUri).
# Filter: entity not present in a class list
FILTER NOT EXISTS { ?net2 net:class2 ?mainEntity}
}"""
;
sh:
order
"301"
^^
xsd:
decimal
;
.
cts:
instantiate-entity-net
rdf:
type
sh:
SPARQLRule
;
sh:
construct
"""PREFIX owl: <http://www.w3.org/2002/07/owl#>
...
...
@@ -764,11 +888,18 @@ WHERE {
# -- old ---- ?uw1 unl:is_substructure_of ?req.
# -- old ---- ?uw1 unl:is_occurrence_of ?lexTrg.
# Label(s) / URI
BIND (concat( ?entityClass1, '_', ?concept1) AS ?s1).
BIND (concat(?s1, '_instance') AS ?instanceName).
BIND (concat(?concept1, '_instance') AS ?instanceName).
}"""
;
sh:
order
"102"
^^
xsd:
decimal
;
.
cts:
instantiation
rdf:
type
owl:
Class
;
rdf:
type
sh:
NodeShape
;
rdfs:
label
"instantiation"
;
rdfs:
subClassOf
cts:
generation
;
sh:
rule
cts:
extend-instantiation-to-subclasses
;
sh:
rule
cts:
instantiate-entity-classes
;
.
cts:
link-to-scope-entry
rdf:
type
sh:
SPARQLRule
;
sh:
construct
"""PREFIX owl: <http://www.w3.org/2002/07/owl#>
...
...
This diff is collapsed.
Click to expand it.
Aurélien Lamercerie
@alam
mentioned in issue
#3 (closed)
·
3 years ago
mentioned in issue
#3 (closed)
mentioned in issue #3
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