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

Generic CTS to create mod list nets

parent 002d116f
Branches
Tags
No related merge requests found
......@@ -30,11 +30,6 @@ net:Type
rdfs:label "Semantic Net Type" ;
rdfs:subClassOf net:Structure ;
.
net:abstraction
rdf:type owl:Class ;
rdfs:label "abstraction" ;
rdfs:subClassOf net:Type ;
.
net:abstractionClass
rdf:type rdf:Property ;
rdfs:label "abstraction class" ;
......@@ -48,7 +43,7 @@ net:atom
net:atomOf
rdf:type rdf:Property ;
rdfs:label "atom of" ;
rdfs:subPropertyOf net:type ;
rdfs:subPropertyOf net:typeProperty ;
.
net:atomType
rdf:type rdf:Property ;
......@@ -70,20 +65,20 @@ net:class_list
rdfs:label "classList" ;
rdfs:subClassOf net:Type ;
.
net:complement
net:composite
rdf:type owl:Class ;
rdfs:label "complement" ;
rdfs:label "composite" ;
rdfs:subClassOf net:Type ;
.
net:complement_mod_list
net:conjunctive_list
rdf:type owl:Class ;
rdfs:label "complement mod list" ;
rdfs:subClassOf net:mod_list ;
rdfs:label "conjunctive-list" ;
rdfs:subClassOf net:list ;
.
net:entity
net:disjunctive_list
rdf:type owl:Class ;
rdfs:label "entity" ;
rdfs:subClassOf net:Type ;
rdfs:label "disjunctive-list" ;
rdfs:subClassOf net:list ;
.
net:entityClass
rdf:type rdf:Property ;
......@@ -95,21 +90,11 @@ net:entity_class_list
rdfs:label "entityClassList" ;
rdfs:subClassOf net:class_list ;
.
net:entity_mod_list
rdf:type owl:Class ;
rdfs:label "entity mod list" ;
rdfs:subClassOf net:mod_list ;
.
net:event
rdf:type owl:Class ;
rdfs:label "event" ;
rdfs:subClassOf net:Type ;
.
net:feature
rdf:type owl:Class ;
rdfs:label "feature" ;
rdfs:subClassOf net:Type ;
.
net:featureClass
rdf:type rdf:Property ;
rdfs:label "feature class" ;
......@@ -118,7 +103,7 @@ net:featureClass
net:has_actor
rdf:type rdf:Property ;
rdfs:label "has actor" ;
rdfs:subPropertyOf net:has_object ;
rdfs:subPropertyOf net:has_atom ;
.
net:has_atom
rdf:type rdf:Property ;
......@@ -158,12 +143,12 @@ net:has_mother_class
net:has_node
rdf:type rdf:Property ;
rdfs:label "UNL Node" ;
rdfs:subPropertyOf net:property ;
rdfs:subPropertyOf net:netProperty ;
.
net:has_object
rdf:type rdf:Property ;
rdfs:label "relation" ;
rdfs:subPropertyOf net:property ;
rdfs:subPropertyOf net:netProperty ;
.
net:has_parent_class
rdf:type rdf:Property ;
......@@ -183,7 +168,7 @@ net:has_possible_range
net:has_structure
rdf:type rdf:Property ;
rdfs:label "Linguistic Structure (in UNL Document)" ;
rdfs:subPropertyOf net:property ;
rdfs:subPropertyOf net:netProperty ;
.
net:has_subClass
rdf:type rdf:Property ;
......@@ -193,23 +178,38 @@ net:has_subClass
net:has_target
rdf:type rdf:Property ;
rdfs:label "has target" ;
rdfs:subPropertyOf net:has_object ;
rdfs:subPropertyOf net:has_atom ;
.
net:has_verb
rdf:type rdf:Property ;
rdfs:label "has verb" ;
rdfs:subPropertyOf net:has_object ;
rdfs:subPropertyOf net:has_atom ;
.
net:instanceUri
rdf:type rdf:Property ;
rdfs:label "instance uri" ;
rdfs:subPropertyOf net:objectValue ;
.
net:list
rdf:type owl:Class ;
rdfs:label "list" ;
rdfs:subClassOf net:Type ;
.
net:listBy
rdf:type rdf:Property ;
rdfs:label "list by" ;
rdfs:subPropertyOf net:typeProperty ;
.
net:listGuiding
rdf:type rdf:Property ;
rdfs:label "Guiding connector of a list (or, and)" ;
rdfs:subPropertyOf net:objectValue ;
.
net:listOf
rdf:type rdf:Property ;
rdfs:label "list of" ;
rdfs:subPropertyOf net:typeProperty ;
.
net:modCat1
rdf:type rdf:Property ;
rdfs:label "Modality Category (level 1)" ;
......@@ -220,34 +220,29 @@ net:modCat2
rdfs:label "Modality Category (level 2)" ;
rdfs:subPropertyOf net:objectValue ;
.
net:mod_list
rdf:type owl:Class ;
rdfs:label "modList" ;
rdfs:subClassOf net:Type ;
net:netProperty
rdf:type rdf:Property ;
rdfs:label "netProperty" ;
.
net:objectAttribute
net:objectProperty
rdf:type rdf:Property ;
rdfs:label "object attribute" ;
.
net:objectType
rdf:type rdf:Property ;
rdfs:label "object type" ;
rdfs:subPropertyOf net:objectAttribute ;
rdfs:subPropertyOf net:objectProperty ;
.
net:objectValue
rdf:type rdf:Property ;
rdfs:label "valuations"@fr ;
rdfs:subPropertyOf net:objectAttribute ;
rdfs:subPropertyOf net:objectProperty ;
.
net:parentClassUri
rdf:type rdf:Property ;
rdfs:label "parent class uri" ;
rdfs:subPropertyOf net:objectValue ;
.
net:property
rdf:type rdf:Property ;
rdfs:label "netProperty" ;
.
net:state_property
rdf:type owl:Class ;
rdfs:label "stateProperty" ;
......@@ -256,12 +251,16 @@ net:state_property
net:type
rdf:type rdf:Property ;
rdfs:label "type "@fr ;
rdfs:subPropertyOf net:property ;
rdfs:subPropertyOf net:netProperty ;
.
net:verb
net:typeProperty
rdf:type rdf:Property ;
rdfs:label "type property" ;
.
net:unary_list
rdf:type owl:Class ;
rdfs:label "verb" ;
rdfs:subClassOf net:Type ;
rdfs:label "unary-list" ;
rdfs:subClassOf net:list ;
.
net:verbClass
rdf:type rdf:Property ;
......
......@@ -388,25 +388,26 @@ cts:batch_execution
sh:rule cts:complement-list-of-entity-classes ;
sh:rule cts:compose-agt-verb-obj-as-simple-event ;
sh:rule cts:compose-aoj-verb-obj-as-simple-state-property ;
sh:rule cts:compose-entity-modlist-1 ;
sh:rule cts:compose-entity-modlist-2 ;
sh:rule cts:compose-entity-modlist-3 ;
sh:rule cts:compose-atom-with-list-1 ;
sh:rule cts:compose-atom-with-list-2 ;
sh:rule cts:compute-class-uri-of-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-net-object ;
sh:rule cts:create-atom-net ;
sh:rule cts:create-unary-list-net ;
sh:rule cts:define-uw-id ;
sh:rule cts:extend-mod-list ;
sh:rule cts:extend-list-net ;
sh:rule cts:generate-atom-class ;
sh:rule cts:generate-atom-instance ;
sh:rule cts:init-mod-list ;
sh:rule cts:init-conjunctive-list-net ;
sh:rule cts:init-disjunctive-list-net ;
sh:rule cts:instantiate-atom-net ;
sh:rule cts:instantiate-classlist-by-extension-1 ;
sh:rule cts:instantiate-classlist-by-extension-2 ;
sh:rule cts:link-to-scope-entry ;
sh:rule cts:typify-modlist-entity ;
sh:rule cts:typify-modlist-feature ;
sh:rule cts:specify-axis-of-list-net ;
sh:rule cts:specify-items-of-list-net ;
.
cts:batch_execution_1
rdf:type cts:batch_execution ;
......@@ -550,7 +551,7 @@ WHERE {
BIND (concat(?n1, ?uw1Id, '-', ?uw2Id, '-', ?uw3Id) AS ?n2).
BIND (uri(?n2) AS ?newNet).
}""" ;
sh:order 2.9 ;
sh:order 2.41 ;
.
cts:compose-aoj-verb-obj-as-simple-state-property
rdf:type sh:SPARQLRule ;
......@@ -622,9 +623,9 @@ WHERE {
BIND (concat(?n1, ?uw1Id, '-', ?uw2Id, '-', ?uw3Id) AS ?n2).
BIND (uri(?n2) AS ?newNet).
}""" ;
sh:order 2.9 ;
sh:order 2.41 ;
.
cts:compose-entity-modlist-1
cts:compose-atom-with-list-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#>
......@@ -637,136 +638,25 @@ 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
# -- Compose an atom net and a list net (with distinct item classes)
CONSTRUCT {
# Object: feature 2
?newFeature2 a net:Object.
?newFeature2 net:objectType \"Feature\".
?newFeature2 net:has_node ?uw2.
?newFeature2 net:has_parent_class ?featureClass.
?newFeature2 net:has_parent_class ?listItemClass.
?newFeature2 net:has_concept ?concept2.
# Object: feature 3
?newFeature3 a net:Object.
?newFeature3 net:objectType \"Feature\".
?newFeature3 net:has_node ?uw3.
?newFeature3 net:has_parent_class ?featureClass.
?newFeature3 net:has_parent_class ?listItemClass.
?newFeature3 net:has_concept ?concept3.
# Object: entity 2
?newEntity2 a net:Object.
?newEntity2 net:objectType \"Entity\".
?newEntity2 net:has_node ?uw2.
?newEntity2 net:has_parent_class ?entityClass.
?newEntity2 net:has_concept ?subEntity2.
?newEntity2 net:has_feature ?newFeature2.
# Object: entity 3
?newEntity3 a net:Object.
?newEntity3 net:objectType \"Entity\".
?newEntity3 net:has_node ?uw3.
?newEntity3 net:has_parent_class ?entityClass.
?newEntity3 net:has_concept ?subEntity3.
?newEntity3 net:has_feature ?newFeature3.
# Net: Entity ClassList
?newNet a net:Instance.
?newNet net:type net:entity_class_list.
?newNet net:has_structure ?req.
?newNet net:has_node ?uw1, ?uw2, ?uw3.
?newNet net:entityClass ?entityClass.
?newNet net:has_mainClass ?atomObject1.
?newNet net:has_subClass ?newEntity2, ?newEntity3.
?newNet net:has_feature ?newFeature2, ?newFeature3.
}
WHERE {
# net1: entity
?net1 a net:Instance.
?net1 net:type net:atom.
?net1 net:atomOf sys:Entity.
?net1 net:has_structure ?req.
?net1 net:has_node ?uw1.
?net1 net:has_atom ?atomObject1.
?atomObject1 net:has_parent_class ?entityClass.
?atomObject1 net:has_concept ?mainEntity.
# condition: mod(net1, net2)
?uw1 unl:mod ?uw2.
# net2: complement modList
?net2 a net:Instance.
?net2 net:type net:complement_mod_list.
?net2 net:has_structure ?req.
?net2 net:has_node ?uw2, ?uw3.
?net2 net:modCat2 ?featureClass.
# --old --- ?net2 net:concept ?subConcept.
# Filter
FILTER ( ?uw1 != ?uw3 ).
# UW: type UW-Occurrence and substructure of req sentence
# --old --- ?uw1 rdf:type unl:UW_Occurrence.
# --old --- ?uw2 rdf:type unl:UW_Occurrence.
# --old --- ?uw3 rdf:type unl:UW_Occurrence.
# --old --- ?uw1 unl:is_substructure_of ?req.
# --old --- ?uw2 unl:is_substructure_of ?req.
# --old --- ?uw3 unl:is_substructure_of ?req.
# Label: Id, concept, subEntity
?uw1 unl:has_id ?uw1Id.
?uw2 unl:has_id ?uw2Id.
?uw3 unl:has_id ?uw3Id.
?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).
# URI (for Feature Object)
cprm:Config_Parameters cprm:netURI ?netURI.
cprm:Config_Parameters cprm:objectRef ?objectRef.
BIND (concat( ?netURI, ?objectRef) AS ?o1).
BIND (concat(?o1, ?uw2Id) AS ?f2).
BIND (concat(?o1, ?uw3Id) AS ?f3).
BIND (uri(?f2) AS ?newFeature2).
BIND (uri(?f3) AS ?newFeature3).
# URI (for Entity Object)
BIND (concat(?f2, '_', ?subEntity2) AS ?e2).
BIND (concat(?f3, '_', ?subEntity3) AS ?e3).
BIND (uri(?e2) AS ?newEntity2).
BIND (uri(?e3) AS ?newEntity3).
# URI (for ClassList Net)
cprm:Config_Parameters cprm:netURI ?netURI.
net:class_list rdfs:label ?classListLabel.
BIND (concat( ?netURI, ?classListLabel, '_') AS ?n1).
BIND (concat(?n1, ?uw1Id, '-', ?uw2Id) AS ?n2).
BIND (uri(?n2) AS ?newNet).
}""" ;
sh:order 2.6 ;
.
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 (with distinct entity classes)
CONSTRUCT {
# Object: feature 2
?newFeature2 a net:Object.
?newFeature2 net:objectType \"Feature\".
?newFeature2 net:has_node ?uw2.
?newFeature2 net:has_parent_class ?entityClass2.
?newFeature2 net:has_concept ?concept2.
# Object: feature 3
?newFeature3 a net:Object.
?newFeature3 net:objectType \"Feature\".
?newFeature3 net:has_node ?uw3.
?newFeature3 net:has_parent_class ?entityClass2.
?newFeature3 net:has_concept ?concept3.
# Object: entity 2
?newEntity2 a net:Object.
?newEntity2 net:objectType \"Entity\".
?newEntity2 net:has_node ?uw2.
?newEntity2 net:has_parent_class ?entityClass2.
?newEntity2 net:has_parent_class ?listItemClass.
?newEntity2 net:has_concept ?subEntity2.
?newEntity2 net:has_feature ?newFeature2.
# Object: entity 3
......@@ -781,7 +671,7 @@ CONSTRUCT {
?newNet net:type net:entity_class_list.
?newNet net:has_structure ?req.
?newNet net:has_node ?uw1, ?uw2, ?uw3.
?newNet net:entityClass ?entityClass1.
?newNet net:entityClass ?atomParentClass.
?newNet net:has_mainClass ?atomObject1.
?newNet net:has_subClass ?newEntity2, ?newEntity3.
?newNet net:has_feature ?newFeature2, ?newFeature3.
......@@ -794,27 +684,19 @@ WHERE {
?net1 net:has_structure ?req.
?net1 net:has_node ?uw1.
?net1 net:has_atom ?atomObject1.
?atomObject1 net:has_parent_class ?entityClass1.
?atomObject1 net:has_parent_class ?atomParentClass.
?atomObject1 net:has_concept ?mainEntity.
# condition: mod(net1, net2)
?uw1 unl:mod ?uw2.
# net2: entity modList
?net2 a net:Instance.
?net2 net:type net:entity_mod_list.
?net2 net:modCat1 fprm:System_Entity.
?net2 net:modCat2 ?entityClass2.
?net2 net:type net:list.
?net2 net:listOf ?listItemClass.
?net2 net:has_structure ?req.
?net2 net:has_node ?uw2, ?uw3.
# Filter
FILTER ( ?uw1 != ?uw3 ).
FILTER ( ?entityClass1 != ?entityClass2 ).
# UW: type UW-Occurrence and substructure of req sentence
# --old --- ?uw1 rdf:type unl:UW_Occurrence.
# --old --- ?uw2 rdf:type unl:UW_Occurrence.
# --old --- ?uw3 rdf:type unl:UW_Occurrence.
# --old --- ?uw1 unl:is_substructure_of ?req.
# --old --- ?uw2 unl:is_substructure_of ?req.
# --old --- ?uw3 unl:is_substructure_of ?req.
FILTER ( ?atomParentClass != ?listItemClass ).
# Label: Id, concept, subEntity
?uw1 unl:has_id ?uw1Id.
?uw2 unl:has_id ?uw2Id.
......@@ -845,9 +727,9 @@ WHERE {
BIND (concat(?n1, ?uw1Id, '-', ?uw2Id) AS ?n2).
BIND (uri(?n2) AS ?newNet).
}""" ;
sh:order 2.6 ;
sh:order 2.32 ;
.
cts:compose-entity-modlist-3
cts:compose-atom-with-list-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#>
......@@ -860,58 +742,50 @@ 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 (with same entity classes)
# -- Compose an atom net and an list net (with same item classes)
CONSTRUCT {
# Object: entity 2
?newEntity2 a net:Object.
?newEntity2 net:objectType \"Entity\".
?newEntity2 net:has_node ?uw2.
?newEntity2 net:has_parent_class ?entityClass2.
?newEntity2 net:has_parent_class ?listItemClass.
?newEntity2 net:has_concept ?subEntity2.
# Object: entity 3
?newEntity3 a net:Object.
?newEntity3 net:objectType \"Entity\".
?newEntity3 net:has_node ?uw3.
?newEntity3 net:has_parent_class ?entityClass2.
?newEntity3 net:has_parent_class ?listItemClass.
?newEntity3 net:has_concept ?subEntity3.
# Net: Entity ClassList
?newNet a net:Instance.
?newNet net:type net:entity_class_list.
?newNet net:has_structure ?req.
?newNet net:has_node ?uw1, ?uw2, ?uw3.
?newNet net:entityClass ?entityClass1.
?newNet net:entityClass ?atomParentClass.
?newNet net:has_mainClass ?atomObject1.
?newNet net:has_subClass ?newEntity2, ?newEntity3.
}
WHERE {
# net1: agent
# net1: atom
?net1 a net:Instance.
?net1 net:type net:atom.
?net1 net:atomOf sys:Entity.
?net1 net:has_structure ?req.
?net1 net:has_node ?uw1.
?net1 net:has_atom ?atomObject1.
?atomObject1 net:has_parent_class ?entityClass1.
?atomObject1 net:has_parent_class ?atomParentClass.
?atomObject1 net:has_concept ?mainEntity.
# condition: mod(net1, net2)
?uw1 unl:mod ?uw2.
# net2: entity modList
?net2 a net:Instance.
?net2 net:type net:entity_mod_list.
?net2 net:modCat1 fprm:System_Entity.
?net2 net:modCat2 ?entityClass2.
?net2 net:type net:list.
?net2 net:listOf ?listItemClass.
?net2 net:has_structure ?req.
?net2 net:has_node ?uw2, ?uw3.
# Filter
FILTER ( ?uw1 != ?uw3 ).
FILTER ( ?entityClass1 = ?entityClass2 ).
# UW: type UW-Occurrence and substructure of req sentence
# --old --- ?uw1 rdf:type unl:UW_Occurrence.
# --old --- ?uw2 rdf:type unl:UW_Occurrence.
# --old --- ?uw3 rdf:type unl:UW_Occurrence.
# --old --- ?uw1 unl:is_substructure_of ?req.
# --old --- ?uw2 unl:is_substructure_of ?req.
# --old --- ?uw3 unl:is_substructure_of ?req.
FILTER ( ?atomParentClass = ?listItemClass ).
# Label: Id, subEntity
?uw1 unl:has_id ?uw1Id.
?uw2 unl:has_id ?uw2Id.
......@@ -937,7 +811,7 @@ WHERE {
BIND (concat(?s1, ?uw1Id, '-', ?uw2Id) AS ?s2).
BIND (uri(?s2) AS ?newNet).
}""" ;
sh:order 2.6 ;
sh:order 2.33 ;
.
cts:compute-class-uri-of-net-object
rdf:type sh:SPARQLRule ;
......@@ -1180,7 +1054,52 @@ WHERE {
BIND (concat(?n1, ?uw1Id) AS ?n2).
BIND (uri(?n2) AS ?newNet).
}""" ;
sh:order 2.1 ;
sh:order 2.11 ;
.
cts:create-unary-list-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#>
# -- Initialize a ModList net
CONSTRUCT {
?semNet a net:Instance.
?semNet net:type net:list.
?semNet net:type net:unary_list.
?semNet net:has_structure ?req.
?semNet net:has_node ?uw1.
?semNet net:has_concept ?concept1.
}
WHERE {
# UW: type UW-Occurrence and substructure of req sentence
?uw0 rdf:type unl:UW_Occurrence.
?uw0 unl:is_substructure_of ?req.
# selection: target UW of modifier (mod)
?uw0 unl:mod ?uw1.
FILTER NOT EXISTS { ?uw1 (unl:and|unl:or) ?uw2 }
# UW: type UW-Occurrence and substructure of req sentence
?uw1 rdf:type unl:UW_Occurrence.
?uw1 unl:is_substructure_of ?req.
# Label(s) / URI
?uw1 rdfs:label ?uw1Label.
?uw1 unl:has_id ?uw1Id.
cprm:Config_Parameters cprm:netURI ?netURI.
net:list rdfs:label ?listLabel.
BIND (strbefore(?uw1Label, '(') AS ?concept1).
# -- old --- BIND (strbefore(?uw2Label, '(') AS ?concept2).
BIND (concat( ?netURI, ?listLabel, '_') AS ?s1).
BIND (concat(?s1, ?uw1Id) AS ?s2).
BIND (uri(?s2) AS ?semNet).
}""" ;
sh:order 2.21 ;
.
cts:define-uw-id
rdf:type sh:SPARQLRule ;
......@@ -1223,17 +1142,15 @@ cts:entity_extraction
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:compose-entity-modlist-3 ;
sh:rule cts:compose-atom-with-list-1 ;
sh:rule cts:compose-atom-with-list-2 ;
sh:rule cts:create-atom-net ;
sh:rule cts:extend-mod-list ;
sh:rule cts:init-mod-list ;
sh:rule cts:extend-list-net ;
sh:rule cts:init-conjunctive-list-net ;
sh:rule cts:instantiate-atom-net ;
sh:rule cts:instantiate-classlist-by-extension-1 ;
sh:rule cts:instantiate-classlist-by-extension-2 ;
sh:rule cts:typify-modlist-entity ;
sh:rule cts:typify-modlist-feature ;
sh:rule cts:specify-items-of-list-net ;
.
cts:event_extraction
rdf:type owl:Class ;
......@@ -1242,7 +1159,7 @@ cts:event_extraction
rdfs:subClassOf cts:net_extension ;
sh:rule cts:compose-agt-verb-obj-as-simple-event ;
.
cts:extend-mod-list
cts:extend-list-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#>
......@@ -1263,22 +1180,18 @@ CONSTRUCT {
WHERE {
# selection: modList net
?semNet a net:Instance.
?semNet net:type net:mod_list.
?semNet net:type net:list.
?semNet net:has_node ?uw1.
# extension: disjunction of UW
?uw1 (unl:or|unl:and) ?uw2.
# UW: type UW-Occurrence and substructure of req sentence
# -- old --- ?uw1 rdf:type unl:UW_Occurrence.
# -- old --- ?uw1 unl:is_substructure_of ?req.
?uw2 rdf:type unl:UW_Occurrence.
?uw2 unl:is_substructure_of ?req.
# Label(s) / URI
?uw1 rdfs:label ?uw1Label.
?uw2 rdfs:label ?uw2Label.
BIND (strbefore(?uw1Label, '(') AS ?concept1)
BIND (strbefore(?uw2Label, '(') AS ?concept2)
}""" ;
sh:order 2.4 ;
sh:order 2.22 ;
.
cts:feature_extraction
rdf:type owl:Class ;
......@@ -1389,7 +1302,7 @@ cts:generation
sh:rule cts:generate-atom-class ;
sh:rule cts:generate-atom-instance ;
.
cts:init-mod-list
cts:init-conjunctive-list-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#>
......@@ -1405,32 +1318,77 @@ PREFIX fprm: <https://unsel.tetras-libre.fr/tenet/frame/parameters#>
# -- Initialize a ModList net
CONSTRUCT {
?semNet a net:Instance.
?semNet net:type net:mod_list.
?semNet net:type net:list.
?semNet net:type net:conjunctive_list.
?semNet net:has_structure ?req.
?semNet net:has_node ?uw1.
?semNet net:has_concept ?concept1.
}
WHERE {
# UW: type UW-Occurrence and substructure of req sentence
?uw0 rdf:type unl:UW_Occurrence.
?uw0 unl:is_substructure_of ?req.
?uw1 rdf:type unl:UW_Occurrence.
?uw1 unl:is_substructure_of ?req.
# selection: target UW of modifier (mod)
?uw0 unl:mod ?uw1.
?uw1 unl:and ?uw2.
# UW: type UW-Occurrence and substructure of req sentence
?uw2 rdf:type unl:UW_Occurrence.
?uw2 unl:is_substructure_of ?req.
# Label(s) / URI
?uw1 rdfs:label ?uw1Label.
?uw1 unl:has_id ?uw1Id.
cprm:Config_Parameters cprm:netURI ?netURI.
net:list rdfs:label ?listLabel.
BIND (strbefore(?uw1Label, '(') AS ?concept1).
# -- old --- BIND (strbefore(?uw2Label, '(') AS ?concept2).
BIND (concat( ?netURI, ?listLabel, '_') AS ?s1).
BIND (concat(?s1, ?uw1Id) AS ?s2).
BIND (uri(?s2) AS ?semNet).
}""" ;
sh:order 2.21 ;
.
cts:init-disjunctive-list-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#>
# -- Initialize a ModList net
CONSTRUCT {
?semNet a net:Instance.
?semNet net:type net:list.
?semNet net:type net:disjunctive_list.
?semNet net:has_structure ?req.
?semNet net:has_node ?uw1.
?semNet net:has_concept ?concept1.
}
WHERE {
# UW: type UW-Occurrence and substructure of req sentence
?uw1 rdf:type unl:UW_Occurrence.
?uw1 unl:is_substructure_of ?req.
# selection: target UW of modifier (mod)
?uw1 unl:or ?uw2.
# UW: type UW-Occurrence and substructure of req sentence
?uw2 rdf:type unl:UW_Occurrence.
?uw2 unl:is_substructure_of ?req.
# Label(s) / URI
?uw1 rdfs:label ?uw1Label.
?uw1 unl:has_id ?uw1Id.
cprm:Config_Parameters cprm:netURI ?netURI.
net:mod_list rdfs:label ?modListLabel.
net:list rdfs:label ?listLabel.
BIND (strbefore(?uw1Label, '(') AS ?concept1).
# -- old --- BIND (strbefore(?uw2Label, '(') AS ?concept2).
BIND (concat( ?netURI, ?modListLabel, '_') AS ?s1).
BIND (concat( ?netURI, ?listLabel, '_') AS ?s1).
BIND (concat(?s1, ?uw1Id) AS ?s2).
BIND (uri(?s2) AS ?semNet).
}""" ;
sh:order 2.3 ;
sh:order 2.21 ;
.
cts:instantiate-atom-net
rdf:type sh:SPARQLRule ;
......@@ -1467,7 +1425,7 @@ WHERE {
?uw1 unl:has_id ?uw1Id.
BIND (?uw1Id AS ?instanceName).
}""" ;
sh:order 2.2 ;
sh:order 2.12 ;
.
cts:instantiate-classlist-by-extension-1
rdf:type sh:SPARQLRule ;
......@@ -1505,7 +1463,7 @@ WHERE {
# Filter
FILTER NOT EXISTS { ?subObject2 net:has_instance ?instanceName2 } .
}""" ;
sh:order 2.7 ;
sh:order 2.34 ;
.
cts:instantiate-classlist-by-extension-2
rdf:type sh:SPARQLRule ;
......@@ -1544,7 +1502,7 @@ WHERE {
# Filter
FILTER NOT EXISTS { ?subObject2 net:has_instance ?instanceName2 } .
}""" ;
sh:order 2.8 ;
sh:order 2.35 ;
.
cts:link-to-scope-entry
rdf:type sh:SPARQLRule ;
......@@ -1595,14 +1553,7 @@ cts:preprocessing
sh:rule cts:define-uw-id ;
sh:rule cts:link-to-scope-entry ;
.
cts:state_property_extraction
rdf:type owl:Class ;
rdf:type sh:NodeShape ;
rdfs:label "state property extraction" ;
rdfs:subClassOf cts:net_extension ;
sh:rule cts:compose-aoj-verb-obj-as-simple-state-property ;
.
cts:typify-modlist-entity
cts:specify-axis-of-list-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#>
......@@ -1615,32 +1566,24 @@ 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
# -- Specify the class of items in the list
CONSTRUCT {
?semNet net:type net:entity_mod_list.
?semNet net:modCat1 fprm:System_Entity.
?semNet net:modCat2 ?entityClass.
?semNet net:listBy ?unlRel.
}
WHERE {
# Entity (from System Ontology)
?targetClass rdfs:subClassOf* sys:Entity.
?targetClass sys:is_class ?entityClass.
?targetClass sys:has_restriction ?entityRestriction.
# UW: type UW-Occurrence and substructure of req sentence
?uw0 rdf:type unl:UW_Occurrence.
?uw0 unl:is_substructure_of ?req.
# net: modList
?semNet a net:Instance.
?semNet net:type net:mod_list.
?semNet net:type net:list.
?semNet net:has_node ?uw1.
# UW: type UW-Occurrence and substructure of req sentence
?uw1 rdf:type unl:UW_Occurrence.
?uw1 unl:is_substructure_of ?req.
# Label(s) / URI
?uw1 rdfs:label ?uw1Label.
# Filter
FILTER ( regex(str(?uw1Label),str(?entityRestriction)) ).
# selection: target UW of modifier (mod)
?uw0 ?unlRel ?uw1.
}""" ;
sh:order 2.5 ;
sh:order 2.23 ;
.
cts:typify-modlist-feature
cts:specify-items-of-list-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#>
......@@ -1653,20 +1596,18 @@ 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
# -- Specify the class of items in the list
CONSTRUCT {
?semNet net:type net:complement_mod_list.
?semNet net:modCat1 fprm:System_Feature.
?semNet net:modCat2 ?featureClass.
?semNet net:listOf ?atomClass.
}
WHERE {
# Entity Feature (from System Ontology)
?targetClass rdfs:subClassOf* sys:Feature.
?targetClass sys:is_class ?featureClass.
?targetClass sys:has_restriction ?featureRestriction.
?targetClass rdfs:subClassOf* sys:Structure.
?targetClass sys:is_class ?atomClass.
?targetClass sys:has_restriction ?atomRestriction.
# net: modList
?semNet a net:Instance.
?semNet net:type net:mod_list.
?semNet net:type net:list.
?semNet net:has_node ?uw1.
# UW: type UW-Occurrence and substructure of req sentence
?uw1 rdf:type unl:UW_Occurrence.
......@@ -1674,9 +1615,16 @@ WHERE {
# Label(s) / URI
?uw1 rdfs:label ?uw1Label.
# Filter
FILTER ( regex(str(?uw1Label),str(?featureRestriction)) ).
FILTER ( regex(str(?uw1Label),str(?atomRestriction)) ).
}""" ;
sh:order 2.5 ;
sh:order 2.23 ;
.
cts:state_property_extraction
rdf:type owl:Class ;
rdf:type sh:NodeShape ;
rdfs:label "state property extraction" ;
rdfs:subClassOf cts:net_extension ;
sh:rule cts:compose-aoj-verb-obj-as-simple-state-property ;
.
cts:verb_extraction
rdf:type owl:Class ;
......
......@@ -205,11 +205,11 @@ def run(corpus, source_ref, target_ref):
if __name__ == '__main__':
target_ref = "system"
run(req_100, 'R100', target_ref)
run(req_200, 'R200', target_ref)
run(req_300, 'R300a', target_ref)
run(corpus_40, 'Corpus-CCTP-40c', target_ref)
run(corpus_ERTMS, 'Corpus-ERTMS', target_ref)
run(req_100, 'R100b', target_ref)
run(req_200, 'R200b', target_ref)
run(req_300, 'R300b', target_ref)
#run(corpus_40, 'Corpus-CCTP-40c', target_ref)
#run(corpus_ERTMS, 'Corpus-ERTMS', target_ref)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment