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

Update CTR to deal with reification concept

parent dd07faae
Branches
Tags
No related merge requests found
...@@ -428,13 +428,74 @@ ns1:Role rdf:type owl:Class ; ...@@ -428,13 +428,74 @@ ns1:Role rdf:type owl:Class ;
:hasRelationName "quant" . :hasRelationName "quant" .
### https://amr.tetras-libre.fr/rdf/schema#role_ARG0
:role_ARG0 rdf:type owl:Class ;
rdfs:subClassOf :AMR_Core_Role ;
:label "ARG0" .
### https://amr.tetras-libre.fr/rdf/schema#role_ARG1
:role_ARG1 rdf:type owl:Class ;
rdfs:subClassOf :AMR_Core_Role ;
:label "ARG1" .
### https://amr.tetras-libre.fr/rdf/schema#role_ARG2
:role_ARG2 rdf:type owl:Class ;
rdfs:subClassOf :AMR_Core_Role ;
:label "ARG2" .
### https://amr.tetras-libre.fr/rdf/schema#role_ARG3
:role_ARG3 rdf:type owl:Class ;
rdfs:subClassOf :AMR_Core_Role ;
:label "ARG3" .
### https://amr.tetras-libre.fr/rdf/schema#role_ARG4
:role_ARG4 rdf:type owl:Class ;
rdfs:subClassOf :AMR_Core_Role ;
:label "ARG4" .
### https://amr.tetras-libre.fr/rdf/schema#role_ARG5
:role_ARG5 rdf:type owl:Class ;
rdfs:subClassOf :AMR_Core_Role ;
:label "ARG5" .
### https://amr.tetras-libre.fr/rdf/schema#role_ARG6
:role_ARG6 rdf:type owl:Class ;
rdfs:subClassOf :AMR_Core_Role ;
:label "ARG6" .
### https://amr.tetras-libre.fr/rdf/schema#role_ARG7
:role_ARG7 rdf:type owl:Class ;
rdfs:subClassOf :AMR_Core_Role ;
:label "ARG7" .
### https://amr.tetras-libre.fr/rdf/schema#role_ARG8
:role_ARG8 rdf:type owl:Class ;
rdfs:subClassOf :AMR_Core_Role ;
:label "ARG8" .
### https://amr.tetras-libre.fr/rdf/schema#role_ARG9
:role_ARG9 rdf:type owl:Class ;
rdfs:subClassOf :AMR_Core_Role ;
:label "ARG9" .
### https://amr.tetras-libre.fr/rdf/schema#role_domain ### https://amr.tetras-libre.fr/rdf/schema#role_domain
:role_domain rdf:type owl:Class ; :role_domain rdf:type owl:Class ;
rdfs:subClassOf :AMR_NonCore_Role ; rdfs:subClassOf :AMR_NonCore_Role ;
:hasRelationName "domain" ; :hasRelationName "domain" ;
:toReifyAsConcept "domain" ; :toReifyAsConcept "domain" ;
:toReifyWithBaseEdge "ARG0" ; :toReifyWithBaseEdge "ARG0" ;
:toReifyWithHeadEdge "ARG1" . :toReifyWithHeadEdge "ARG1" ;
:label "domain" .
### https://amr.tetras-libre.fr/rdf/schema#role_have-degree-91 ### https://amr.tetras-libre.fr/rdf/schema#role_have-degree-91
...@@ -450,7 +511,8 @@ ns1:Role rdf:type owl:Class ; ...@@ -450,7 +511,8 @@ ns1:Role rdf:type owl:Class ;
:getPropertyType owl:DataProperty ; :getPropertyType owl:DataProperty ;
:toReifyAsConcept "manner" ; :toReifyAsConcept "manner" ;
:toReifyWithBaseEdge "ARG0" ; :toReifyWithBaseEdge "ARG0" ;
:toReifyWithHeadEdge "ARG1" . :toReifyWithHeadEdge "ARG1" ;
:label "manner" .
### https://amr.tetras-libre.fr/rdf/schema#role_mod ### https://amr.tetras-libre.fr/rdf/schema#role_mod
...@@ -461,57 +523,68 @@ ns1:Role rdf:type owl:Class ; ...@@ -461,57 +523,68 @@ ns1:Role rdf:type owl:Class ;
owl:ObjectProperty ; owl:ObjectProperty ;
:toReifyAsConcept "mod" ; :toReifyAsConcept "mod" ;
:toReifyWithBaseEdge "ARG0" ; :toReifyWithBaseEdge "ARG0" ;
:toReifyWithHeadEdge "ARG1" . :toReifyWithHeadEdge "ARG1" ;
:label "mod" .
### https://amr.tetras-libre.fr/rdf/schema#role_name ### https://amr.tetras-libre.fr/rdf/schema#role_name
:role_name rdf:type owl:Class ; :role_name rdf:type owl:Class ;
rdfs:subClassOf :AMR_NonCore_Role . rdfs:subClassOf :AMR_NonCore_Role ;
:label "name" .
### https://amr.tetras-libre.fr/rdf/schema#role_op1 ### https://amr.tetras-libre.fr/rdf/schema#role_op1
:role_op1 rdf:type owl:Class ; :role_op1 rdf:type owl:Class ;
rdfs:subClassOf :AMR_Op_Role . rdfs:subClassOf :AMR_Op_Role ;
:label "op1" .
### https://amr.tetras-libre.fr/rdf/schema#role_op2 ### https://amr.tetras-libre.fr/rdf/schema#role_op2
:role_op2 rdf:type owl:Class ; :role_op2 rdf:type owl:Class ;
rdfs:subClassOf :AMR_Op_Role . rdfs:subClassOf :AMR_Op_Role ;
:label "op2" .
### https://amr.tetras-libre.fr/rdf/schema#role_op3 ### https://amr.tetras-libre.fr/rdf/schema#role_op3
:role_op3 rdf:type owl:Class ; :role_op3 rdf:type owl:Class ;
rdfs:subClassOf :AMR_Op_Role . rdfs:subClassOf :AMR_Op_Role ;
:label "op3" .
### https://amr.tetras-libre.fr/rdf/schema#role_op4 ### https://amr.tetras-libre.fr/rdf/schema#role_op4
:role_op4 rdf:type owl:Class ; :role_op4 rdf:type owl:Class ;
rdfs:subClassOf :AMR_Op_Role . rdfs:subClassOf :AMR_Op_Role ;
:label "op4" .
### https://amr.tetras-libre.fr/rdf/schema#role_op5 ### https://amr.tetras-libre.fr/rdf/schema#role_op5
:role_op5 rdf:type owl:Class ; :role_op5 rdf:type owl:Class ;
rdfs:subClassOf :AMR_Op_Role . rdfs:subClassOf :AMR_Op_Role ;
:label "op5" .
### https://amr.tetras-libre.fr/rdf/schema#role_op6 ### https://amr.tetras-libre.fr/rdf/schema#role_op6
:role_op6 rdf:type owl:Class ; :role_op6 rdf:type owl:Class ;
rdfs:subClassOf :AMR_Op_Role . rdfs:subClassOf :AMR_Op_Role ;
:label "op6" .
### https://amr.tetras-libre.fr/rdf/schema#role_op7 ### https://amr.tetras-libre.fr/rdf/schema#role_op7
:role_op7 rdf:type owl:Class ; :role_op7 rdf:type owl:Class ;
rdfs:subClassOf :AMR_Op_Role . rdfs:subClassOf :AMR_Op_Role ;
:label "op7" .
### https://amr.tetras-libre.fr/rdf/schema#role_op8 ### https://amr.tetras-libre.fr/rdf/schema#role_op8
:role_op8 rdf:type owl:Class ; :role_op8 rdf:type owl:Class ;
rdfs:subClassOf :AMR_Op_Role . rdfs:subClassOf :AMR_Op_Role ;
:label "op8" .
### https://amr.tetras-libre.fr/rdf/schema#role_op9 ### https://amr.tetras-libre.fr/rdf/schema#role_op9
:role_op9 rdf:type owl:Class ; :role_op9 rdf:type owl:Class ;
rdfs:subClassOf :AMR_Op_Role . rdfs:subClassOf :AMR_Op_Role ;
:label "op9" .
### https://amr.tetras-libre.fr/rdf/schema#role_part ### https://amr.tetras-libre.fr/rdf/schema#role_part
...@@ -527,7 +600,8 @@ ns1:Role rdf:type owl:Class ; ...@@ -527,7 +600,8 @@ ns1:Role rdf:type owl:Class ;
### https://amr.tetras-libre.fr/rdf/schema#role_quant ### https://amr.tetras-libre.fr/rdf/schema#role_quant
:role_quant rdf:type owl:Class ; :role_quant rdf:type owl:Class ;
rdfs:subClassOf :AMR_Specific_Role . rdfs:subClassOf :AMR_Specific_Role ;
:label "quant" .
################################################################# #################################################################
......
...@@ -226,69 +226,69 @@ rule_set['reclassify-concept-5'] = { ...@@ -226,69 +226,69 @@ rule_set['reclassify-concept-5'] = {
# --------------------------------------------- # ---------------------------------------------
# Reclassification of roles # Reclassification of roles *** OLD ***
# --------------------------------------------- # ---------------------------------------------
rule_set['reclassify-role-1'] = { # rule_set['reclassify-role-1'] = {
'label': "reclassify-role-1", # 'label': "reclassify-role-1",
'comment': "Reclassify role to AMR core role", # 'comment': "Reclassify role to AMR core role",
'construction': """ # 'construction': """
# -- New AMR core role # # -- New AMR core role
?newRole rdfs:subClassOf amr:AMR_Core_Role ; # ?newRole rdfs:subClassOf amr:AMR_Core_Role ;
amr:label ?roleId ; # amr:label ?roleId ;
amr:fromAmrLk ?r. # amr:fromAmrLk ?r.
""", # """,
'clause': """ # 'clause': """
# -- Identify core role # # -- Identify core role
?r a ns1:FrameRole. # ?r a ns1:FrameRole.
""", # """,
'binding':""" # 'binding':"""
# -- Label # # -- Label
BIND (strafter(str(?r), '#') AS ?rLabel1) # BIND (strafter(str(?r), '#') AS ?rLabel1)
BIND (strafter(str(?r), str(ns1:)) AS ?rLabel2) # BIND (strafter(str(?r), str(ns1:)) AS ?rLabel2)
BIND (IF (STRLEN(?rLabel1) > 0, ?rLabel1, ?rLabel2) AS ?rLabel) # BIND (IF (STRLEN(?rLabel1) > 0, ?rLabel1, ?rLabel2) AS ?rLabel)
# -- Id # # -- Id
BIND (strbefore(?rLabel, '.') AS ?rolesetId) # BIND (strbefore(?rLabel, '.') AS ?rolesetId)
BIND (strafter(?rLabel, '.') AS ?roleId) # BIND (strafter(?rLabel, '.') AS ?roleId)
# -- New role # # -- New role
BIND (CONCAT(str(amr:), 'role') AS ?n1). # BIND (CONCAT(str(amr:), 'role') AS ?n1).
BIND (CONCAT(?n1, '_', ?roleId) AS ?n2). # BIND (CONCAT(?n1, '_', ?roleId) AS ?n2).
BIND (uri(?n2) AS ?newRole). # BIND (uri(?n2) AS ?newRole).
""" # """
} # }
rule_set['reclassify-role-2'] = {
'label': "reclassify-rolet-2",
'comment': "Reclassify role to AMR non-core role",
'construction': """
# -- New AMR non core role
?newRole rdfs:subClassOf amr:AMR_NonCore_Role ;
amr:label ?rLabel ;
amr:fromAmrLk ?r.
""",
'clause': """
# -- Identify non core role
?r a ns3:Role.
FILTER ( ?r != ns1:FrameRole ).
# -- Filter core role # rule_set['reclassify-role-2'] = {
FILTER NOT EXISTS {?newRole rdfs:subClassOf* amr:AMR_Role ; # 'label': "reclassify-rolet-2",
amr:fromAmrLk ?r.} # 'comment': "Reclassify role to AMR non-core role",
""", # 'construction': """
'binding':""" # # -- New AMR non core role
# -- Label # ?newRole rdfs:subClassOf amr:AMR_NonCore_Role ;
BIND (strafter(str(?r), '#') AS ?rLabel1) # amr:label ?rLabel ;
BIND (strafter(str(?r), str(ns1:)) AS ?rLabel2) # amr:fromAmrLk ?r.
BIND (IF (STRLEN(?rLabel1) > 0, ?rLabel1, ?rLabel2) AS ?rLabel) # """,
# 'clause': """
# # -- Identify non core role
# ?r a ns3:Role.
# FILTER ( ?r != ns1:FrameRole ).
# -- New role # # -- Filter core role
BIND (CONCAT(str(amr:), 'role') AS ?n1). # FILTER NOT EXISTS {?newRole rdfs:subClassOf* amr:AMR_Role ;
BIND (CONCAT(?n1, '_', ?rLabel) AS ?n2). # amr:fromAmrLk ?r.}
BIND (uri(?n2) AS ?newRole). # """,
""" # 'binding':"""
} # # -- Label
# BIND (strafter(str(?r), '#') AS ?rLabel1)
# BIND (strafter(str(?r), str(ns1:)) AS ?rLabel2)
# BIND (IF (STRLEN(?rLabel1) > 0, ?rLabel1, ?rLabel2) AS ?rLabel)
# # -- New role
# BIND (CONCAT(str(amr:), 'role') AS ?n1).
# BIND (CONCAT(?n1, '_', ?rLabel) AS ?n2).
# BIND (uri(?n2) AS ?newRole).
# """
# }
# --------------------------------------------- # ---------------------------------------------
...@@ -417,6 +417,7 @@ rule_set['add-new-variable-for-reified-concept'] = { ...@@ -417,6 +417,7 @@ rule_set['add-new-variable-for-reified-concept'] = {
'construction': """ 'construction': """
# -- New variable # -- New variable
?newVariable a amr:AMR_Variable ; ?newVariable a amr:AMR_Variable ;
amr:isReifiedVariable true ;
amr:label ?vLabel. amr:label ?vLabel.
# -- Linking new variable to LK role (for tracing) # -- Linking new variable to LK role (for tracing)
...@@ -499,21 +500,24 @@ rule_set['add-amr-leaf-for-reified-concept'] = { ...@@ -499,21 +500,24 @@ rule_set['add-amr-leaf-for-reified-concept'] = {
'construction': """ 'construction': """
# -- New leaf # -- New leaf
?newLeaf a amr:AMR_Leaf ; ?newLeaf a amr:AMR_Leaf ;
amr:hasVariable ?newV ; amr:isReifiedLeaf true ;
amr:hasVariable ?v ;
amr:hasConcept ?c. amr:hasConcept ?c.
""", """,
'clause': """ 'clause': """
# -- Identify (concept, variable) tuples # -- Identify reified concept
?c rdfs:subClassOf* amr:AMR_Concept ; ?c rdfs:subClassOf* amr:AMR_Concept ;
amr:isReifiedConcept true ;
amr:label ?cLabel ; amr:label ?cLabel ;
amr:fromAmrLk ?linkedC. amr:fromAmrLk ?linkedC.
# -- Identify new variable # -- Identify reified variable
?newV a amr:AMR_Variable ; ?v a amr:AMR_Variable ;
amr:isReifiedVariable true ;
amr:label ?vLabel. amr:label ?vLabel.
# -- identify matching between concept and (new) variable # -- Identify matching between reified concept and variable
?newV a ?linkedC. ?v a ?linkedC.
""", """,
'binding':""" 'binding':"""
# -- New labels # -- New labels
...@@ -535,7 +539,6 @@ rule_set['add-amr-leaf-for-reified-concept'] = { ...@@ -535,7 +539,6 @@ rule_set['add-amr-leaf-for-reified-concept'] = {
# Addition of edges # Addition of edges
# --------------------------------------------- # ---------------------------------------------
rule_set['add-amr-edge-for-core-relation'] = { rule_set['add-amr-edge-for-core-relation'] = {
'label': "add-amr-edge-for-core-relation", 'label': "add-amr-edge-for-core-relation",
'comment': ("Add AMR edge corresponding to: ", 'comment': ("Add AMR edge corresponding to: ",
...@@ -543,9 +546,10 @@ rule_set['add-amr-edge-for-core-relation'] = { ...@@ -543,9 +546,10 @@ rule_set['add-amr-edge-for-core-relation'] = {
'construction': """ 'construction': """
# -- New edge # -- New edge
?newEdge a amr:AMR_Edge ; ?newEdge a amr:AMR_Edge ;
amr:hasRolesetID ?rolesetId ; amr:hasRoleID ?roleId.
amr:hasRoleID ?roleId ; # -- old --- amr:hasRolesetID ?rolesetId ;
amr:hasRoleTag ?roleTag. # -- old --- amr:hasRoleID ?roleId ;
# -- old --- amr:hasRoleTag ?roleTag.
# -- New relation between leafs # -- New relation between leafs
?leaf1 ?newEdge ?leaf2. ?leaf1 ?newEdge ?leaf2.
...@@ -555,6 +559,13 @@ rule_set['add-amr-edge-for-core-relation'] = { ...@@ -555,6 +559,13 @@ rule_set['add-amr-edge-for-core-relation'] = {
?r a ?amrLkRelation. ?r a ?amrLkRelation.
VALUES ?amrLkRelation {ns1:FrameRole ns3:Role} VALUES ?amrLkRelation {ns1:FrameRole ns3:Role}
# -- Filter reified role
FILTER NOT EXISTS {
?newConcept rdfs:subClassOf amr:AMR_Predicat_Concept ;
amr:isReifiedConcept true ;
amr:fromAmrLk ?r.
}
# -- identify leafs and variables # -- identify leafs and variables
?leaf1 amr:hasVariable ?v1. ?leaf1 amr:hasVariable ?v1.
?leaf2 amr:hasVariable ?v2. ?leaf2 amr:hasVariable ?v2.
...@@ -574,14 +585,13 @@ rule_set['add-amr-edge-for-core-relation'] = { ...@@ -574,14 +585,13 @@ rule_set['add-amr-edge-for-core-relation'] = {
BIND (strafter(str(?r), str(ns1:)) AS ?rLabel2) BIND (strafter(str(?r), str(ns1:)) AS ?rLabel2)
BIND (IF (STRLEN(?rLabel1) > 0, ?rLabel1, ?rLabel2) AS ?rLabel) BIND (IF (STRLEN(?rLabel1) > 0, ?rLabel1, ?rLabel2) AS ?rLabel)
BIND (IF (CONTAINS(?rLabel, "."), BIND (IF (CONTAINS(?rLabel, "."),
?rLabel, strafter(?rLabel, '.'),
CONCAT("amr.", ?rLabel)) AS ?roleTag) ?rLabel) AS ?roleId)
BIND (strbefore(?roleTag, '.') AS ?rolesetId) # -- old --- BIND (IF (STRLEN(?rLabel1) > 0, ?rLabel1, ?rLabel2) AS ?rLabel3)
BIND (strafter(?roleTag, '.') AS ?roleId) # -- old --- BIND (IF (CONTAINS(?rLabel3, "."), ?rLabel3, CONCAT("amr.", ?rLabel3)) AS ?roleTag)
BIND (IF (STRLEN(?roleId) > 0, ?roleId, ?rLabel) AS ?rLabel) # -- old --- BIND (strbefore(?roleTag, '.') AS ?rolesetId)
# -- old --- BIND (?rLabel AS ?roleTag) # -- old --- BIND (strafter(?roleTag, '.') AS ?roleId)
# -- old --- BIND (strafter(str(?v1), '#') AS ?v1Label) # -- old --- BIND (IF (STRLEN(?roleId) > 0, ?roleId, ?rLabel3) AS ?rLabel)
# -- old --- BIND (strafter(str(?v2), '#') AS ?v2Label)
# -- New edge # -- New edge
BIND (CONCAT(str(amr:), 'edge') AS ?n1). BIND (CONCAT(str(amr:), 'edge') AS ?n1).
...@@ -592,6 +602,94 @@ rule_set['add-amr-edge-for-core-relation'] = { ...@@ -592,6 +602,94 @@ rule_set['add-amr-edge-for-core-relation'] = {
""" """
} }
rule_set['add-amr-edge-for-reified-concept'] = {
'label': "add-amr-edge-for-reified-concept",
'comment': ("Add AMR edge corresponding to: ",
" (x) reification of LK non-core relation to concept"),
'construction': """
# -- New edge (ARG0)
?newEdge0 a amr:AMR_Edge ;
amr:hasRoleID ?roleId0.
# -- old --- amr:hasRolesetID ?rolesetId0 ;
# -- old --- amr:hasRoleID ?roleId0 ;
# -- old --- amr:hasRoleTag ?roleTag0.
# -- New edge (ARG1)
?newEdge1 a amr:AMR_Edge ;
amr:hasRoleID ?roleId1.
# -- old --- amr:hasRolesetID ?rolesetId1 ;
# -- old --- amr:hasRoleID ?roleId1 ;
# -- old --- amr:hasRoleTag ?roleTag1.
# -- New relations between leafs
?reifiedLeaf ?newEdge0 ?leaf1.
?reifiedLeaf ?newEdge1 ?leaf2.
""",
'clause': """
# -- Identify reified leaf
?reifiedLeaf a amr:AMR_Leaf ;
amr:isReifiedLeaf true ;
amr:hasVariable ?reifiedVariable ;
amr:hasConcept ?reifiedConcept.
?reifiedVariable amr:label ?rvLabel.
# -- Identify LK relation corresponding to the reified concept
?reifiedConcept amr:fromAmrLk ?r.
# -- Identify leafs and variables
?leaf1 amr:hasVariable ?v1.
?leaf2 amr:hasVariable ?v2.
?v1 a amr:AMR_Variable ;
amr:label ?v1Label ;
amr:fromAmrLk ?v1Link.
?v2 a amr:AMR_Variable ;
amr:label ?v2Label ;
amr:fromAmrLk ?v2Link.
# -- Identify matching
?v1Link ?r ?v2Link.
""",
'binding':"""
# -- New labels
# -- old --- BIND (strafter(str(?r), '#') AS ?rLabel1)
# -- old --- BIND (strafter(str(?r), str(ns1:)) AS ?rLabel2)
# -- old --- BIND (IF (STRLEN(?rLabel1) > 0, ?rLabel1, ?rLabel2) AS ?rLabel3)
# -- old --- BIND (IF (CONTAINS(?rLabel3, "."),
# -- old --- ?rLabel3,
# -- old --- CONCAT("amr.", ?rLabel3)) AS ?roleTag)
# -- old --- BIND (strbefore(?roleTag, '.') AS ?rolesetId)
# -- old --- BIND (strafter(?roleTag, '.') AS ?roleId)
# -- old --- BIND (IF (STRLEN(?roleId) > 0, ?roleId, ?rLabel3) AS ?rLabel)
# -- New labels for ARG0 edge
# -- old --- BIND ("amr.ARG0" AS ?roleTag0)
# -- old --- BIND (strbefore(?roleTag0, '.') AS ?rolesetId0)
# -- old --- BIND (strafter(?roleTag0, '.') AS ?roleId0)
# -- New labels for ARG1 edge
# -- old --- BIND ("amr.ARG1" AS ?roleTag1)
# -- old --- BIND (strbefore(?roleTag1, '.') AS ?rolesetId1)
# -- old --- BIND (strafter(?roleTag1, '.') AS ?roleId1)
# -- New labels
BIND ("ARG0" AS ?roleId0)
BIND ("ARG1" AS ?roleId1)
# -- New edge (ARG0)
BIND (CONCAT(str(amr:), 'edge') AS ?n01).
BIND (CONCAT(?n01, '_', ?v1Label) AS ?n02).
BIND (CONCAT(?n02, '_', ?roleId0) AS ?n03).
BIND (CONCAT(?n03, '_', ?rvLabel) AS ?n04).
BIND (uri(?n04) AS ?newEdge0).
# -- New edge (ARG1)
BIND (CONCAT(str(amr:), 'edge') AS ?n11).
BIND (CONCAT(?n11, '_', ?rvLabel) AS ?n12).
BIND (CONCAT(?n12, '_', ?roleId1) AS ?n13).
BIND (CONCAT(?n13, '_', ?v2Label) AS ?n14).
BIND (uri(?n14) AS ?newEdge1).
"""
}
rule_set['add-amr-edge-for-name-relation'] = { rule_set['add-amr-edge-for-name-relation'] = {
'label': "add-amr-edge-for-name-relation", 'label': "add-amr-edge-for-name-relation",
...@@ -604,9 +702,10 @@ rule_set['add-amr-edge-for-name-relation'] = { ...@@ -604,9 +702,10 @@ rule_set['add-amr-edge-for-name-relation'] = {
# -- New edge # -- New edge
?newEdge a amr:AMR_Edge ; ?newEdge a amr:AMR_Edge ;
amr:hasRolesetID ?rolesetId ; amr:hasRoleID ?roleId.
amr:hasRoleID ?roleId ; # -- old --- amr:hasRolesetID ?rolesetId ;
amr:hasRoleTag ?roleTag. # -- old --- amr:hasRoleID ?roleId ;
# -- old --- amr:hasRoleTag ?roleTag.
# -- New relation between leaf and value # -- New relation between leaf and value
?leaf ?newEdge ?newValue. ?leaf ?newEdge ?newValue.
...@@ -656,9 +755,10 @@ rule_set['add-amr-edge-for-quant-relation'] = { ...@@ -656,9 +755,10 @@ rule_set['add-amr-edge-for-quant-relation'] = {
# -- New edge # -- New edge
?newEdge a amr:AMR_Edge ; ?newEdge a amr:AMR_Edge ;
amr:hasRolesetID ?rolesetId ; amr:hasRoleID ?roleId.
amr:hasRoleID ?roleId ; # -- old --- amr:hasRolesetID ?rolesetId ;
amr:hasRoleTag ?roleTag. # -- old --- amr:hasRoleID ?roleId ;
# -- old --- amr:hasRoleTag ?roleTag.
# -- New relation between leaf and value # -- New relation between leaf and value
?leaf ?newEdge ?newValue. ?leaf ?newEdge ?newValue.
...@@ -706,9 +806,10 @@ rule_set['add-amr-edge-for-polarity-relation'] = { ...@@ -706,9 +806,10 @@ rule_set['add-amr-edge-for-polarity-relation'] = {
# -- New edge # -- New edge
?newEdge a amr:AMR_Edge ; ?newEdge a amr:AMR_Edge ;
amr:hasRolesetID ?rolesetId ; amr:hasRoleID ?roleId.
amr:hasRoleID ?roleId ; # -- old --- amr:hasRolesetID ?rolesetId ;
amr:hasRoleTag ?roleTag. # -- old --- amr:hasRoleID ?roleId ;
# -- old --- amr:hasRoleTag ?roleTag.
# -- New relation between leaf and value # -- New relation between leaf and value
?leaf ?newEdge ?newValue. ?leaf ?newEdge ?newValue.
...@@ -749,7 +850,7 @@ rule_set['add-amr-edge-for-polarity-relation'] = { ...@@ -749,7 +850,7 @@ rule_set['add-amr-edge-for-polarity-relation'] = {
# --------------------------------------------- # ---------------------------------------------
# Update leafs and edges # Update leafs and edges *** TODO ***
# --------------------------------------------- # ---------------------------------------------
rule_set['update-amr-edge-role-1'] = { rule_set['update-amr-edge-role-1'] = {
...@@ -770,23 +871,23 @@ rule_set['update-amr-edge-role-1'] = { ...@@ -770,23 +871,23 @@ rule_set['update-amr-edge-role-1'] = {
'binding': '' 'binding': ''
} }
rule_set['update-amr-edge-role-2'] = { # rule_set['update-amr-edge-role-2'] = {
'label': "update-amr-edge-role-2", # 'label': "update-amr-edge-role-2",
'comment': ("Update AMR edge by adding relation with AMR_Role", # 'comment': ("Update AMR edge by adding relation with AMR_Role",
"(using comparison between label and role tag)"), # "(using comparison between label and role tag)"),
'construction': """ # 'construction': """
?edge amr:hasAmrRole ?role. # ?edge amr:hasAmrRole ?role.
""", # """,
'clause': """ # 'clause': """
?edge a amr:AMR_Edge ; # ?edge a amr:AMR_Edge ;
amr:hasRoleTag ?edgeRoleId. # amr:hasRoleTag ?edgeRoleId.
?role rdfs:subClassOf* amr:AMR_Role ; # ?role rdfs:subClassOf* amr:AMR_Role ;
amr:label ?roleLabel. # amr:label ?roleLabel.
FILTER ( ?roleLabel != '' ). # FILTER ( ?roleLabel != '' ).
FILTER ( ?edgeRoleId = ?roleLabel ). # FILTER ( ?edgeRoleId = ?roleLabel ).
""", # """,
'binding': '' # 'binding': ''
} # }
# --------------------------------------------- # ---------------------------------------------
......
...@@ -76,21 +76,22 @@ amr_reification_sequence = { ...@@ -76,21 +76,22 @@ amr_reification_sequence = {
'reclassify-concept-3', 'reclassify-concept-3',
'reclassify-concept-4', 'reclassify-concept-4',
'reclassify-concept-5', 'reclassify-concept-5',
'reclassify-role-1', # --old --- 'reclassify-role-1',
'reclassify-role-2', # --old --- 'reclassify-role-2',
'reify-roles-as-concept', 'reify-roles-as-concept',
'reclassify-existing-variable', 'reclassify-existing-variable',
'add-new-variable-for-reified-concept', 'add-new-variable-for-reified-concept',
'add-amr-leaf-for-reclassified-concept', 'add-amr-leaf-for-reclassified-concept',
'add-amr-leaf-for-reified-concept', 'add-amr-leaf-for-reified-concept',
'add-amr-edge-for-core-relation', 'add-amr-edge-for-core-relation',
'add-amr-edge-for-reified-concept',
'add-amr-edge-for-name-relation', 'add-amr-edge-for-name-relation',
'add-amr-edge-for-quant-relation', 'add-amr-edge-for-quant-relation',
'add-amr-edge-for-polarity-relation', 'add-amr-edge-for-polarity-relation',
# --old --- 'set-amr-label-for-variables', # --old --- 'set-amr-label-for-variables',
# --old --- 'set-amr-label-for-roles', # --old --- 'set-amr-label-for-roles',
'update-amr-edge-role-1', 'update-amr-edge-role-1',
'update-amr-edge-role-2', # --old --- 'update-amr-edge-role-2',
'add-amr-root'] 'add-amr-root']
} }
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment