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
44a637f1
Commit
44a637f1
authored
3 years ago
by
Aurélien Lamercerie
Browse files
Options
Downloads
Patches
Plain Diff
Add Transduction Schemes (RDF File)
parent
104fd718
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
README.md
+1
-1
1 addition, 1 deletion
README.md
config/transduction-schemes.ttl
+603
-0
603 additions, 0 deletions
config/transduction-schemes.ttl
with
605 additions
and
1 deletion
.gitignore
+
1
−
0
View file @
44a637f1
...
...
@@ -3,3 +3,4 @@ __pycache__
*.todo
devtemp*.py
corpus/CCTP-SRSA-IP*
.project
This diff is collapsed.
Click to expand it.
README.md
+
1
−
1
View file @
44a637f1
...
...
@@ -74,7 +74,7 @@ Following commands are proposed to execute the different steps of the process:
-
**select**
: command to select a corpus.
-
**load**
: command to load the UNL sentences of a given corpus.
-
**extract
ion
**
: command to extract terminologies data from UNL-RDF graph.
-
**extract**
: command to extract terminologies data from UNL-RDF graph.
-
**reason**
: command to reason on terminology.
-
**clean**
: command to clean the working directories.
...
...
This diff is collapsed.
Click to expand it.
config/transduction-schemes.ttl
0 → 100644
+
603
−
0
View file @
44a637f1
# baseURI: https://unsel.tetras-libre.fr/tenet/transduction-schemes
# imports: http://datashapes.org/dash
# imports: https://unl.tetras-libre.fr/rdf/schema
# imports: https://unsel.tetras-libre.fr/tenet/config/parameters
# imports: https://unsel.tetras-libre.fr/tenet/frame/parameters
# imports: https://unsel.tetras-libre.fr/tenet/frame/requirement-ontology
# imports: https://unsel.tetras-libre.fr/tenet/frame/system-ontology
# imports: https://unsel.tetras-libre.fr/tenet/semantic-net
# prefix: cts
@prefix
cts:
<https://unsel.tetras-libre.fr/tenet/transduction-schemes#>
.
@prefix
dash:
<http://datashapes.org/dash#>
.
@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
sh:
<http://www.w3.org/ns/shacl#>
.
@prefix
unl:
<https://unl.tetras-libre.fr/rdf/schema#>
.
@prefix
xsd:
<http://www.w3.org/2001/XMLSchema#>
.
sh:
SPARQLRule
rdfs:
subClassOf
owl:
Thing
;
.
<https://unsel.tetras-libre.fr/tenet/transduction-schemes>
rdf:
type
owl:
Ontology
;
owl:
imports
<http://datashapes.org/dash>
;
owl:
imports
<https://unl.tetras-libre.fr/rdf/schema>
;
owl:
imports
<https://unsel.tetras-libre.fr/tenet/config/parameters>
;
owl:
imports
<https://unsel.tetras-libre.fr/tenet/frame/parameters>
;
owl:
imports
<https://unsel.tetras-libre.fr/tenet/frame/requirement-ontology>
;
owl:
imports
<https://unsel.tetras-libre.fr/tenet/frame/system-ontology>
;
owl:
imports
<https://unsel.tetras-libre.fr/tenet/semantic-net>
;
.
cts:
Transduction_Schemes
rdf:
type
owl:
Class
;
rdf:
type
sh:
NodeShape
;
rdfs:
label
"Transduction Schemes"
;
rdfs:
subClassOf
owl:
Thing
;
.
cts:
add-disjunctive-entity-classes
rdf:
type
sh:
SPARQLRule
;
rdfs:
label
"add-disjunctive-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 Disjunctive Entity classes in System Ontology
CONSTRUCT {
?subEntity23Uri rdfs:subClassOf ?mainEntityUri.
?subEntity23Uri rdfs:label ?subEntity23.
?subEntity23Uri
owl:equivalentClass [ a owl:Class ;
owl:unionOf ( ?subEntity2Uri ?subEntity3Uri ) ] .
}
WHERE {
# net1: entity class list
?net1 a net:Instance.
?net1 net:type net:entity_class_list.
?net1 net:entityClass ?entityClass.
?net1 net:node ?uw2.
?net1 net:node ?uw3.
?net1 net:class1 ?mainEntity.
# extension: disjunction of UW
?uw2 unl:or ?uw3.
# Label(s) / URI
?uw2 rdfs:label ?uw2Label.
?uw3 rdfs:label ?uw3Label.
BIND (strbefore(?uw2Label, '(') AS ?concept2)
BIND (strbefore(?uw3Label, '(') AS ?concept3)
BIND (concat(?concept2, '-or-', ?concept3) AS ?concept23)
BIND (concat(?concept2, '_', ?mainEntity) AS ?subEntity2).
BIND (concat(?concept3, '_', ?mainEntity) AS ?subEntity3).
BIND (concat(?concept23, '_', ?mainEntity) AS ?subEntity23).
cprm:Config_Parameters cprm:baseURI ?baseURI.
fprm:System_Ontology fprm:frameURI ?frameURI.
BIND (concat( ?frameURI, ?entityClass) AS ?s1).
BIND (concat(?s1, '_', ?mainEntity) AS ?s2).
BIND (concat(?s1, '_', ?subEntity2) AS ?s3).
BIND (concat(?s1, '_', ?subEntity3) AS ?s4).
BIND (concat(?s1, '_', ?subEntity23) AS ?s5).
BIND (uri(?s2) AS ?mainEntityUri).
BIND (uri(?s3) AS ?subEntity2Uri).
BIND (uri(?s4) AS ?subEntity3Uri).
BIND (uri(?s5) AS ?subEntity23Uri).
}"""
;
sh:
order
"203"
^^
xsd:
decimal
;
.
cts:
add-entity-classes
rdf:
type
sh:
SPARQLRule
;
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#>
# -- Query to add Entity classes in System Ontology
CONSTRUCT {
?mainEntityUri rdfs:subClassOf ?entityUri.
?subEntityUri rdfs:subClassOf ?mainEntityUri.
?mainEntityUri rdfs:label ?mainEntity.
?subEntityUri rdfs:label ?subEntity.
}
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.
# 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 (uri( ?s1) AS ?entityUri).
BIND (uri(?s2) AS ?mainEntityUri).
BIND (uri(?s3) AS ?subEntityUri).
FILTER NOT EXISTS { ?net2 net:class2 ?mainEntity}
}"""
;
sh:
order
"201"
^^
xsd:
decimal
;
.
cts:
bypass-reification
rdf:
type
sh:
SPARQLRule
;
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#>
# -- Request to extend UNL relation
CONSTRUCT {
?node1 ?unlRel ?node2.
}
WHERE {
?rel unl:has_source ?node1.
?rel unl:has_target ?node2.
?rel a ?unlRel.
} """
;
sh:
order
"001"
^^
xsd:
decimal
;
.
cts:
compose-entity-modlist-1
rdf:
type
sh:
SPARQLRule
;
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#>
# -- Compose an Entity net and a Complement ModList net
CONSTRUCT {
?newNet a net:Instance.
?newNet net:type net:entity_class_list.
?newNet net:node ?uw1.
?newNet net:node ?uw2.
?newNet net:node ?uw3.
?newNet net:entityClass ?entityClass.
?newNet net:featureClass ?featureClass.
?newNet net:class1 ?mainEntity.
?newNet net:class2 ?subEntity2.
?newNet net:class2 ?subEntity3.
}
WHERE {
# UW: type UW-Occurrence and substructure of req sentence
?uw1 rdf:type unl:UW_Occurrence.
?uw2 rdf:type unl:UW_Occurrence.
?uw3 rdf:type unl:UW_Occurrence.
?uw1 unl:is_substructure_of ?req.
?uw2 unl:is_substructure_of ?req.
?uw3 unl:is_substructure_of ?req.
# net1: entity
?net1 a net:Instance.
?net1 net:type net:entity.
?net1 net:node ?uw1.
?net1 net:entityClass ?entityClass.
?net1 net:concept ?mainEntity.
# net2: complement modList
?net2 a net:Instance.
?net2 net:type net:complement_mod_list.
?net2 net:node ?uw2.
?net2 net:node ?uw3.
?net2 net:featureClass ?featureClass.
?net2 net:concept ?subComplement.
# condition: mod(net1, net2)
?uw1 unl:mod ?uw2.
# Label(s) / URI
?uw2 rdfs:label ?uw2Label.
?uw3 rdfs:label ?uw3Label.
BIND (strbefore(?uw2Label, '(') AS ?concept2)
BIND (strbefore(?uw3Label, '(') AS ?concept3)
BIND (concat(?concept2, '_', ?mainEntity) AS ?subEntity2).
BIND (concat(?concept3, '_', ?mainEntity) AS ?subEntity3).
cprm:Config_Parameters cprm:netURI ?netURI.
net:class_list rdfs:label ?classListLabel.
BIND (concat( ?netURI, ?classListLabel, '_') AS ?s1).
BIND (concat(?s1, ?mainEntity, '-', ?concept2) AS ?s2).
BIND (uri(?s2) AS ?newNet).
# Filter
FILTER ( ?uw1 != ?uw3 ).
}"""
;
sh:
order
"106"
^^
xsd:
decimal
;
.
cts:
compose-entity-modlist-2
rdf:
type
sh:
SPARQLRule
;
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#>
# -- Compose an Entity net and an Entity ModList net
CONSTRUCT {
?newNet a net:Instance.
?newNet net:type net:entity_class_list.
?newNet net:node ?uw1.
?newNet net:node ?uw2.
?newNet net:node ?uw3.
?newNet net:entityClass ?entityClass1.
?newNet net:class1 ?mainEntity.
?newNet net:class2 ?subEntity2.
?newNet net:class2 ?subEntity3.
}
WHERE {
# UW: type UW-Occurrence and substructure of req sentence
?uw1 rdf:type unl:UW_Occurrence.
?uw2 rdf:type unl:UW_Occurrence.
?uw3 rdf:type unl:UW_Occurrence.
?uw1 unl:is_substructure_of ?req.
?uw2 unl:is_substructure_of ?req.
?uw3 unl:is_substructure_of ?req.
# net1: agent
?net1 a net:Instance.
?net1 net:type net:entity.
?net1 net:node ?uw1.
?net1 net:entityClass ?entityClass1.
?net1 net:concept ?mainEntity.
# net2: complement modList
?net2 a net:Instance.
?net2 net:type net:entity_mod_list.
?net2 net:node ?uw2.
?net2 net:node ?uw3.
?net2 net:entityClass ?entityClass2.
# condition: mod(net1, net2)
?uw1 unl:mod ?uw2.
# Label(s) / URI
?uw2 rdfs:label ?uw2Label.
?uw3 rdfs:label ?uw3Label.
BIND (strbefore(?uw2Label, '(') AS ?concept2)
BIND (strbefore(?uw3Label, '(') AS ?concept3)
BIND (concat(?concept2, '_', ?mainEntity) AS ?subEntity2).
BIND (concat(?concept3, '_', ?mainEntity) AS ?subEntity3).
cprm:Config_Parameters cprm:netURI ?netURI.
net:class_list rdfs:label ?classListLabel.
BIND (concat( ?netURI, ?classListLabel, '_') AS ?s1).
BIND (concat(?s1, ?mainEntity, '-', ?concept2) AS ?s2).
BIND (uri(?s2) AS ?newNet).
# Filter
FILTER ( ?uw1 != ?uw3 ).
}"""
;
sh:
order
"107"
^^
xsd:
decimal
;
.
cts:
create-entity-net
rdf:
type
sh:
SPARQLRule
;
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#>
# -- Query to create Entity net
CONSTRUCT {
?semNet a net:Instance.
?semNet net:type net:entity.
?semNet net:node ?uw1.
?semNet net:entityClass ?entityClass.
?semNet net:concept ?concept1.
}
WHERE {
# Entity (from System Ontology)
?entity rdf:type fprm:System_Entity.
?entity fprm:class ?entityClass.
?entity fprm:restriction ?entityRestriction.
# UW: type UW-Occurrence and substructure of req sentence
?uw1 rdf:type unl:UW_Occurrence.
?uw1 unl:is_substructure_of ?req.
# ------ ?uw1 unl:is_occurrence_of ?lexTrg.
# Label(s) / URI
?uw1 rdfs:label ?uw1Label.
cprm:Config_Parameters cprm:netURI ?netURI
BIND (strbefore(?uw1Label, '(') AS ?concept1).
BIND (concat( ?netURI, ?entityClass, '_') AS ?s1).
BIND (concat(?s1, ?concept1) AS ?s2).
BIND (uri(?s2) AS ?semNet).
# Filter
FILTER ( regex(str(?uw1Label),str(?entityRestriction)) ).
}"""
;
sh:
order
"101"
^^
xsd:
decimal
;
.
cts:
dev_schemes
rdf:
type
owl:
Class
;
rdf:
type
sh:
NodeShape
;
rdfs:
label
"dev schemes"
;
rdfs:
subClassOf
cts:
Transduction_Schemes
;
.
cts:
entity_extraction
rdf:
type
owl:
Class
;
rdf:
type
sh:
NodeShape
;
rdfs:
label
"entity extraction"
;
rdfs:
subClassOf
cts:
net_extension
;
sh:
rule
cts:
compose-entity-modlist-1
;
sh:
rule
cts:
compose-entity-modlist-2
;
sh:
rule
cts:
create-entity-net
;
sh:
rule
cts:
extend-mod-list
;
sh:
rule
cts:
init-mod-list
;
sh:
rule
cts:
typify-modlist-entity
;
sh:
rule
cts:
typify-modlist-feature
;
.
cts:
entity_extraction_1
rdf:
type
cts:
entity_extraction
;
rdfs:
label
"entity extraction 1"
;
.
cts:
extend-entity-classes
rdf:
type
sh:
SPARQLRule
;
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#>
# -- Query to complement Entity classes in System Ontology
CONSTRUCT {
?subEntityUri rdfs:subClassOf ?mainEntityUri.
?subEntityUri rdfs:label ?subEntity.
}
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.
# 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 (uri( ?s1) AS ?entityUri).
BIND (uri(?s2) AS ?mainEntityUri).
BIND (uri(?s3) AS ?subEntityUri).
}"""
;
sh:
order
"202"
^^
xsd:
decimal
;
.
cts:
extend-mod-list
rdf:
type
sh:
SPARQLRule
;
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#>
# -- Query to extend a ModList net
CONSTRUCT {
?semNet net:node ?uw2.
?semNet net:concept ?concept1.
?semNet net:concept ?concept2.
}
WHERE {
# UW: type UW-Occurrence and substructure of req sentence
?uw1 rdf:type unl:UW_Occurrence.
?uw2 rdf:type unl:UW_Occurrence.
?uw1 unl:is_substructure_of ?req.
?uw2 unl:is_substructure_of ?req.
# selection: modList net
?semNet a net:Instance.
?semNet net:type net:mod_list.
?semNet net:node ?uw1.
# extension: disjunction of UW
?uw1 (unl:or|unl:and) ?uw2.
# Label(s) / URI
?uw1 rdfs:label ?uw1Label.
?uw2 rdfs:label ?uw2Label.
BIND (strbefore(?uw1Label, '(') AS ?concept1)
BIND (strbefore(?uw2Label, '(') AS ?concept2)
}"""
;
sh:
order
"103"
^^
xsd:
decimal
;
.
cts:
generation
rdf:
type
owl:
Class
;
rdf:
type
sh:
NodeShape
;
rdfs:
label
"generation"
;
rdfs:
subClassOf
cts:
Transduction_Schemes
;
sh:
rule
cts:
add-disjunctive-entity-classes
;
sh:
rule
cts:
add-entity-classes
;
sh:
rule
cts:
extend-entity-classes
;
.
cts:
generation_1
rdf:
type
cts:
generation
;
rdfs:
label
"generation 1"
;
.
cts:
init-mod-list
rdf:
type
sh:
SPARQLRule
;
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#>
# -- Query to initialize a ModList net
CONSTRUCT {
?semNet a net:Instance.
?semNet net:type net:mod_list.
?semNet net:node ?uw1.
}
WHERE {
# UW: type UW-Occurrence and substructure of req sentence
?uwSource rdf:type unl:UW_Occurrence.
?uw1 rdf:type unl:UW_Occurrence.
?uwSource unl:is_substructure_of ?req.
?uw1 unl:is_substructure_of ?req.
# selection: target UW of modifier (mod)
?uwSource unl:mod ?uw1.
# Label(s) / URI
?uw1 rdfs:label ?uw1Label.
cprm:Config_Parameters cprm:netURI ?netURI.
net:mod_list rdfs:label ?modListLabel.
BIND (strbefore(?uw1Label, '(') AS ?concept1).
BIND (strbefore(?uw2Label, '(') AS ?concept2).
BIND (concat( ?netURI, ?modListLabel, '_') AS ?s1).
BIND (concat(?s1, ?concept1) AS ?s2).
BIND (uri(?s2) AS ?semNet).
}"""
;
sh:
order
"102"
^^
xsd:
decimal
;
.
cts:
link-to-scope-entry
rdf:
type
sh:
SPARQLRule
;
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#>
# -- Request to extend UNL relation to scopes
# (by connecting the source node of the scope to the entry node of the scope)
CONSTRUCT {
?node1Occ ?unlRel ?node2Occ.
}
WHERE {
?scope rdf:type unl:UNL_Scope.
?node1Occ unl:is_source_of ?rel.
?rel unl:has_target ?scope.
?scope unl:is_scope_of ?scopeRel.
?scopeRel unl:has_source ?node2Occ.
?node2Occ unl:has_attribute \".@entry\".
?rel a ?unlRel.
} """
;
sh:
order
"002"
^^
xsd:
decimal
;
.
cts:
net_extension
rdf:
type
owl:
Class
;
rdf:
type
sh:
NodeShape
;
rdfs:
label
"net extension"
;
rdfs:
subClassOf
cts:
Transduction_Schemes
;
.
cts:
preprocessing
rdf:
type
owl:
Class
;
rdf:
type
sh:
NodeShape
;
rdfs:
label
"preprocessing"
;
rdfs:
subClassOf
cts:
Transduction_Schemes
;
sh:
rule
cts:
bypass-reification
;
sh:
rule
cts:
link-to-scope-entry
;
.
cts:
preprocessing_1
rdf:
type
cts:
preprocessing
;
rdfs:
label
"preprocessing 1"
;
.
cts:
typify-modlist-entity
rdf:
type
sh:
SPARQLRule
;
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#>
# -- Typify a ModList net as Entity ModList
CONSTRUCT {
?semNet net:type net:entity_mod_list.
?semNet net:entityClass ?entityClass.
}
WHERE {
# Entity (from System Ontology)
?entity rdf:type fprm:System_Entity.
?entity fprm:class ?entityClass.
?entity fprm:restriction ?entityRestriction.
# UW: type UW-Occurrence and substructure of req sentence
?uw1 rdf:type unl:UW_Occurrence.
?uw1 unl:is_substructure_of ?req.
# net: modList
?semNet a net:Instance.
?semNet net:type net:mod_list.
?semNet net:node ?uw1.
# Label(s) / URI
?uw1 rdfs:label ?uw1Label.
# Filter
FILTER ( regex(str(?uw1Label),str(?entityRestriction)) ).
}"""
;
sh:
order
"104"
^^
xsd:
decimal
;
.
cts:
typify-modlist-feature
rdf:
type
sh:
SPARQLRule
;
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#>
# -- Typify a ModList net as Feature ModList
CONSTRUCT {
?semNet net:type net:complement_mod_list.
?semNet net:featureClass ?featureClass.
}
WHERE {
# Entity Feature (from System Ontology)
?entity rdf:type fprm:System_Feature.
?entity fprm:class ?featureClass.
?entity fprm:restriction ?featureRestriction.
# UW: type UW-Occurrence and substructure of req sentence
?uw1 rdf:type unl:UW_Occurrence.
?uw1 unl:is_substructure_of ?req.
# net: modList
?semNet a net:Instance.
?semNet net:type net:mod_list.
?semNet net:node ?uw1.
# Label(s) / URI
?uw1 rdfs:label ?uw1Label.
# Filter
FILTER ( regex(str(?uw1Label),str(?featureRestriction)) ).
}"""
;
sh:
order
"105"
^^
xsd:
decimal
;
.
This diff is collapsed.
Click to expand it.
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