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

harmonize CTS for abstraction

parent ebaf1d51
No related branches found
No related tags found
No related merge requests found
...@@ -57,10 +57,12 @@ CONSTRUCT { ...@@ -57,10 +57,12 @@ CONSTRUCT {
WHERE { WHERE {
# net1: feature # net1: feature
?net1 a net:Instance. ?net1 a net:Instance.
?net1 net:type net:abstraction. ?net1 net:type net:atom.
?net1 net:atomOf sys:Abstraction.
?net1 net:has_structure ?req. ?net1 net:has_structure ?req.
?net1 net:abstractionClass ?abstractionClass. ?net1 net:has_atom ?atomObject1.
?net1 net:has_concept ?abstractionConcept. ?atomObject1 net:has_parent_class ?abstractionClass.
?atomObject1 net:has_concept ?abstractionConcept.
# Filter: entity not present in a class list # Filter: entity not present in a class list
FILTER NOT EXISTS { ?net2 net:class2 ?abstractionConcept} FILTER NOT EXISTS { ?net2 net:class2 ?abstractionConcept}
# URI: class # URI: class
...@@ -1328,14 +1330,27 @@ PREFIX fprm: <https://unsel.tetras-libre.fr/tenet/frame/parameters#> ...@@ -1328,14 +1330,27 @@ PREFIX fprm: <https://unsel.tetras-libre.fr/tenet/frame/parameters#>
# -- Create Feature net # -- Create Feature net
CONSTRUCT { CONSTRUCT {
# Atom Object
?newObject a net:Object.
?newObject net:objectType ?atomMother.
?newObject net:has_node ?uw1.
?newObject net:has_mother_class ?atomMother.
?newObject net:has_parent_class ?atomClass.
?newObject net:has_concept ?concept1.
# Atom Net
?newNet a net:Instance. ?newNet a net:Instance.
?newNet net:type net:abstraction. ?newNet net:type net:atom.
?newNet net:atomOf ?atomMother.
?newNet net:has_structure ?req. ?newNet net:has_structure ?req.
?newNet net:has_node ?uw1. ?newNet net:has_node ?uw1.
?newNet net:abstractionClass ?abstractionClass. ?newNet net:has_atom ?newObject.
?newNet net:has_concept ?concept1.
} }
WHERE { WHERE {
# Atom Description (from System Ontology)
?targetClass rdfs:subClassOf sys:Abstraction.
?targetClass sys:has_mother_class ?atomMother.
?targetClass sys:is_class ?atomClass.
?targetClass sys:has_restriction ?restriction.
# Absraction (from System Ontology) # Absraction (from System Ontology)
?abstraction rdf:type fprm:System_Abstraction. ?abstraction rdf:type fprm:System_Abstraction.
?abstraction fprm:class ?abstractionClass. ?abstraction fprm:class ?abstractionClass.
...@@ -1344,16 +1359,23 @@ WHERE { ...@@ -1344,16 +1359,23 @@ WHERE {
?uw1 rdf:type unl:UW_Occurrence. ?uw1 rdf:type unl:UW_Occurrence.
?uw1 unl:is_substructure_of ?req. ?uw1 unl:is_substructure_of ?req.
# ------ ?uw1 unl:is_occurrence_of ?lexTrg. # ------ ?uw1 unl:is_occurrence_of ?lexTrg.
# Label(s) / URI # Filter on label
?uw1 rdfs:label ?uw1Label. ?uw1 rdfs:label ?uw1Label.
FILTER ( regex(str(?uw1Label),str(?restriction)) ).
# Label: Id, concept
?uw1 unl:has_id ?uw1Id. ?uw1 unl:has_id ?uw1Id.
# URI (for Atom Object)
cprm:Config_Parameters cprm:netURI ?netURI.
cprm:Config_Parameters cprm:objectRef ?objectRef.
BIND (concat( ?netURI, ?objectRef) AS ?o1).
BIND (concat(?o1, ?uw1Id) AS ?o2).
BIND (uri(?o2) AS ?newObject).
# URI (for Atom Net)
cprm:Config_Parameters cprm:netURI ?netURI cprm:Config_Parameters cprm:netURI ?netURI
BIND (strbefore(?uw1Label, '(') AS ?concept1). BIND (strbefore(?uw1Label, '(') AS ?concept1).
BIND (concat( ?netURI, ?abstractionClass, '_') AS ?s1). BIND (concat( ?netURI, ?atomClass, '_') AS ?s1).
BIND (concat(?s1, ?uw1Id) AS ?s2). BIND (concat(?s1, ?uw1Id) AS ?s2).
BIND (uri(?s2) AS ?newNet). BIND (uri(?s2) AS ?newNet).
# Filter
FILTER ( regex(str(?uw1Label),str(?abstractionRestriction)) ).
}""" ; }""" ;
sh:order 2.1 ; sh:order 2.1 ;
. .
...@@ -1406,10 +1428,10 @@ WHERE { ...@@ -1406,10 +1428,10 @@ WHERE {
# URI (for Atom Object) # URI (for Atom Object)
cprm:Config_Parameters cprm:netURI ?netURI. cprm:Config_Parameters cprm:netURI ?netURI.
cprm:Config_Parameters cprm:objectRef ?objectRef. cprm:Config_Parameters cprm:objectRef ?objectRef.
BIND (concat( ?netURI, ?objectRef) AS ?e1). BIND (concat( ?netURI, ?objectRef) AS ?o1).
BIND (concat(?e1, ?uw1Id) AS ?e2). BIND (concat(?o1, ?uw1Id) AS ?o2).
BIND (uri(?e2) AS ?newObject). BIND (uri(?o2) AS ?newObject).
# URI (for Entity Net) # URI (for Atom Net)
cprm:Config_Parameters cprm:netURI ?netURI. cprm:Config_Parameters cprm:netURI ?netURI.
BIND (concat( ?netURI, ?atomClass, '_') AS ?n1). BIND (concat( ?netURI, ?atomClass, '_') AS ?n1).
BIND (concat(?n1, ?uw1Id) AS ?n2). BIND (concat(?n1, ?uw1Id) AS ?n2).
...@@ -1432,14 +1454,14 @@ PREFIX fprm: <https://unsel.tetras-libre.fr/tenet/frame/parameters#> ...@@ -1432,14 +1454,14 @@ PREFIX fprm: <https://unsel.tetras-libre.fr/tenet/frame/parameters#>
# -- Create Feature net # -- Create Feature net
CONSTRUCT { CONSTRUCT {
# Object: atom (feature) # Atom Object
?newObject a net:Object. ?newObject a net:Object.
?newObject net:objectType ?atomMother. ?newObject net:objectType ?atomMother.
?newObject net:has_node ?uw1. ?newObject net:has_node ?uw1.
?newObject net:has_mother_class ?atomMother. ?newObject net:has_mother_class ?atomMother.
?newObject net:has_parent_class ?featureClass. ?newObject net:has_parent_class ?atomClass.
?newObject net:concept ?concept1. ?newObject net:has_concept ?concept1.
# Net: Feature # Atom Net
?newNet a net:Instance. ?newNet a net:Instance.
?newNet net:type net:atom. ?newNet net:type net:atom.
?newNet net:atomOf ?atomMother. ?newNet net:atomOf ?atomMother.
...@@ -1466,10 +1488,10 @@ WHERE { ...@@ -1466,10 +1488,10 @@ WHERE {
# URI (for Atom Object) # URI (for Atom Object)
cprm:Config_Parameters cprm:netURI ?netURI. cprm:Config_Parameters cprm:netURI ?netURI.
cprm:Config_Parameters cprm:objectRef ?objectRef. cprm:Config_Parameters cprm:objectRef ?objectRef.
BIND (concat( ?netURI, ?objectRef) AS ?a1). BIND (concat( ?netURI, ?objectRef) AS ?o1).
BIND (concat(?a1, ?uw1Id) AS ?a2). BIND (concat(?o1, ?uw1Id) AS ?o2).
BIND (uri(?a2) AS ?newObject). BIND (uri(?o2) AS ?newObject).
# URI (for Entity Net) # URI (for Atom Net)
cprm:Config_Parameters cprm:netURI ?netURI. cprm:Config_Parameters cprm:netURI ?netURI.
BIND (concat( ?netURI, ?atomClass, '_') AS ?n1). BIND (concat( ?netURI, ?atomClass, '_') AS ?n1).
BIND (concat(?n1, ?uw1Id) AS ?n2). BIND (concat(?n1, ?uw1Id) AS ?n2).
......
...@@ -203,7 +203,7 @@ if __name__ == '__main__': ...@@ -203,7 +203,7 @@ if __name__ == '__main__':
#run(req_100, 'R100', 'output100.ttl') #run(req_100, 'R100', 'output100.ttl')
#run(req_200, 'R200', 'output200.ttl') #run(req_200, 'R200', 'output200.ttl')
run(req_300, 'R300b', 'output300b.ttl') run(req_300, 'R300b', 'output300b.ttl')
#run(corpus_40, 'Corpus-CCTP-40', 'outputCCTP40.ttl') run(corpus_40, 'Corpus-CCTP-40b', 'outputCCTP40b.ttl')
#run(corpus_ERTMS, 'Corpus-ERTMS', 'outputERTMS.ttl') #run(corpus_ERTMS, 'Corpus-ERTMS', 'outputERTMS.ttl')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment