From 4b3d0fdeec9014916620c98cdc9a3ec05867edb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Lamercerie?= <aurelien.lamercerie@tetras-libre.fr> Date: Thu, 4 Aug 2022 17:30:41 +0200 Subject: [PATCH] Update SSC-02-01 (cts) --- data/SSC-02/SSC-02-01/SSC-02-01.cts.txt | 82 +++++++++++++++++++------ 1 file changed, 63 insertions(+), 19 deletions(-) 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 index 4f2b540..da53747 100644 --- a/data/SSC-02/SSC-02-01/SSC-02-01.cts.txt +++ b/data/SSC-02/SSC-02-01/SSC-02-01.cts.txt @@ -11,24 +11,37 @@ # 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 # -------------------------------------------------------- @@ -85,7 +107,7 @@ 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) @@ -94,7 +116,7 @@ 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 } @@ -120,11 +142,17 @@ 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 4 : extraction de relations taxonomiques @@ -134,12 +162,28 @@ 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 -- GitLab