diff --git a/config/transduction-schemes.ttl b/config/transduction-schemes.ttl index d1ca902d36d0de223ec0aefc67b64ea23cd5d7a7..ae8f519b8c2d50f6d6211334c8db3ca8149431b4 100644 --- a/config/transduction-schemes.ttl +++ b/config/transduction-schemes.ttl @@ -57,10 +57,12 @@ CONSTRUCT { WHERE { # net1: feature ?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:abstractionClass ?abstractionClass. - ?net1 net:has_concept ?abstractionConcept. + ?net1 net:has_atom ?atomObject1. + ?atomObject1 net:has_parent_class ?abstractionClass. + ?atomObject1 net:has_concept ?abstractionConcept. # Filter: entity not present in a class list FILTER NOT EXISTS { ?net2 net:class2 ?abstractionConcept} # URI: class @@ -1328,14 +1330,27 @@ PREFIX fprm: <https://unsel.tetras-libre.fr/tenet/frame/parameters#> # -- Create Feature net 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 net:type net:abstraction. + ?newNet net:type net:atom. + ?newNet net:atomOf ?atomMother. ?newNet net:has_structure ?req. ?newNet net:has_node ?uw1. - ?newNet net:abstractionClass ?abstractionClass. - ?newNet net:has_concept ?concept1. + ?newNet net:has_atom ?newObject. } 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) ?abstraction rdf:type fprm:System_Abstraction. ?abstraction fprm:class ?abstractionClass. @@ -1344,16 +1359,23 @@ WHERE { ?uw1 rdf:type unl:UW_Occurrence. ?uw1 unl:is_substructure_of ?req. # ------ ?uw1 unl:is_occurrence_of ?lexTrg. - # Label(s) / URI + # Filter on label ?uw1 rdfs:label ?uw1Label. + FILTER ( regex(str(?uw1Label),str(?restriction)) ). + # Label: Id, concept ?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 BIND (strbefore(?uw1Label, '(') AS ?concept1). - BIND (concat( ?netURI, ?abstractionClass, '_') AS ?s1). + BIND (concat( ?netURI, ?atomClass, '_') AS ?s1). BIND (concat(?s1, ?uw1Id) AS ?s2). BIND (uri(?s2) AS ?newNet). - # Filter - FILTER ( regex(str(?uw1Label),str(?abstractionRestriction)) ). }""" ; sh:order 2.1 ; . @@ -1406,10 +1428,10 @@ WHERE { # URI (for Atom Object) cprm:Config_Parameters cprm:netURI ?netURI. cprm:Config_Parameters cprm:objectRef ?objectRef. - BIND (concat( ?netURI, ?objectRef) AS ?e1). - BIND (concat(?e1, ?uw1Id) AS ?e2). - BIND (uri(?e2) AS ?newObject). - # URI (for Entity Net) + 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. BIND (concat( ?netURI, ?atomClass, '_') AS ?n1). BIND (concat(?n1, ?uw1Id) AS ?n2). @@ -1432,14 +1454,14 @@ PREFIX fprm: <https://unsel.tetras-libre.fr/tenet/frame/parameters#> # -- Create Feature net CONSTRUCT { - # Object: atom (feature) + # 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 ?featureClass. - ?newObject net:concept ?concept1. - # Net: Feature + ?newObject net:has_parent_class ?atomClass. + ?newObject net:has_concept ?concept1. + # Atom Net ?newNet a net:Instance. ?newNet net:type net:atom. ?newNet net:atomOf ?atomMother. @@ -1466,10 +1488,10 @@ WHERE { # URI (for Atom Object) cprm:Config_Parameters cprm:netURI ?netURI. cprm:Config_Parameters cprm:objectRef ?objectRef. - BIND (concat( ?netURI, ?objectRef) AS ?a1). - BIND (concat(?a1, ?uw1Id) AS ?a2). - BIND (uri(?a2) AS ?newObject). - # URI (for Entity Net) + 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. BIND (concat( ?netURI, ?atomClass, '_') AS ?n1). BIND (concat(?n1, ?uw1Id) AS ?n2). diff --git a/prepare_work_data.py b/prepare_work_data.py index 31758eb7deeed34c9da39843d511b2867e4753cf..5a26cc3a6a97dff5ae0dd474821452e276638b98 100644 --- a/prepare_work_data.py +++ b/prepare_work_data.py @@ -203,7 +203,7 @@ if __name__ == '__main__': #run(req_100, 'R100', 'output100.ttl') #run(req_200, 'R200', 'output200.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')