diff --git a/data/SSC-01/SSC-01-01/SSC-01-01.cts.txt b/data/SSC-01/SSC-01-01/SSC-01-01.cts.txt index e4ce25b760a745c3ed3f4c6fdb783ca86a13a154..da53747c5ae2bfab516b359304da103fc7059f5f 100644 --- a/data/SSC-01/SSC-01-01/SSC-01-01.cts.txt +++ b/data/SSC-01/SSC-01-01/SSC-01-01.cts.txt @@ -4,31 +4,44 @@ # # Pré-traitement = chaque noeud du graphe est associé à un filet de type ATOM # -# TYPE = { atom, commonConcept, predicate, dataValue, class } +# TYPE = { atom, commonConcept, predicate, dataValue, class, objectProperty } # # ----------------------------------- # Fonctions # ----------------------------------- -# ::function isCommomConcept -# isCommonConcept(x) retourne VRAI si x est un concept AMR commun, c'est à -# dire si x n'est pas un prédicat ou un phénomène linguistique -# exemple de concepts communs : boy, car, ... +# ::function is-common-concept (x) +retourne VRAI si x est un concept AMR commun, c'est à +dire si x n'est pas un prédicat ou un phénomène linguistique +exemple de concepts communs : boy, car, ... -# ::function isPredicate -# isPredicate(x) retourne VRAI si x est un prédicat AMR +# ::function is-predicate (x) +retourne VRAI si x est un prédicat AMR -# ::function isPhenomena -# isPhenomena(x) retourne VRAI si x est un phénomène linguistique +# ::function is-linguistic-phenomena (x) +retourne VRAI si x est un phénomène linguistique +# ::function get-value (x) +retourne la chaine de caractère x sans guillemet -# ::function getValue -# getValue(x) retourne la chaine de caractère x sans guillemet +# ::function get-value (x, y) +retourne la concaténation de get-value(x), '-' et get-value(y) -# ::function getValue -# getValue(x, y) retourne la concaténation de getValue(x), '-' -# et getValue(y) +# ::function define-id (x, y ...) +retourne un identifiant sous une forme standard (':x-y-...') + +# ::function define-inverse-id (x) +retourne un identifiant inverse pour la propriété d'id "x" sous une forme +standard (':x-of' ou ':x-by') + +# ::function define-OWL-restriction (C1, P, C2) +retourne la définition d'une restriction OWL sur la classe c1 sous la forme +suivante : + {C1} rdfs:subClassOf [ rdf:type owl:Restriction ; + owl:onProperty {p} ; + owl:hasValue {C2} + ] . # -------------------------------------------------------- @@ -39,7 +52,7 @@ STC-01 (x) : atom(x) & isCommonConcept(x.concept) => nodes = { x.nodes } type = commonConcept - concept = getValue(x.value) + concept = get-value(x.value) values = { concept } newNet(nodes, type, values) @@ -48,11 +61,20 @@ STC-02 (x) : atom(x) & isDataValue(x) => nodes = { x.nodes } type = dataValue - value = getValue(x.value) + value = get-value(x.value) values = { value } newNet(nodes, type, values) +STC-03 (x) : + atom(x) & is-predicate(x) + => nodes = { x.nodes } + type = predicate + predicate = get-value(x.value) + values = { predicate } + newNet(nodes, type, values) + + # -------------------------------------------------------- # STC niveau 1 : extraction des entités nommées # -------------------------------------------------------- @@ -67,7 +89,7 @@ STC-11 (n, x) : newNet(nodes, type, values) -STC-04 (ne, x) : +STC-12 (ne, x) : namedEntities(ne) & dataValue(x) & ne.depth = 1 & op2(ne, x) => nodes = { ne.nodes, x.nodes } type = namedEntities @@ -78,29 +100,29 @@ STC-04 (ne, x) : # -------------------------------------------------------- -# STC niveau 1 : extraction des classes +# STC niveau 2 : extraction de classes # -------------------------------------------------------- -STC-11 (x, y) : +STC-21 (x, y) : commonConcept(x) => nodes = { x.nodes } type = class - class_id = string(x.concept) + class_id = define-id(x.concept) owl = string(class_id, ' a ', 'rdfs:Class') values = { class_id, owl } newNet(nodes, type, values) -STC-12 (x, y) : +STC-22 (x, y) : :domain(x,y) & class(x) & class(y) => nodes = { x.nodes, y.nodes } type = class - class_id = string(x.class_id, '-', y.class_id) + class_id = define-id(x.class_id, y.class_id) owl = string(class_id, ' a ', 'rdfs:Class') owl = string(class_id, ' rdfs:subClassOf ', y.class_id) values = { class_id, owl } newNet(nodes, type, values) -STC-13 (x, y) : +STC-23 (x, y) : :name(x, y) & class(x) & namedEntities(x, y) => nodes = { x.nodes } type = individual @@ -113,29 +135,65 @@ STC-13 (x, y) : # -------------------------------------------------------- -# STC niveau 2 : extraction de propriétés +# STC niveau 3 : extraction de propriétés # -------------------------------------------------------- -STC-14 (x, y) : +STC-31 (x, y) : predicate(x) & class(y) => nodes = { x.nodes } type = objectProperty - property_id = string(x.concept) + property_id = define-id(x.predicate) owl = string(property_id, ' a ', 'owl:objectProperty') values = { property_id, owl } newNet(nodes, type, values) +STC-32 (x, y) : + objectProperty(x) & :ARGi-of(x, y) + => inverse_property_id = define-inverse-id(x.property_id) + owl = string(x.property_id, ' owl:inverseOf ', inverse_property_id) + x.values = x.values + { owl } + # -------------------------------------------------------- -# STC niveau 3 : extraction de classes +# STC niveau 4 : extraction de relations taxonomiques # -------------------------------------------------------- -STC-15 (x, y, z) : +STC-41 (x, y, z) : :ARG1-of(x, y) & class(x) & objectProperty(y) & ARG0(y, z) & class(z) => nodes = { x.nodes } type = class - class_id = string(z.class_id, '-', y.property_id, '-', x.class_id) + class_id = define-id(z.class_id, y.property_id, x.class_id) owl = string(class_id, ' a ', 'rdfs:Class') owl = string(class_id, ' rdfs:subClassOf ', x.class_id) + owl = define-OWL-restriction (class_id, y.property_id, z.class_id) values = { class_id, owl } newNet(nodes, type, values) + +exemple : +(s / system + :ARG1-of (b / bind-01 + :ARG0 (g / gravitation)) + + => nodes = { s, b, g } + type = class + class_id = "gravitation-bind-system" + owl = ":gravitation-bind-system a rdfs:Class" + owl = ":gravitation-bind-system a :system" + owl = ":gravitation-bind-system rdfs:subClassOf [ rdf:type owl:Restriction ; + owl:onProperty :bind-by ; + owl:hasValue :gravitation + ] ." + + +# -------------------------------------------------------- +# STC niveau 5 : extraction de relations non taxonomiques +# -------------------------------------------------------- + +# -- + + +# -------------------------------------------------------- +# STC niveau 6 : extraction d'axiomes complexes +# -------------------------------------------------------- + +# -- diff --git a/data/SSC-01/SSC-01-01/SSC-01-01.owl.ttl b/data/SSC-01/SSC-01-01/SSC-01-01.owl.ttl index a3415b164fe5a0bbdaa53f7bb84c015ba5d26d88..5fe02c47fee75b5f4ccecfaa8278b832a1735fb8 100644 --- a/data/SSC-01/SSC-01-01/SSC-01-01.owl.ttl +++ b/data/SSC-01/SSC-01-01/SSC-01-01.owl.ttl @@ -143,7 +143,8 @@ owl:objectProperty rdf:type owl:Class . ### https://tetras-libre.fr/mars/ssc#solar-system :solar-system rdf:type owl:NamedIndividual , owl:individual , - :gravitationally-bound-system . + :gravitationally-bound-system ; + :has-part :sun . ### https://tetras-libre.fr/mars/ssc#sun diff --git a/data/SSC-02/SSC-02-01/SSC-02-01.cts.txt b/data/SSC-02/SSC-02-01/SSC-02-01.cts.txt new file mode 100644 index 0000000000000000000000000000000000000000..4f2b540eea36133b07075514a57b3dc7828add81 --- /dev/null +++ b/data/SSC-02/SSC-02-01/SSC-02-01.cts.txt @@ -0,0 +1,155 @@ +# ----------------------------------------------------------------------------- +# Schémas de Transduction Compositionnel (STC) +# ----------------------------------------------------------------------------- +# +# Pré-traitement = chaque noeud du graphe est associé à un filet de type ATOM +# +# TYPE = { atom, commonConcept, predicate, dataValue, class, objectProperty } +# + +# ----------------------------------- +# Fonctions +# ----------------------------------- + +# ::function isCommomConcept +# isCommonConcept(x) retourne VRAI si x est un concept AMR commun, c'est à +# dire si x n'est pas un prédicat ou un phénomène linguistique +# exemple de concepts communs : boy, car, ... + +# ::function isPredicate +# isPredicate(x) retourne VRAI si x est un prédicat AMR + +# ::function isPhenomena +# isPhenomena(x) retourne VRAI si x est un phénomène linguistique + + +# ::function getValue +# getValue(x) retourne la chaine de caractère x sans guillemet + +# ::function getValue +# getValue(x, y) retourne la concaténation de getValue(x), '-' +# et getValue(y) + + +# -------------------------------------------------------- +# STC niveau 0 : analyse des concepts atomiques +# -------------------------------------------------------- + +STC-01 (x) : + atom(x) & isCommonConcept(x.concept) + => nodes = { x.nodes } + type = commonConcept + concept = getValue(x.value) + values = { concept } + newNet(nodes, type, values) + + +STC-02 (x) : + atom(x) & isDataValue(x) + => nodes = { x.nodes } + type = dataValue + value = getValue(x.value) + values = { value } + newNet(nodes, type, values) + + +# -------------------------------------------------------- +# STC niveau 1 : extraction des entités nommées +# -------------------------------------------------------- + +STC-11 (n, x) : + commonConcept(n) & dataValue(x) & n.concept = 'name' & op1(n, x) + => nodes = { n.nodes, x.nodes } + type = namedEntities + depth = '1' + name = string(x.value) + values = { name } + newNet(nodes, type, values) + + +STC-12 (ne, x) : + namedEntities(ne) & dataValue(x) & ne.depth = 1 & op2(ne, x) + => nodes = { ne.nodes, x.nodes } + type = namedEntities + depth = '2' + name = string(ne.name, '-', x.value) + values = { name } + newNet(nodes, type, values) + + +# -------------------------------------------------------- +# STC niveau 2 : extraction de classes +# -------------------------------------------------------- + +STC-21 (x, y) : + commonConcept(x) + => nodes = { x.nodes } + type = class + class_id = string(x.concept) + owl = string(class_id, ' a ', 'rdfs:Class') + values = { class_id, owl } + newNet(nodes, type, values) + +STC-22 (x, y) : + :domain(x,y) & class(x) & class(y) + => nodes = { x.nodes, y.nodes } + type = class + class_id = string(x.class_id, '-', y.class_id) + owl = string(class_id, ' a ', 'rdfs:Class') + owl = string(class_id, ' rdfs:subClassOf ', y.class_id) + values = { class_id, owl } + newNet(nodes, type, values) + +STC-23 (x, y) : + :name(x, y) & class(x) & namedEntities(x, y) + => nodes = { x.nodes } + type = individual + class_id = x.class_id + individual_id = y.name + owl = string(individual_id, ' a ', 'owl:individual') + owl = string(individual_id, ' a ', class_id) + values = { class_id, individual_id, owl } + newNet(nodes, type, values) + + +# -------------------------------------------------------- +# STC niveau 3 : extraction de propriétés +# -------------------------------------------------------- + +STC-31 (x, y) : + predicate(x) & class(y) + => nodes = { x.nodes } + type = objectProperty + property_id = string(x.concept) + owl = string(property_id, ' a ', 'owl:objectProperty') + values = { property_id, owl } + newNet(nodes, type, values) + + +# -------------------------------------------------------- +# STC niveau 4 : extraction de relations taxonomiques +# -------------------------------------------------------- + +STC-41 (x, y, z) : + :ARG1-of(x, y) & class(x) & objectProperty(y) & ARG0(y, z) & class(z) + => nodes = { x.nodes } + type = class + class_id = string(z.class_id, '-', y.property_id, '-', x.class_id) + owl = string(class_id, ' a ', 'rdfs:Class') + owl = string(class_id, ' rdfs:subClassOf ', x.class_id) + values = { class_id, owl } + newNet(nodes, type, values) + + +# -------------------------------------------------------- +# STC niveau 5 : extraction de relations non taxonomiques +# -------------------------------------------------------- + +# -- + + +# -------------------------------------------------------- +# STC niveau 6 : extraction d'axiomes complexes +# -------------------------------------------------------- + +# --