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

CTS to extract Feature classes

parent e605febb
No related branches found
No related tags found
No related merge requests found
......@@ -90,7 +90,7 @@ WHERE {
BIND (concat(?s1, '_', ?mainInstance) AS ?s6).
BIND (uri(?s6) AS ?mainInstanceUri).
}""" ;
sh:order "204"^^xsd:decimal ;
sh:order "514"^^xsd:decimal ;
.
cts:add-disjunctive-entity-classes
rdf:type sh:SPARQLRule ;
......@@ -158,7 +158,7 @@ WHERE {
BIND (concat(?s1, '_', ?mainInstance) AS ?s6).
BIND (uri(?s6) AS ?mainInstanceUri).
}""" ;
sh:order "203"^^xsd:decimal ;
sh:order "513"^^xsd:decimal ;
.
cts:add-disjunctive-entity-classes-2--old
rdf:type sh:SPARQLRule ;
......@@ -266,7 +266,46 @@ WHERE {
BIND (concat(?s1, '_', ?mainInstance) AS ?s3).
BIND (uri(?s3) AS ?mainInstanceUri).
}""" ;
sh:order "201"^^xsd:decimal ;
sh:order "511"^^xsd:decimal ;
.
cts:add-feature-classes
rdf:type sh:SPARQLRule ;
rdfs:label "add-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 class / instance in System Ontology
CONSTRUCT {
# Classification
?mainFeatureUri rdfs:subClassOf ?featureUri.
?mainFeatureUri rdfs:label ?mainFeature.
# Instantiation: no instance for feature
}
WHERE {
# net1: entity
?net1 a net:Instance.
?net1 net:type net:feature.
?net1 net:featureClass ?featureClass.
?net1 net:concept ?mainFeature.
# Filter: entity not present in a class list
FILTER NOT EXISTS { ?net2 net:class2 ?mainFeature}
# Label(s) / URI (for classes)
cprm:Config_Parameters cprm:baseURI ?baseURI.
fprm:System_Ontology fprm:frameURI ?frameURI.
BIND (concat( ?frameURI, ?featureClass) AS ?s1).
BIND (concat(?s1, '_', ?mainFeature) AS ?s2).
BIND (uri( ?s1) AS ?featureUri).
BIND (uri(?s2) AS ?mainFeatureUri).
}""" ;
sh:order "501"^^xsd:decimal ;
.
cts:add-list-of-entity-classes
rdf:type sh:SPARQLRule ;
......@@ -315,7 +354,7 @@ WHERE {
BIND (concat(?s1, '_', ?mainInstance) AS ?s4).
BIND (uri(?s4) AS ?mainInstanceUri).
}""" ;
sh:order "202"^^xsd:decimal ;
sh:order "512"^^xsd:decimal ;
.
cts:bypass-reification
rdf:type sh:SPARQLRule ;
......@@ -411,7 +450,7 @@ WHERE {
BIND (concat(?s1, ?uw1Id, '-', ?uw2Id) AS ?s2).
BIND (uri(?s2) AS ?newNet).
}""" ;
sh:order "121"^^xsd:decimal ;
sh:order "221"^^xsd:decimal ;
.
cts:compose-entity-modlist-2
rdf:type sh:SPARQLRule ;
......@@ -486,7 +525,7 @@ WHERE {
BIND (concat(?s1, ?uw1Id, '-', ?uw2Id) AS ?s2).
BIND (uri(?s2) AS ?newNet).
}""" ;
sh:order "122"^^xsd:decimal ;
sh:order "222"^^xsd:decimal ;
.
cts:compose-entity-modlist-3
rdf:type sh:SPARQLRule ;
......@@ -558,7 +597,7 @@ WHERE {
BIND (concat(?s1, ?uw1Id, '-', ?uw2Id) AS ?s2).
BIND (uri(?s2) AS ?newNet).
}""" ;
sh:order "123"^^xsd:decimal ;
sh:order "223"^^xsd:decimal ;
.
cts:create-entity-net
rdf:type sh:SPARQLRule ;
......@@ -601,6 +640,50 @@ WHERE {
BIND (uri(?s2) AS ?semNet).
# Filter
FILTER ( regex(str(?uw1Label),str(?entityRestriction)) ).
}""" ;
sh:order "201"^^xsd:decimal ;
.
cts:create-feature-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#>
# -- Create Feature net
CONSTRUCT {
?semNet a net:Instance.
?semNet net:type net:feature.
?semNet net:structure ?req.
?semNet net:node ?uw1.
?semNet net:featureClass ?featureClass.
?semNet net:concept ?concept1.
}
WHERE {
# 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.
# ------ ?uw1 unl:is_occurrence_of ?lexTrg.
# Label(s) / URI
?uw1 rdfs:label ?uw1Label.
?uw1 unl:has_id ?uw1Id.
cprm:Config_Parameters cprm:netURI ?netURI
BIND (strbefore(?uw1Label, '(') AS ?concept1).
BIND (concat( ?netURI, ?featureClass, '_') AS ?s1).
BIND (concat(?s1, ?uw1Id) AS ?s2).
BIND (uri(?s2) AS ?semNet).
# Filter
FILTER ( regex(str(?uw1Label),str(?featureRestriction)) ).
}""" ;
sh:order "101"^^xsd:decimal ;
.
......@@ -787,7 +870,18 @@ WHERE {
BIND (strbefore(?uw1Label, '(') AS ?concept1)
BIND (strbefore(?uw2Label, '(') AS ?concept2)
}""" ;
sh:order "112"^^xsd:decimal ;
sh:order "212"^^xsd:decimal ;
.
cts:feature_extraction
rdf:type owl:Class ;
rdf:type sh:NodeShape ;
rdfs:label "feature extraction" ;
rdfs:subClassOf cts:net_extension ;
sh:rule cts:create-feature-net ;
.
cts:feature_extraction_1
rdf:type cts:feature_extraction ;
rdfs:label "feature extraction 1" ;
.
cts:generation
rdf:type owl:Class ;
......@@ -797,6 +891,7 @@ 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-feature-classes ;
sh:rule cts:add-list-of-entity-classes ;
.
cts:generation_1
......@@ -844,7 +939,7 @@ WHERE {
BIND (concat(?s1, ?uw1Id) AS ?s2).
BIND (uri(?s2) AS ?semNet).
}""" ;
sh:order "111"^^xsd:decimal ;
sh:order "211"^^xsd:decimal ;
.
cts:instantiate-classlist-by-extension-1
rdf:type sh:SPARQLRule ;
......@@ -880,7 +975,7 @@ WHERE {
# Filter
FILTER NOT EXISTS { ?net2 net:entityInstance ?instanceName2 } .
}""" ;
sh:order "124"^^xsd:decimal ;
sh:order "224"^^xsd:decimal ;
.
cts:instantiate-classlist-by-extension-2
rdf:type sh:SPARQLRule ;
......@@ -916,7 +1011,7 @@ WHERE {
# Filter
FILTER NOT EXISTS { ?net2 net:entityInstance ?instanceName2 } .
}""" ;
sh:order "125"^^xsd:decimal ;
sh:order "225"^^xsd:decimal ;
.
cts:instantiate-entity-classes--old
rdf:type sh:SPARQLRule ;
......@@ -995,7 +1090,7 @@ WHERE {
?uw1 unl:has_id ?uw1Id.
BIND (?uw1Id AS ?instanceName).
}""" ;
sh:order "102"^^xsd:decimal ;
sh:order "202"^^xsd:decimal ;
.
cts:link-to-scope-entry
rdf:type sh:SPARQLRule ;
......@@ -1040,6 +1135,12 @@ cts:preprocessing
sh:rule cts:bypass-reification ;
sh:rule cts:link-to-scope-entry ;
.
cts:property_extraction
rdf:type owl:Class ;
rdf:type sh:NodeShape ;
rdfs:label "property extraction" ;
rdfs:subClassOf cts:net_extension ;
.
cts:typify-modlist-entity
rdf:type sh:SPARQLRule ;
sh:construct """PREFIX owl: <http://www.w3.org/2002/07/owl#>
......@@ -1076,7 +1177,7 @@ WHERE {
# Filter
FILTER ( regex(str(?uw1Label),str(?entityRestriction)) ).
}""" ;
sh:order "113"^^xsd:decimal ;
sh:order "213"^^xsd:decimal ;
.
cts:typify-modlist-feature
rdf:type sh:SPARQLRule ;
......@@ -1114,5 +1215,5 @@ WHERE {
# Filter
FILTER ( regex(str(?uw1Label),str(?featureRestriction)) ).
}""" ;
sh:order "114"^^xsd:decimal ;
sh:order "214"^^xsd:decimal ;
.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment