From 662fc703f28bdbff3a97fe597e584d67a4c6924b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Lamercerie?= <aurelien.lamercerie@tetras-libre.fr> Date: Mon, 19 Jun 2023 10:35:39 +0200 Subject: [PATCH] Cleaning code (2) --- tenet/scheme/amr_clara_rule/__init__.py | 36 +- tenet/scheme/amr_clara_rule/nov_generation.py | 645 -------- .../nov_transduction/__init__.py | 1 - .../nov_transduction/atomic_extraction.py | 371 ----- .../nov_transduction/classification.py | 364 ---- .../composite_class_extraction_1.py | 457 ----- .../composite_class_extraction_2.py | 291 ---- .../composite_property_extraction.py | 228 --- .../phenomena_application_and.py | 254 --- .../phenomena_application_mod.py | 133 -- .../phenomena_application_polarity.py | 69 - .../nov_transduction/phenomena_checking.py | 172 -- .../nov_transduction/technical_ctr.py | 80 - .../amr_clara_rule/owl_generation/__init__.py | 1 - .../owl_generation/owl_property_generator.py | 192 --- tenet/scheme/amr_clara_rule/preprocessing.py | 445 ----- .../amr_clara_rule/preprocessing/__init__.py | 1 - .../preprocessing/amr_bug_fixing_1.py | 86 + .../preprocessing/amr_reification.py | 934 ----------- .../preprocessing/amr_reification_1.py | 96 ++ .../preprocessing/amr_reification_10.py | 86 + .../preprocessing/amr_reification_11.py | 90 + .../preprocessing/amr_reification_12.py | 105 ++ .../preprocessing/amr_reification_13.py | 90 + .../preprocessing/amr_reification_14.py | 95 ++ .../preprocessing/amr_reification_15.py | 92 ++ .../preprocessing/amr_reification_16.py | 67 + .../preprocessing/amr_reification_17.py | 91 + .../preprocessing/amr_reification_2.py | 91 + .../preprocessing/amr_reification_3.py | 88 + .../preprocessing/amr_reification_4.py | 91 + .../preprocessing/amr_reification_5.py | 88 + .../preprocessing/amr_reification_6.py | 98 ++ .../preprocessing/amr_reification_7.py | 92 ++ .../preprocessing/amr_reification_8.py | 90 + .../preprocessing/amr_reification_9.py | 79 + .../preprocessing/amrld_correcting.py | 49 - .../scheme/amr_master_rule/__rule_pattern.py | 169 -- tenet/scheme/odrl_amr_scheme_1.py | 94 +- tenet/scheme/owl_amr_scheme_1.py | 3 +- .../main_tests}/__rule_pattern.py | 0 .../aos16-20230619/aos16_factoid.ttl | 11 + .../aos16-20230619/technical-data/tenet.log | 159 ++ .../tenet.tetras-libre.fr_demo_clara_16.ttl | 830 ++++++++++ ...s-libre.fr_demo_clara_16_Preprocessing.ttl | 1090 ++++++++++++ ....tetras-libre.fr_demo_clara_16_factoid.ttl | 11 + ...tras-libre.fr_demo_clara_16_generation.ttl | 1466 +++++++++++++++++ ...s-libre.fr_demo_clara_16_preprocessing.ttl | 1090 ++++++++++++ ...as-libre.fr_demo_clara_16_transduction.ttl | 1457 ++++++++++++++++ .../technical-data/tenet.log | 96 +- 50 files changed, 7849 insertions(+), 4965 deletions(-) delete mode 100644 tenet/scheme/amr_clara_rule/nov_generation.py delete mode 100644 tenet/scheme/amr_clara_rule/nov_transduction/__init__.py delete mode 100644 tenet/scheme/amr_clara_rule/nov_transduction/atomic_extraction.py delete mode 100644 tenet/scheme/amr_clara_rule/nov_transduction/classification.py delete mode 100644 tenet/scheme/amr_clara_rule/nov_transduction/composite_class_extraction_1.py delete mode 100644 tenet/scheme/amr_clara_rule/nov_transduction/composite_class_extraction_2.py delete mode 100644 tenet/scheme/amr_clara_rule/nov_transduction/composite_property_extraction.py delete mode 100644 tenet/scheme/amr_clara_rule/nov_transduction/phenomena_application_and.py delete mode 100644 tenet/scheme/amr_clara_rule/nov_transduction/phenomena_application_mod.py delete mode 100644 tenet/scheme/amr_clara_rule/nov_transduction/phenomena_application_polarity.py delete mode 100644 tenet/scheme/amr_clara_rule/nov_transduction/phenomena_checking.py delete mode 100644 tenet/scheme/amr_clara_rule/nov_transduction/technical_ctr.py delete mode 100644 tenet/scheme/amr_clara_rule/owl_generation/__init__.py delete mode 100644 tenet/scheme/amr_clara_rule/owl_generation/owl_property_generator.py delete mode 100644 tenet/scheme/amr_clara_rule/preprocessing.py delete mode 100644 tenet/scheme/amr_clara_rule/preprocessing/__init__.py create mode 100644 tenet/scheme/amr_clara_rule/preprocessing/amr_bug_fixing_1.py delete mode 100644 tenet/scheme/amr_clara_rule/preprocessing/amr_reification.py create mode 100644 tenet/scheme/amr_clara_rule/preprocessing/amr_reification_1.py create mode 100644 tenet/scheme/amr_clara_rule/preprocessing/amr_reification_10.py create mode 100644 tenet/scheme/amr_clara_rule/preprocessing/amr_reification_11.py create mode 100644 tenet/scheme/amr_clara_rule/preprocessing/amr_reification_12.py create mode 100644 tenet/scheme/amr_clara_rule/preprocessing/amr_reification_13.py create mode 100644 tenet/scheme/amr_clara_rule/preprocessing/amr_reification_14.py create mode 100644 tenet/scheme/amr_clara_rule/preprocessing/amr_reification_15.py create mode 100644 tenet/scheme/amr_clara_rule/preprocessing/amr_reification_16.py create mode 100644 tenet/scheme/amr_clara_rule/preprocessing/amr_reification_17.py create mode 100644 tenet/scheme/amr_clara_rule/preprocessing/amr_reification_2.py create mode 100644 tenet/scheme/amr_clara_rule/preprocessing/amr_reification_3.py create mode 100644 tenet/scheme/amr_clara_rule/preprocessing/amr_reification_4.py create mode 100644 tenet/scheme/amr_clara_rule/preprocessing/amr_reification_5.py create mode 100644 tenet/scheme/amr_clara_rule/preprocessing/amr_reification_6.py create mode 100644 tenet/scheme/amr_clara_rule/preprocessing/amr_reification_7.py create mode 100644 tenet/scheme/amr_clara_rule/preprocessing/amr_reification_8.py create mode 100644 tenet/scheme/amr_clara_rule/preprocessing/amr_reification_9.py delete mode 100644 tenet/scheme/amr_clara_rule/preprocessing/amrld_correcting.py delete mode 100644 tenet/scheme/amr_master_rule/__rule_pattern.py rename {tenet/scheme/amr_clara_rule => tests/main_tests}/__rule_pattern.py (100%) create mode 100644 tests/main_tests/test_odrl_output/aos16-20230619/aos16_factoid.ttl create mode 100644 tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.log create mode 100644 tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16.ttl create mode 100644 tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_Preprocessing.ttl create mode 100644 tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_factoid.ttl create mode 100644 tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_generation.ttl create mode 100644 tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_preprocessing.ttl create mode 100644 tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_transduction.ttl diff --git a/tenet/scheme/amr_clara_rule/__init__.py b/tenet/scheme/amr_clara_rule/__init__.py index d027bc13..70893dd4 100644 --- a/tenet/scheme/amr_clara_rule/__init__.py +++ b/tenet/scheme/amr_clara_rule/__init__.py @@ -1,5 +1,31 @@ -from scheme.amr_clara_rule.preprocessing.amr_reification import * -from scheme.amr_clara_rule.preprocessing.amrld_correcting import * +# ============================================================================= +# Rule Imports +# ============================================================================= + +# -- Preprocessing Rules + +from scheme.amr_clara_rule.preprocessing.amr_bug_fixing_1 import * + +from scheme.amr_clara_rule.preprocessing.amr_reification_1 import * +from scheme.amr_clara_rule.preprocessing.amr_reification_2 import * +from scheme.amr_clara_rule.preprocessing.amr_reification_3 import * +from scheme.amr_clara_rule.preprocessing.amr_reification_4 import * +from scheme.amr_clara_rule.preprocessing.amr_reification_5 import * +from scheme.amr_clara_rule.preprocessing.amr_reification_6 import * +from scheme.amr_clara_rule.preprocessing.amr_reification_7 import * +from scheme.amr_clara_rule.preprocessing.amr_reification_8 import * +from scheme.amr_clara_rule.preprocessing.amr_reification_9 import * +from scheme.amr_clara_rule.preprocessing.amr_reification_10 import * +from scheme.amr_clara_rule.preprocessing.amr_reification_11 import * +from scheme.amr_clara_rule.preprocessing.amr_reification_12 import * +from scheme.amr_clara_rule.preprocessing.amr_reification_13 import * +from scheme.amr_clara_rule.preprocessing.amr_reification_14 import * +from scheme.amr_clara_rule.preprocessing.amr_reification_15 import * +from scheme.amr_clara_rule.preprocessing.amr_reification_16 import * +from scheme.amr_clara_rule.preprocessing.amr_reification_17 import * + + +# -- Transduction Rules from scheme.amr_clara_rule.transduction.atom_class_extractor import * from scheme.amr_clara_rule.transduction.atom_individual_extractor import * @@ -31,6 +57,10 @@ from scheme.amr_clara_rule.transduction.phenomena_and_analyzer_2 import * from scheme.amr_clara_rule.transduction.odrl_action_extractor import * from scheme.amr_clara_rule.transduction.odrl_rule_extractor import * + +# -- Generation Rules + from scheme.amr_clara_rule.odrl_generation.odrl_rule_generator import * -from scheme.amr_clara_rule import * + +# from scheme.amr_clara_rule import * diff --git a/tenet/scheme/amr_clara_rule/nov_generation.py b/tenet/scheme/amr_clara_rule/nov_generation.py deleted file mode 100644 index 5b206fd4..00000000 --- a/tenet/scheme/amr_clara_rule/nov_generation.py +++ /dev/null @@ -1,645 +0,0 @@ -#!/usr/bin/python3.10 -# -*-coding:Utf-8 -* - -#============================================================================== -# TENET: AMR CTR at 'OWL Generation' level -#------------------------------------------------------------------------------ -# Module grouping compositional transduction rule_sets (CTR) for the analysis of -# AMR structures, at 'OWL Generation' level -#============================================================================== - - -#============================================================================== -# CTR Set (CTR as Sparql querries) -#============================================================================== - -rule_set = {} - - -# --------------------------------------------- -# OWL Generation: Preparation -# --------------------------------------------- - -rule_set['compute-uri-for-owl-declaration-1'] = { - 'label': "compute-uri-for-owl-declaration-1", - 'comment': ("Compute URI for OWL declaration: ", - " URI of classes "), - 'construction': """ - ?net1 net:hasClassURI ?newClassUri. - """, - 'clause': """ - ?net1 a [rdfs:subClassOf* net:Class_Net] ; - net:hasClassName ?className. - FILTER NOT EXISTS { ?net1 net:deprecated true. } - FILTER NOT EXISTS { ?net1 a net:Deprecated_Net. } - """, - 'binding': """ - BIND (CONCAT(str(ext-out:), str(?className)) AS ?c1). - BIND (uri(?c1) AS ?newClassUri). - """ -} - -rule_set['compute-uri-for-owl-declaration-2'] = { - 'label': "compute-uri-for-owl-declaration-2", - 'comment': ("Compute URI for OWL declaration: ", - " URI of mother classes "), - 'construction': """ - ?motherClassNet net:hasClassURI ?newClassUri. - """, - 'clause': """ - ?net1 a [rdfs:subClassOf* net:Class_Net] ; - net:hasMotherClassNet ?motherClassNet. - ?motherClassNet a [rdfs:subClassOf* net:Class_Net] ; - net:hasClassName ?motherClassName. - """, - 'binding': """ - BIND (CONCAT(str(ext-out:), str(?motherClassName)) AS ?c1). - BIND (uri(?c1) AS ?newClassUri). - """ -} - -rule_set['compute-uri-for-owl-declaration-3'] = { - 'label': "compute-uri-for-owl-declaration-3", - 'comment': ("Compute URI for OWL declaration: ", - " URI of individuals "), - 'construction': """ - ?net1 net:hasIndividualURI ?newIndividualUri. - """, - 'clause': """ - ?net1 a net:Individual_Net ; - net:hasIndividualLabel ?individualLabel. - FILTER NOT EXISTS { ?net1 net:deprecated true. } - FILTER NOT EXISTS { ?net1 a net:Deprecated_Net. } - """, - 'binding': """ - BIND (REPLACE(?individualLabel, ' ', "-") AS ?iName1). - BIND (LCASE(str(?iName1)) AS ?iName2). - BIND (CONCAT(str(ext-out:), str(?iName2)) AS ?iName3). - BIND (uri(?iName3) AS ?newIndividualUri). - """ -} - -rule_set['compute-uri-for-owl-declaration-4'] = { - 'label': "compute-uri-for-owl-declaration-4", - 'comment': ("Compute URI for OWL declaration: ", - " mother class URI of individuals ", - " (case with a base ontology class) "), - 'construction': """ - ?net1 net:hasMotherClassURI ?newMotherClassUri. - """, - 'clause': """ - ?net1 a net:Individual_Net ; - net:hasBaseClassName ?motherClassName. - FILTER NOT EXISTS { ?net1 net:deprecated true. } - FILTER NOT EXISTS { ?net1 a net:Deprecated_Net. } - """, - 'binding': """ - BIND (CONCAT(str(base-out:), str(?motherClassName)) AS ?c1). - BIND (uri(?c1) AS ?newMotherClassUri). - """ -} - -rule_set['compute-uri-for-owl-declaration-5'] = { - 'label': "compute-uri-for-owl-declaration-5", - 'comment': ("Compute URI for OWL declaration: ", - " URI of properties "), - 'construction': """ - ?net1 net:hasPropertyURI ?newPropertyUri. - """, - 'clause': """ - ?net1 a [rdfs:subClassOf* net:Property_Net] ; - net:hasPropertyName ?propertyName. - FILTER NOT EXISTS { ?net1 net:deprecated true. } - FILTER NOT EXISTS { ?net1 a net:Deprecated_Net. } - """, - 'binding': """ - BIND (CONCAT(str(ext-out:), str(?propertyName)) AS ?c1). - BIND (uri(?c1) AS ?newPropertyUri). - """ -} - -rule_set['compute-uri-for-owl-declaration-6'] = { - 'label': "compute-uri-for-owl-declaration-6", - 'comment': ("Compute URI for OWL declaration: ", - " URI of properties (variant 12) "), - 'construction': """ - ?net1 net:hasProperty12URI ?newPropertyUri. - """, - 'clause': """ - ?net1 a [rdfs:subClassOf* net:Property_Net] ; - net:hasPropertyName12 ?propertyName12. - FILTER NOT EXISTS { ?net1 net:deprecated true. } - FILTER NOT EXISTS { ?net1 a net:Deprecated_Net. } - """, - 'binding': """ - BIND (CONCAT(str(ext-out:), str(?propertyName12)) AS ?c1). - BIND (uri(?c1) AS ?newPropertyUri). - """ -} - -rule_set['compute-uri-for-owl-declaration-7'] = { - 'label': "compute-uri-for-owl-declaration-7", - 'comment': ("Compute URI for OWL declaration: ", - " URI of mother properties "), - 'construction': """ - ?motherPropertyNet net:hasPropertyURI ?newPropertyUri. - """, - 'clause': """ - ?net1 a [rdfs:subClassOf* net:Property_Net] ; - net:hasMotherPropertyNet ?motherPropertyNet. - ?motherPropertyNet a [rdfs:subClassOf* net:Property_Net] ; - net:hasPropertyName ?motherPropertyName. - """, - 'binding': """ - BIND (CONCAT(str(ext-out:), str(?motherPropertyName)) AS ?c1). - BIND (uri(?c1) AS ?newPropertyUri). - """ -} - -# *** New Net *** URI from Naming attribute - -# rule_set['compute-uri-for-owl-declaration-101'] = { -# 'label': "compute-uri-for-owl-declaration-101", -# 'comment': ("Compute URI for OWL declaration: ", -# " URI of properties (from Naming) "), -# 'construction': """ -# ?net1 net:hasPropertyURI ?newPropertyUri. -# """, -# 'clause': """ -# ?net1 a [rdfs:subClassOf* net:Property_Net] ; -# net:hasNaming ?propertyName. -# FILTER NOT EXISTS { ?net1 net:deprecated true. } -# FILTER NOT EXISTS { ?net1 a net:Deprecated_Net. } -# """, -# 'binding': """ -# BIND (CONCAT(str(ext-out:), str(?propertyName)) AS ?c1). -# BIND (uri(?c1) AS ?newPropertyUri). -# """ -# } - -# rule_set['compute-uri-for-owl-declaration-102'] = { -# 'label': "compute-uri-for-owl-declaration-102", -# 'comment': ("Compute URI for OWL declaration: ", -# " URI of mother properties (from Naming) "), -# 'construction': """ -# ?motherPropertyNet net:hasPropertyURI ?newPropertyUri. -# """, -# 'clause': """ -# ?net1 a [rdfs:subClassOf* net:Property_Net] ; -# net:hasMotherPropertyNet ?motherPropertyNet. -# ?motherPropertyNet a [rdfs:subClassOf* net:Property_Net] ; -# net:hasNaming ?motherPropertyName. -# """, -# 'binding': """ -# BIND (CONCAT(str(ext-out:), str(?motherPropertyName)) AS ?c1). -# BIND (uri(?c1) AS ?newPropertyUri). -# """ -# } - - - -# --------------------------------------------- -# OWL Generation: Atom Class -# --------------------------------------------- - -rule_set['generate-atom-class'] = { - 'label': "generate-atom-class", - 'comment': "Generate Atom Class in the target ontology", - 'construction': """ - ?newClassUri rdf:type owl:Class ; - rdfs:label ?className ; - base-out:fromStructure ?sentenceRef. - """, - 'clause': """ - ?net1 a net:Atom_Class_Net ; - net:hasClassName ?className ; - net:hasStructure ?sentenceRef ; - net:hasClassURI ?newClassUri. - """, - 'binding': """ - """ -} - -rule_set['classify-atom-class-1'] = { - 'label': "classify-atom-class-1", - 'comment': "Classify Atom Class in the target ontology", - 'construction': """ - ?newClassUri rdfs:subClassOf ?classType. - """, - 'clause': """ - ?net1 a net:Atom_Class_Net ; - net:hasClassType ?classType ; - net:hasClassURI ?newClassUri. - """, - 'binding': """ - """ -} - -rule_set['classify-atom-class-2'] = { - 'label': "classify-atom-class-2", - 'comment': "Classify Atom Class in the target ontology", - 'construction': """ - ?newClassUri rdfs:subClassOf base-out:Undetermined_Thing. - """, - 'clause': """ - ?net1 a net:Atom_Class_Net ; - net:hasClassURI ?newClassUri. - FILTER NOT EXISTS { ?net1 net:hasClassType ?classType. } - FILTER NOT EXISTS { ?newClassUri rdfs:subClassOf* base-out:Out_Structure. } - """, - 'binding': """ - """ -} - - - - -# --------------------------------------------- -# OWL Generation: Individual -# --------------------------------------------- - -rule_set['generate-individual'] = { - 'label': "generate-individual", - 'comment': "Generate Individual in the target ontology", - 'construction': """ - ?newIndividualUri a owl:individual ; - rdfs:label ?individualLabel ; - base-out:fromStructure ?sentenceRef. - """, - 'clause': """ - ?net1 a net:Individual_Net ; - net:hasIndividualLabel ?individualLabel ; - net:hasIndividualURI ?newIndividualUri. - OPTIONAL { ?net1 net:hasStructure ?sentenceRef. } - """, - 'binding': """ - """ -} - -rule_set['classify-individual-1'] = { - 'label': "classify-individual-1", - 'comment': "Classify Individual in the target ontology", - 'construction': """ - ?newIndividualUri a ?motherClassURI. - """, - 'clause': """ - ?net1 a net:Individual_Net ; - net:hasMotherClassURI ?motherClassURI ; - net:hasIndividualURI ?newIndividualUri. - """, - 'binding': """ - """ -} - -rule_set['classify-individual-2'] = { - 'label': "classify-individual-2", - 'comment': "Classify Individual in the target ontology", - 'construction': """ - ?newIndividualUri a ?motherClassURI. - """, - 'clause': """ - ?net1 a net:Individual_Net ; - net:hasMotherClassNet ?motherClassNet ; - net:hasIndividualURI ?newIndividualUri. - ?motherClassNet a [rdfs:subClassOf* net:Class_Net] ; - net:hasClassURI ?motherClassURI. - # -- old --- FILTER NOT EXISTS { ?motherClassNet net:deprecated true. } - """, - 'binding': """ - """ -} - - -# --------------------------------------------- -# OWL Generation: Atom Property -# --------------------------------------------- - -rule_set['generate-atom-property-1'] = { - 'label': "generate-atom-property-1", - 'comment': "Generate Atom Property in the target ontology", - 'construction': """ - ?newPropertyUri a ?propertyType ; - rdfs:subPropertyOf base-out:Out_ObjectProperty ; - rdfs:label ?propertyName ; - base-out:fromStructure ?sentenceRef. - """, - 'clause': """ - ?net1 a net:Atom_Property_Net ; - net:hasPropertyType ?propertyType ; - net:hasPropertyName ?propertyName ; - net:hasStructure ?sentenceRef ; - net:hasPropertyURI ?newPropertyUri. - """, - 'binding': """ - """ -} - -rule_set['generate-atom-property-12'] = { - 'label': "generate-atom-property-12", - 'comment': "Generate Atom Property (variant 12) in the target ontology", - 'construction': """ - ?newProperty12Uri a ?propertyType ; - rdfs:subPropertyOf base-out:Out_ObjectProperty ; - rdfs:label ?propertyName12 ; - base-out:fromStructure ?sentenceRef. - """, - 'clause': """ - ?net1 a net:Atom_Property_Net ; - net:hasPropertyType ?propertyType ; - net:hasPropertyName12 ?propertyName12 ; - net:hasStructure ?sentenceRef ; - net:hasProperty12URI ?newProperty12Uri. - """, - 'binding': """ - """ -} - -rule_set['generate-inverse-relation'] = { - 'label': "generate-inverse-relation", - 'comment': ("Generate OWL inverseOf relation between two properties", - " in the target ontology"), - 'construction': """ - ?prop1Uri owl:inverseOf ?prop2Uri. - """, - 'clause': """ - ?net1 net:inverseOf ?net2. - ?net1 net:hasPropertyURI ?prop1Uri. - ?net2 net:hasPropertyURI ?prop2Uri. - """, - 'binding': """ - """ -} - - - -# --------------------------------------------- -# OWL Generation: Composite Class (Taxonomy relation) -# --------------------------------------------- - -rule_set['generate-composite-class'] = { - 'label': "generate-composite-class", - 'comment': "Generate Composite Class in the target ontology", - 'construction': """ - ?newClassUri a owl:Class ; - rdfs:subClassOf ?motherClassUri ; - rdfs:label ?className ; - base-out:fromStructure ?sentenceRef. - """, - 'clause': """ - ?net1 a net:Composite_Class_Net ; - net:hasClassName ?className ; - net:hasStructure ?sentenceRef ; - net:hasClassURI ?newClassUri ; - net:hasMotherClassNet ?motherClassNet. - ?motherClassNet net:hasClassURI ?motherClassUri. - """, - 'binding': """ - """ -} - - - -# --------------------------------------------- -# OWL Generation: Class Restriction -# --------------------------------------------- - -rule_set['add-restriction-to-class-1'] = { - 'label': "add-restriction-to-class-1", - 'comment': ("Add restriction to Class: ", - " (1) on property, ", - " (2) with some values from a class ", - " (corresponding to a class net)", - " (3) for standard case"), - 'construction': """ - ?newClassUri a owl:Class ; - rdfs:subClassOf [ - a owl:Restriction ; - owl:onProperty ?onPropertyUri ; - owl:someValuesFrom ?valuesClassUri - ] . - """, - 'clause': """ - ?net1 a [rdfs:subClassOf* net:Class_Net] ; - net:hasClassURI ?newClassUri ; - net:hasRestriction ?restrictionNet. - ?restrictionNet a net:Restriction_Net; - net:hasRestrictionOnProperty ?onPropertyNet ; - net:hasRestrictionNetValue ?valueNet. - ?onPropertyNet net:hasPropertyURI ?onPropertyUri. - ?valueNet a [rdfs:subClassOf* net:Class_Net] ; - net:hasClassURI ?valuesClassUri. - """, - 'binding': """ - """ -} - -rule_set['add-restriction-to-class-2'] = { - 'label': "add-restriction-to-class-2", - 'comment': ("Add restriction to Class: ", - " (1) on property, ", - " (2) with individual for value ", - " (corresponding to an individual net)", - " (3) for standard case"), - 'construction': """ - ?newClassUri a owl:Class ; - rdfs:subClassOf [ - a owl:Restriction ; - owl:onProperty ?onPropertyUri ; - owl:hasValue ?valueIndividualUri - ] . - """, - 'clause': """ - ?net1 a [rdfs:subClassOf* net:Class_Net] ; - net:hasClassURI ?newClassUri ; - net:hasRestriction ?restrictionNet. - ?restrictionNet a net:Restriction_Net; - net:hasRestrictionOnProperty ?onPropertyNet ; - net:hasRestrictionNetValue ?valueNet. - ?onPropertyNet net:hasPropertyURI ?onPropertyUri. - ?valueNet a net:Individual_Net ; - net:hasIndividualURI ?valueIndividualUri. - """, - 'binding': """ - """ -} - -rule_set['add-restriction-to-class-3'] = { - 'label': "add-restriction-to-class-3", - 'comment': ("Add restriction to Class: ", - " (1) on property, ", - " (2) with some values from a class ", - " (corresponding to a class net)", - " (3) for variant 01"), - 'construction': """ - ?newClassUri a owl:Class ; - rdfs:subClassOf [ - a owl:Restriction ; - owl:onProperty ?onPropertyUri ; - owl:someValuesFrom ?valuesClassUri - ] . - """, - 'clause': """ - ?net1 a [rdfs:subClassOf* net:Class_Net] ; - net:hasClassURI ?newClassUri ; - net:hasRestriction01 ?restrictionNet. - ?restrictionNet a net:Restriction_Net; - net:hasRestrictionOnProperty ?onPropertyNet ; - net:hasRestrictionNetValue ?valueNet. - ?onPropertyNet net:hasProperty12URI ?onPropertyUri. - ?valueNet a [rdfs:subClassOf* net:Class_Net] ; - net:hasClassURI ?valuesClassUri. - """, - 'binding': """ - """ -} - -rule_set['add-restriction-to-class-4'] = { - 'label': "add-restriction-to-class-4", - 'comment': ("Add restriction to Class: ", - " (1) on property, ", - " (2) with individual for value ", - " (corresponding to an individual net)", - " (3) for variant 01"), - 'construction': """ - ?newClassUri a owl:Class ; - rdfs:subClassOf [ - a owl:Restriction ; - owl:onProperty ?onPropertyUri ; - owl:hasValue ?valueIndividualUri - ] . - """, - 'clause': """ - ?net1 a [rdfs:subClassOf* net:Class_Net] ; - net:hasClassURI ?newClassUri ; - net:hasRestriction01 ?restrictionNet. - ?restrictionNet a net:Restriction_Net; - net:hasRestrictionOnProperty ?onPropertyNet ; - net:hasRestrictionNetValue ?valueNet. - ?onPropertyNet net:hasProperty12URI ?onPropertyUri. - ?valueNet a net:Individual_Net ; - net:hasIndividualURI ?valueIndividualUri. - """, - 'binding': """ - """ -} - -rule_set['add-restriction-to-class-5'] = { - 'label': "add-restriction-to-class-5", - 'comment': ("Add restriction to Class: ", - " (1) on property, ", - " (2) with some values from a class ", - " (corresponding to a class net)", - " (3) for variant 12"), - 'construction': """ - ?newClassUri a owl:Class ; - rdfs:subClassOf [ - a owl:Restriction ; - owl:onProperty ?onPropertyUri ; - owl:someValuesFrom ?valuesClassUri - ] . - """, - 'clause': """ - ?net1 a [rdfs:subClassOf* net:Class_Net] ; - net:hasClassURI ?newClassUri ; - net:hasRestriction12 ?restrictionNet. - ?restrictionNet a net:Restriction_Net; - net:hasRestrictionOnProperty ?onPropertyNet ; - net:hasRestrictionNetValue ?valueNet. - ?onPropertyNet net:hasProperty12URI ?onPropertyUri. - ?valueNet a [rdfs:subClassOf* net:Class_Net] ; - net:hasClassURI ?valuesClassUri. - """, - 'binding': """ - """ -} - -rule_set['add-restriction-to-class-6'] = { - 'label': "add-restriction-to-class-6", - 'comment': ("Add restriction to Class: ", - " (1) on property, ", - " (2) with individual for value ", - " (corresponding to an individual net)", - " (3) for variant 12"), - 'construction': """ - ?newClassUri a owl:Class ; - rdfs:subClassOf [ - a owl:Restriction ; - owl:onProperty ?onPropertyUri ; - owl:hasValue ?valueIndividualUri - ] . - """, - 'clause': """ - ?net1 a [rdfs:subClassOf* net:Class_Net] ; - net:hasClassURI ?newClassUri ; - net:hasRestriction12 ?restrictionNet. - ?restrictionNet a net:Restriction_Net; - net:hasRestrictionOnProperty ?onPropertyNet ; - net:hasRestrictionNetValue ?valueNet. - ?onPropertyNet net:hasProperty12URI ?onPropertyUri. - ?valueNet a net:Individual_Net ; - net:hasIndividualURI ?valueIndividualUri. - """, - 'binding': """ - """ -} - - - -# --------------------------------------------- -# OWL Generation: Composite Property -# --------------------------------------------- - -# rule_set['generate-composite-property-1'] = { -# 'label': "generate-composite-property-1", -# 'comment': "Generate Composite Property in the target ontology", -# 'construction': """ -# ?newPropertyUri a ?propertyType ; -# rdfs:label ?propertyName ; -# base-out:fromStructure ?sentenceRef. -# """, -# 'clause': """ -# ?net1 a net:Composite_Property_Net ; -# net:hasPropertyType ?propertyType ; -# net:hasPropertyName ?propertyName ; -# net:hasStructure ?sentenceRef ; -# net:hasPropertyURI ?newPropertyUri. -# """, -# 'binding': """ -# """ -# } - -# rule_set['generate-composite-property-2'] = { -# 'label': "generate-composite-property-2", -# 'comment': "Generate Composite Property in the target ontology", -# 'construction': """ -# ?newPropertyUri a ?propertyType ; -# rdfs:subPropertyOf base-out:Out_ObjectProperty ; -# rdfs:label ?propertyName ; -# base-out:fromStructure ?sentenceRef. -# """, -# 'clause': """ -# ?net1 a net:Composite_Property_Net ; -# net:hasPropertyType ?propertyType ; -# net:hasNaming ?propertyName ; -# net:hasStructure ?sentenceRef ; -# net:hasPropertyURI ?newPropertyUri. -# """, -# 'binding': """ -# """ -# } - -# rule_set['generate-composite-property-3'] = { -# 'label': "generate-composite-property-3", -# 'comment': "Generate Composite Property in the target ontology", -# 'construction': """ -# ?newPropertyUri rdfs:subPropertyOf ?motherPropertyUri. -# """, -# 'clause': """ -# ?net1 a net:Composite_Property_Net ; -# net:hasPropertyURI ?newPropertyUri ; -# net:hasMotherPropertyNet ?motherPropertyNet. -# ?motherPropertyNet net:hasPropertyURI ?motherPropertyUri. -# """, -# 'binding': """ -# """ -# } diff --git a/tenet/scheme/amr_clara_rule/nov_transduction/__init__.py b/tenet/scheme/amr_clara_rule/nov_transduction/__init__.py deleted file mode 100644 index 8d1c8b69..00000000 --- a/tenet/scheme/amr_clara_rule/nov_transduction/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tenet/scheme/amr_clara_rule/nov_transduction/atomic_extraction.py b/tenet/scheme/amr_clara_rule/nov_transduction/atomic_extraction.py deleted file mode 100644 index 867b4598..00000000 --- a/tenet/scheme/amr_clara_rule/nov_transduction/atomic_extraction.py +++ /dev/null @@ -1,371 +0,0 @@ -#!/usr/bin/python3.10 -# -*-coding:Utf-8 -* - -#============================================================================== -# TENET: AMR CTR at 'Net Expansion' level -#------------------------------------------------------------------------------ -# Module grouping compositional transduction rule_sets (CTR) for the analysis of -# AMR structures, at 'Net Expansion' level -#============================================================================== - -#============================================================================== -# Query Builder Imports -#============================================================================== - -#import query_builder.construct as construct -from query_builder.builders import * - - -#============================================================================== -# CTR Set (CTR as Sparql querries) -#============================================================================== - -rule_set = {} - - -# --------------------------------------------- -# Atomic Extraction: Class Net -# --------------------------------------------- - -rule_set['create-atom-class-net'] = { - 'label': "create-atom-class-net", - 'comment': "Create Atom Class Net from AMR Term Concept", - 'construction': f""" - {atom_class_net.construct(base_node='?leaf1', - class_name='?conceptName', - naming='?conceptName')} - - {atom_class_net.propagate_relations()} - """, - 'clause': f""" - # -- Identify Class covering a single leaf - ?leaf1 a amr:AMR_Leaf ; - amr:hasConcept ?leaf1Concept ; - amr:hasVariable ?variable. - ?variable amr:label ?varLabel. - ?leaf1Concept rdfs:subClassOf amr:AMR_Term_Concept. - ?leaf1Concept amr:label ?conceptName. - - {atom_class_net.complete_clauses_for_construction('?leaf1')} - """, - 'binding': f""" - {atom_class_net.bind_uri('?conceptName', '?varLabel')} - """ -} - - -# --------------------------------------------- -# Atomic Extraction: Individual Net -# --------------------------------------------- - -rule_set['create-individual-net-1'] = { - 'label': "create-individual-net-1", - 'comment': ("Create Individual Net from AMR Leaf: ", - " (1) with variable corresponding to a named entity ", - " (2) without link to domain edge"), - 'construction': f""" - {individual_net.construct(base_node='?baseLeaf', - naming='?conceptName', - mother_class_net='?classNet', - individual_label='?valueLabel')} - - {individual_net.propagate_relations()} - """, - 'clause': f""" - # -- Identify name relation between a leaf and a value - ?baseLeaf a amr:AMR_Leaf ; - amr:hasConcept ?concept ; - amr:hasVariable ?variable. - ?baseLeaf ?edge ?value. - ?edge amr:hasRoleID ?roleID. - VALUES ?roleID {{'name'}} - ?value a amr:AMR_Value ; - rdfs:label ?valueLabel. - ?classNet a [rdfs:subClassOf* net:Class_Net] ; - net:coverBaseNode ?baseLeaf ; - net:hasClassName ?conceptName. - - {individual_net.complete_clauses_for_construction('?baseLeaf')} - """, - 'binding': f""" - {individual_net.bind_uri('?conceptName', '?valueLabel')} - """ -} - - -# --------------------------------------------- -# Atomic Extraction: Property Net -# --------------------------------------------- - -rule_set['create-atom-property-net-1'] = { - 'label': "create-atom-property-net-1", - 'comment': ("Create Atom Property Net: ", - " (1) from AMR Predicat Concept"), - 'construction': f""" - {atom_property_net.construct(base_node='?baseLeaf', - naming='?propertyName', - core_role='true', - target_argument_node='?argLeaf', - property_type='owl:ObjectProperty', - property_name='?propertyName', - property_name01='?propertyName01', - property_name10='?propertyName10', - property_name12='?propertyName12')} - - {atom_property_net.propagate_relations()} - """, - 'clause': f""" - # -- Identify property covering single leaf - ?baseLeaf a amr:AMR_Leaf ; - amr:hasConcept ?concept ; - amr:hasVariable ?variable. - ?variable amr:label ?varLabel. - ?concept rdfs:subClassOf amr:AMR_Predicat_Concept ; - amr:label ?predicateLabel. - OPTIONAL {{ - ?baseLeaf ?relation ?argLeaf. - ?relation amr:hasAmrRole ?someArgRole. - }} - - {atom_property_net.complete_clauses_for_construction('?baseLeaf')} - """, - 'binding': f""" - BIND (STRBEFORE(?predicateLabel, '-') AS ?pName1). - BIND (IF (STRLEN(?pName1) > 0, - ?pName1, ?predicateLabel) AS ?propertyName) - BIND (IF (STRLEN(?pName1) > 0, - CONCAT(?propertyName, 'ing'), ?predicateLabel) AS ?propertyName01) - BIND (IF (STRLEN(?pName1) > 0, - CONCAT(?propertyName, '-by'), ?predicateLabel) AS ?propertyName10) - BIND (IF (STRLEN(?pName1) > 0, - CONCAT(?propertyName, '-of'), ?predicateLabel) AS ?propertyName12) - - {atom_property_net.bind_uri('?propertyName', '?varLabel')} - """ -} - -# -- old --- -# rule_set['create-atom-property-net-2'] = { -# 'label': "create-atom-property-net-2", -# 'comment': ("Create Property Net from AMR Predicat Concept: ", -# " with variable corresponding to a negative polarity value "), -# 'construction': f""" -# # -- New Property Net -# ?newNet a net:Atom_Property_Net ; -# net:isCoreRoleLinked true ; -# net:hasStructure ?sentenceRef ; -# net:coverBaseNode ?baseLeaf ; -# net:targetArgumentNode ?argLeaf ; -# net:hasPropertyType owl:ObjectProperty ; -# net:hasPropertyName ?propertyName ; -# net:hasPropertyName01 ?propertyName01 ; -# net:hasPropertyName10 ?propertyName10 ; -# net:hasPropertyName12 ?propertyName12. - -# # -- Propagation of relations (from nodes to nets) -# ?inRelationRole a net:Relation. -# ?inNet ?inRelationRole ?newNet. -# ?outRelationRole a net:Relation. -# ?newNet ?outRelationRole ?outNet. -# """, -# 'clause': """ -# # -- Identify property covering single leaf -# ?baseLeaf a amr:AMR_Leaf ; -# amr:hasConcept ?concept ; -# amr:hasVariable ?variable. -# ?variable amr:label ?varLabel ; -# amr:polarity ?polarityValue. -# ?polarityValue rdfs:label 'negative'. -# ?concept rdfs:subClassOf amr:AMR_Predicat_Concept ; -# amr:label ?predicateLabel. -# OPTIONAL {?baseLeaf ?relation ?argLeaf. -# ?relation amr:hasAmrRole ?someArgRole.} - -# # -- Identify structure -# ?root a amr:AMR_Root ; -# amr:hasSentenceID ?sentenceRef. - -# # -- Identify inbound relations linked to the base leaf (for propagation) -# OPTIONAL {?inNet a [rdfs:subClassOf* net:Net] ; -# net:coverBaseNode ?inLeaf. -# ?inLeaf ?inRelationEdge ?baseLeaf. -# ?inRelationEdge amr:hasAmrRole ?inRelationRole.} - -# # -- Identify outgoing relations linked to the base leaf (for propagation) -# OPTIONAL {?outNet a [rdfs:subClassOf* net:Net] ; -# net:coverBaseNode ?outLeaf. -# ?baseLeaf ?outRelationEdge ?outLeaf. -# ?outRelationEdge amr:hasAmrRole ?outRelationRole.} -# """, -# 'binding': f""" -# # -- New Property Name -# BIND (STRBEFORE(?predicateLabel, '-') AS ?basePropertyName). -# BIND (CONCAT('not-', ?basePropertyName) AS ?propertyName). -# BIND (CONCAT(?propertyName, 'ing') AS ?propertyName01). -# BIND (CONCAT(?propertyName, '-by') AS ?propertyName10). -# BIND (CONCAT(?propertyName, '-of') AS ?propertyName12). - -# # -- New Property Net -# BIND (CONCAT(str(net:), 'atomProperty') AS ?n1). -# BIND (CONCAT(?n1, '_', ?propertyName) AS ?n2). -# BIND (CONCAT(?n2, '_', ?varLabel) AS ?n3). -# BIND (uri(?n3) AS ?newNet). -# """ -# } -# -- --- - -# -- old --- -# rule_set['create-atom-property-net-3'] = { -# 'label': "create-atom-property-net-3", -# 'comment': ("Create Atom Property Net: ", -# " (1) from AMR Non Core Role Edge"), -# 'construction': f""" -# # -- New Property Net -# ?newNet a net:Atom_Property_Net ; -# net:isCoreRoleLinked false ; -# net:hasStructure ?sentenceRef ; -# net:coverBaseNode ?baseLeaf ; -# net:targetArgumentNode ?targetPropertyLeaf ; -# net:hasPropertyType ?roleType ; -# net:hasPropertyRole ?relationRole ; -# net:hasPropertyName ?roleName. - -# # -- Propagation of relations (from nodes to nets) -# ?inRelationRole a net:Relation. -# ?inNet ?inRelationRole ?newNet. -# ?outRelationRole a net:Relation. -# ?newNet ?outRelationRole ?outNet. -# """, -# 'clause': """ -# # -- Identify property covering relation role -# ?relationRole rdfs:subClassOf amr:AMR_NonCore_Role ; -# amr:getPropertyType ?roleType ; -# amr:getDirectPropertyName ?roleName. -# FILTER (?roleType = owl:ObjectProperty || -# ?roleType = owl:DataProperty). -# ?roleEdge amr:hasAmrRole ?relationRole. -# ?baseLeaf ?roleEdge ?targetPropertyLeaf. -# ?baseLeaf a amr:AMR_Leaf ; -# amr:hasVariable ?variable. -# ?variable amr:label ?varLabel. - -# # -- Identify structure -# ?root a amr:AMR_Root ; -# amr:hasSentenceID ?sentenceRef. - -# # -- Identify inbound relations linked to the base leaf (for propagation) -# OPTIONAL {?inNet a [rdfs:subClassOf* net:Net] ; -# net:coverBaseNode ?inLeaf. -# ?inLeaf ?inRelationEdge ?baseLeaf. -# ?inRelationEdge amr:hasAmrRole ?inRelationRole.} - -# # -- Identify outgoing relations linked to the base leaf (for propagation) -# OPTIONAL {?outNet a [rdfs:subClassOf* net:Net] ; -# net:coverBaseNode ?outLeaf. -# ?baseLeaf ?outRelationEdge ?outLeaf. -# ?outRelationEdge amr:hasAmrRole ?outRelationRole.} -# """, -# 'binding': f""" -# # -- New Property Net -# BIND (CONCAT(str(net:), 'atomProperty') AS ?n1). -# BIND (CONCAT(?n1, '_', str(?roleName)) AS ?n2). -# BIND (CONCAT(?n2, '_', str(?varLabel)) AS ?n3). -# BIND (uri(?n3) AS ?newNet). -# """ -# } -# -- --- - - -# --------------------------------------------- -# Atomic Extraction: Value Net -# --------------------------------------------- - -rule_set['create-value-net'] = { - 'label': "create-value-net", - 'comment': "Create Value Net from AMR Value", - 'construction': f""" - {value_net.construct(naming='?valueLabel', - value_label='?valueLabel')} - - {value_net.propagate_relations()} - """, - 'clause': f""" - # -- Identify Class covering a single leaf - ?value a amr:AMR_Value ; - rdfs:label ?valueLabel. - - {value_net.complete_clauses_for_construction('?value')} - """, - 'binding': f""" - {value_net.bind_uri('?valueLabel')} - """ -} - -# --------------------------------------------- -# Atomic Extraction: Phenomena Net -# --------------------------------------------- - -rule_set['create-phenomena-net-1'] = { - 'label': "create-phenomena-net-1", - 'comment': ("Create Phenomena Net from AMR Relation Concept"), - 'construction': f""" - {phenomena_net.construct(base_node='?baseLeaf', - naming='?phenomenaLabel', - phenomena_type='?relationConceptPhenomena', - phenomena_ref='?relationConceptLabel')} - - {phenomena_net.propagate_relations()} - """, - 'clause': f""" - # Identify relation concept (phenomena) covering a single leaf - ?baseLeaf a amr:AMR_Leaf ; - amr:hasConcept ?concept ; - amr:hasVariable ?variable. - ?variable amr:label ?varLabel. - ?concept rdfs:subClassOf amr:AMR_Relation_Concept ; - amr:hasPhenomenaLink ?relationConceptPhenomena ; - amr:label ?relationConceptLabel. - ?relationConceptPhenomena amr:label ?phenomenaLabel. - ?baseLeaf ?relation ?argLeaf. - ?relation amr:hasAmrRole ?someArgRole. - - {phenomena_net.complete_clauses_for_construction('?baseLeaf')} - """, - 'binding': f""" - {phenomena_net.bind_uri('?phenomenaLabel', '?varLabel')} - """ -} - - -#============================================================================== -# Development Test -#============================================================================== - -if __name__ == '__main__': - - print('\n' + ' *** Development Test ***') - - print('\n' + ' -- test: Atom Class Net') - print(atom_class_net) - - print('\n' + ' -- test: update a test query (1)') - #rule = rule_set['create-atom-property-net-1'] - #rule = rule_set['create-value-net'] - rule = rule_set['create-individual-net-1'] - - test_query_1 = f"""[...] - CONSTRUCT {{ - {rule['construction']} - - - }} - WHERE {{ - {rule['clause']} - - {rule['binding']} - - }} - """ - print(test_query_1) - - print('\n' + ' *** - ***') diff --git a/tenet/scheme/amr_clara_rule/nov_transduction/classification.py b/tenet/scheme/amr_clara_rule/nov_transduction/classification.py deleted file mode 100644 index 501764a4..00000000 --- a/tenet/scheme/amr_clara_rule/nov_transduction/classification.py +++ /dev/null @@ -1,364 +0,0 @@ -#!/usr/bin/python3.10 -# -*-coding:Utf-8 -* - -#============================================================================== -# TENET: AMR CTR at 'Net Expansion' level -#------------------------------------------------------------------------------ -# Module grouping compositional transduction rule_sets (CTR) for the analysis of -# AMR structures, at 'Net Expansion' level -#============================================================================== - -#============================================================================== -# CTR Set (CTR as Sparql querries) -#============================================================================== - -rule_set = {} - - -# --------------------------------------------- -# Net Expansion: Classification -# --------------------------------------------- - -rule_set['classify-net-from-core-1'] = { - 'label': "classify-net-from-core-1", - 'comment': ("Classify Class Net from relations corresponding to: ", - " Core property :ARG0 "), - 'construction': """ - ?rightClassNet net:hasClassType base-out:Entity. - """, - 'clause': """ - ?rightClassNet a [rdfs:subClassOf* net:Class_Net]. - ?leftNet amr:role_ARG0 ?rightClassNet. - """, - 'binding': """ - """ -} - -rule_set['classify-net-from-core-2'] = { - 'label': "classify-net-from-core-2", - 'comment': ("Classify Class Net from relations corresponding to: ", - " Core property :ARG1 "), - 'construction': """ - ?rightClassNet net:hasClassType base-out:Entity. - """, - 'clause': """ - ?rightClassNet a [rdfs:subClassOf* net:Class_Net]. - ?leftNet amr:role_ARG1 ?rightClassNet. - """, - 'binding': """ - """ -} - - -rule_set['classify-net-from-core-3'] = { - 'label': "classify-net-from-core-3", - 'comment': ("Classify Class Net from relations corresponding to: ", - " Core property :ARG2 "), - 'construction': """ - # -- New class net - ?newNet a net:Individual_Net ; - net:fromClassNet ?rightClassNet ; - net:hasStructure ?sentenceRef ; - net:coverBaseNode ?baseLeaf ; - net:hasBaseClassName 'Feature' ; - net:hasIndividualLabel ?rightConceptName. - ?restrictionNet net:hasRestrictionNetValue ?newNet. - - # -- Original net becomes deprecated - # -- old --- ?rightClassNet net:deprecated true. - - # -- Propagation of relations (from nodes to nets) - ?inRelationRole a net:Relation. - ?inNet ?inRelationRole ?newNet. - ?outRelationRole a net:Relation. - ?newNet ?outRelationRole ?outNet. - """, - 'clause': """ - ?rightClassNet a [rdfs:subClassOf* net:Class_Net] ; - net:hasStructure ?sentenceRef ; - net:coverBaseNode ?baseLeaf ; - net:hasClassName ?rightConceptName. - OPTIONAL { ?restrictionNet net:hasRestrictionNetValue ?rightClassNet. } - ?leftNet amr:role_ARG2 ?rightClassNet. - - # -- Identify inbound relations linked to the base leaf (for propagation) - OPTIONAL {?inNet a [rdfs:subClassOf* net:Net] ; - net:coverBaseNode ?inLeaf. - ?inLeaf ?inRelationEdge ?baseLeaf. - ?inRelationEdge amr:hasAmrRole ?inRelationRole.} - - # -- Identify outgoing relations linked to the base leaf (for propagation) - OPTIONAL {?outNet a [rdfs:subClassOf* net:Net] ; - net:coverBaseNode ?outLeaf. - ?baseLeaf ?outRelationEdge ?outLeaf. - ?outRelationEdge amr:hasAmrRole ?outRelationRole.} - """, - 'binding': """ - # -- New class net - BIND (CONCAT(str(net:), 'individual') AS ?n1). - BIND (CONCAT(?n1, '_', ?rightConceptName) AS ?n2). - BIND (CONCAT(?n2, '_', 'fromClass') AS ?n3). - BIND (uri(?n3) AS ?newNet). - """ -} - -# rule_set['classify-net-from-mod'] = { -# 'label': "classify-net-from-mod", -# 'comment': ("Classify Class Net from relations corresponding to: ", -# " Non-Core property :MOD "), -# 'construction': """ -# # -- Entity net -# ?leftClassNet net:hasClassType base-out:Entity. - -# # -- New class net -# ?newNet a net:Individual_Net ; -# net:fromClassNet ?rightClassNet ; -# net:hasStructure ?sentenceRef ; -# net:coverBaseNode ?baseLeaf ; -# net:hasBaseClassName 'Feature' ; -# net:hasIndividualLabel ?newClassName. -# ?restrictionNet net:hasRestrictionNetValue ?newNet. - -# # -- Original net becomes deprecated -# # -- old --- ?rightClassNet net:deprecated true. - -# # -- Propagation of relations (from nodes to nets) -# ?inRelationRole a net:Relation. -# ?inNet ?inRelationRole ?newNet. -# ?outRelationRole a net:Relation. -# ?newNet ?outRelationRole ?outNet. -# """, -# 'clause': """ -# ?leftClassNet a [rdfs:subClassOf* net:Class_Net]; -# net:hasClassName ?leftConceptName. -# ?rightClassNet a [rdfs:subClassOf* net:Class_Net] ; -# net:hasStructure ?sentenceRef ; -# net:coverBaseNode ?baseLeaf ; -# net:hasClassName ?rightConceptName. -# OPTIONAL { ?restrictionNet net:hasRestrictionNetValue ?rightClassNet. } -# ?leftClassNet amr:role_mod ?rightClassNet. - -# # -- Identify inbound relations linked to the base leaf (for propagation) -# OPTIONAL {?inNet a [rdfs:subClassOf* net:Net] ; -# net:coverBaseNode ?inLeaf. -# ?inLeaf ?inRelationEdge ?baseLeaf. -# ?inRelationEdge amr:hasAmrRole ?inRelationRole.} - -# # -- Identify outgoing relations linked to the base leaf (for propagation) -# OPTIONAL {?outNet a [rdfs:subClassOf* net:Net] ; -# net:coverBaseNode ?outLeaf. -# ?baseLeaf ?outRelationEdge ?outLeaf. -# ?outRelationEdge amr:hasAmrRole ?outRelationRole.} -# """, -# 'binding': """ -# # -- New class Name -# BIND (CONCAT(?rightConceptName, '-', ?leftConceptName) AS ?newClassName). - -# # -- New class net URI -# BIND (CONCAT(str(net:), 'individual') AS ?n1). -# BIND (CONCAT(?n1, '_', ?newClassName) AS ?n2). -# BIND (CONCAT(?n2, '_', 'fromClass') AS ?n3). -# BIND (uri(?n3) AS ?newNet). -# """ -# } - -rule_set['classify-net-from-part'] = { - 'label': "classify-net-from-part", - 'comment': ("Classify Class Net from relations corresponding to: ", - " Non-Core property :PART "), - 'construction': """ - ?leftClassNet net:hasClassType base-out:Entity. - ?rightClassNet net:hasClassType base-out:Entity. - """, - 'clause': """ - ?leftClassNet a [rdfs:subClassOf* net:Class_Net]. - ?rightClassNet a [rdfs:subClassOf* net:Class_Net]. - ?leftClassNet amr:role_part ?rightClassNet. - """, - 'binding': """ - """ -} - -rule_set['classify-net-from-domain'] = { - 'label': "classify-net-from-domain", - 'comment': ("Classify Class Net from relations corresponding to: ", - " Non-Core property :DOMAIN "), - 'construction': """ - ?leftClassNet net:hasMotherClassNet ?rightClassNet. - """, - 'clause': """ - ?leftClassNet a [rdfs:subClassOf* net:Class_Net]. - ?rightClassNet a [rdfs:subClassOf* net:Class_Net]. - ?leftClassNet amr:role_domain ?rightClassNet. - """, - 'binding': """ - """ -} - -rule_set['classify-net-from-degree-phenomena-1'] = { - 'label': "classify-net-from-degree-phenomena-1", - 'comment': ("Classify Class Net from relations corresponding to: ", - " (1) phenomena :DEGREE ", - " (2) core role :ARG1 or :ARG5"), - 'construction': """ - ?rightClassNet net:hasClassType base-out:Entity. - """, - 'clause': """ - ?phenomenaNet a net:Phenomena_Net ; - net:targetArgumentNode ?rightLeaf ; - net:hasPhenomenaType amr:phenomena_degree. - ?rightClassNet a [rdfs:subClassOf* net:Class_Net]. - ?phenomenaNet ?role ?rightClassNet. - FILTER (?role = amr:role_ARG1 || - ?role = amr:role_ARG5). - """, - 'binding': """ - """ -} - -rule_set['classify-net-from-degree-phenomena-2'] = { - 'label': "classify-net-from-degree-phenomena-2", - 'comment': ("Classify Class Net from relations corresponding to: ", - " (1) phenomena :DEGREE ", - " (2) core role :ARG2"), - 'construction': """ - ?newNet a net:Individual_Net ; - net:fromClassNet ?rightClassNet ; - net:hasStructure ?sentenceRef ; - net:coverBaseNode ?baseLeaf ; - net:hasBaseClassName 'Feature' ; - net:hasIndividualLabel ?rightConceptName. - ?restrictionNet net:hasRestrictionNetValue ?newNet. - - # -- Original net becomes deprecated - # -- old --- ?rightClassNet net:deprecated true. - - # -- Propagation of relations (from nodes to nets) - ?inRelationRole a net:Relation. - ?inNet ?inRelationRole ?newNet. - ?outRelationRole a net:Relation. - ?newNet ?outRelationRole ?outNet. - """, - 'clause': """ - ?phenomenaNet a net:Phenomena_Net ; - net:targetArgumentNode ?baseLeaf ; - net:hasPhenomenaType amr:phenomena_degree. - ?rightClassNet a [rdfs:subClassOf* net:Class_Net] ; - net:hasStructure ?sentenceRef ; - net:hasClassName ?rightConceptName. - OPTIONAL { ?restrictionNet net:hasRestrictionNetValue ?rightClassNet. } - ?phenomenaNet amr:role_ARG2 ?rightClassNet. - - # -- Identify inbound relations linked to the base leaf (for propagation) - OPTIONAL {?inNet a [rdfs:subClassOf* net:Net] ; - net:coverBaseNode ?inLeaf. - ?inLeaf ?inRelationEdge ?baseLeaf. - ?inRelationEdge amr:hasAmrRole ?inRelationRole.} - - # -- Identify outgoing relations linked to the base leaf (for propagation) - OPTIONAL {?outNet a [rdfs:subClassOf* net:Net] ; - net:coverBaseNode ?outLeaf. - ?baseLeaf ?outRelationEdge ?outLeaf. - ?outRelationEdge amr:hasAmrRole ?outRelationRole.} - """, - 'binding': """ - BIND (CONCAT(str(net:), 'individual') AS ?n1). - BIND (CONCAT(?n1, '_', ?rightConceptName) AS ?n2). - BIND (CONCAT(?n2, '_', 'fromClass') AS ?n3). - BIND (uri(?n3) AS ?newNet). - """ -} - -rule_set['classify-net-from-degree-phenomena-3'] = { - 'label': "classify-net-from-degree-phenomena-3", - 'comment': ("Classify Class Net from relations corresponding to: ", - " (1) phenomena :DEGREE ", - " (2) core role :ARG3"), - 'construction': """ - ?rightClassNet net:hasClassType base-out:Degree. - """, - 'clause': """ - ?phenomenaNet a net:Phenomena_Net ; - net:targetArgumentNode ?rightLeaf ; - net:hasPhenomenaType amr:phenomena_degree. - ?rightClassNet a [rdfs:subClassOf* net:Class_Net]. - ?phenomenaNet amr:role_ARG3 ?rightClassNet. - """, - 'binding': """ - """ -} - -rule_set['propagate-individual-1'] = { - 'label': "propagate-individual-1", - 'comment': ("Propagate Individual by completing Individual Net for: ", - " (1) same base node cover between several classes"), - 'construction': """ - ?individualNet net:hasMotherClassNet ?classNet. - """, - 'clause': """ - ?individualNet a net:Individual_Net ; - net:coverBaseNode ?sameBaseLeaf. - ?classNet a [rdfs:subClassOf* net:Class_Net] ; - net:coverBaseNode ?sameBaseLeaf. - """, - 'binding': """ - """ -} - -rule_set['propagate-individual-2'] = { - 'label': "propagate-individual-2", - 'comment': ("Propagate Individual by completing Individual Net for: ", - " (1) link between conjunction and domain phenomenas"), - 'construction': """ - ?individualNet net:hasMotherClassNet ?classNet. - """, - 'clause': """ - ?classNet a [rdfs:subClassOf* net:Class_Net]. - ?individualNet a net:Individual_Net. - ?classNet amr:role_domain ?individualNet. - """, - 'binding': """ - """ -} - -rule_set['reclassify-deprecated-net'] = { - 'label': "reclassify-deprecated-net", - 'comment': ("Reclassify deprecated net as Deprecated_Net instances"), - 'construction': """ - # -- Net becomes deprecated net - ?net a net:Deprecated_Net. - """, - 'clause': """ - # -- Identify net with deprecated mark - ?net a [rdfs:subClassOf* net:Net_Structure] ; - net:deprecated true. - """, - 'binding': """ - """ -} - -#============================================================================== -# Development Test -#============================================================================== - -if __name__ == '__main__': - - print('\n' + ' *** Development Test ***') - - print('\n' + ' -- Test Query') - rule = rule_set['propagate-individual-1'] - test_query_1 = f"""[...] - CONSTRUCT {{ - {rule['construction']} - - }} - WHERE {{ - {rule['clause']} - - {rule['binding']} - - }} - """ - print(test_query_1) - - print('\n' + ' *** - ***') \ No newline at end of file diff --git a/tenet/scheme/amr_clara_rule/nov_transduction/composite_class_extraction_1.py b/tenet/scheme/amr_clara_rule/nov_transduction/composite_class_extraction_1.py deleted file mode 100644 index 50afe9de..00000000 --- a/tenet/scheme/amr_clara_rule/nov_transduction/composite_class_extraction_1.py +++ /dev/null @@ -1,457 +0,0 @@ -#!/usr/bin/python3.10 -# -*-coding:Utf-8 -* - -#============================================================================== -# TENET: AMR CTR at 'Net Expansion' level -#------------------------------------------------------------------------------ -# Module grouping compositional transduction rule_sets (CTR) for the analysis of -# AMR structures, at 'Net Expansion' level -#============================================================================== - -#============================================================================== -# Query Builder Imports -#============================================================================== - -#import query_builder.construct as construct -from query_builder.builders import * - - -#============================================================================== -# CTR Set (CTR as Sparql querries) -#============================================================================== - -rule_set = {} - - -# --------------------------------------------- -# Net Expansion: Composite Class Net from Property Net -# --------------------------------------------- - -rule_set['create-composite-class-net-from-property-1'] = { - 'label': "create-composite-class-net-from-property-1", - 'comment': ("Create Composite Class Net (and Restriction Net): ", - " (1) from relation between two classes as ARG0 and ARG1, ", - " (2) with a relation corresponding to Core Role property"), - 'construction': f""" - {restriction_net.construct(base_node=class_net_0.base_node, - naming='?newClassName', - target_node=atom_property_net.node, - restriction_property=atom_property_net.id, - restriction_net_value=class_net_1.id)} - {restriction_net.add_attribute(target_node=class_net_1.node)} - - {composite_class_net.construct(base_node=class_net_0.base_node, - node=atom_property_net.base_node, - class_name='?newClassName', - mother_class_net=class_net_0.id, - restriction01=restriction_net.id)} - {composite_class_net.add_attribute(node=class_net_0.node)} - {composite_class_net.add_attribute(node=class_net_1.node)} - """, - 'clause': f""" - # *** Identify Property(arg0:Class, arg1:Class) *** - - {atom_property_net.identify_net(core_role='true')} - - {atom_property_net.id} amr:role_ARG0 {class_net_0.id}. - {atom_property_net.id} amr:role_ARG1 {class_net_1.id}. - - {class_net_0.identify_net()} - - {class_net_1.identify_net()} - - # *** condition: disjoint cover *** - FILTER NOT EXISTS {{ - {class_net_0.id} net:coverNode ?node. - {class_net_1.id} net:coverNode ?node. - }} - - # *** Identify variable label of base leaf *** - {class_net_0.base_node} a amr:AMR_Leaf ; - amr:hasVariable ?variable. - ?variable amr:label ?varLabel. - """, - 'binding': f""" - # -- New Class Name - BIND (CONCAT({class_net_0.class_name}, '-', {atom_property_net.property_name01}) AS ?cn1). - BIND (CONCAT(?cn1, '-', {class_net_1.class_name}) AS ?newClassName). - - {restriction_net.bind_uri(atom_property_net.property_name01, class_net_1.class_name)} - - {composite_class_net.bind_uri('?newClassName', '?varLabel')} - """ -} - - -# -- old --- -# rule_set['create-composite-class-net-from-property-1'] = { -# 'label': "create-composite-class-net-from-property-1", -# 'comment': ("Create Composite Class Net (and Restriction Net): ", -# " (1) from relation between two classes as ARG0 and ARG1, ", -# " (2) with a relation corresponding to Core Role property", -# " (3) in normal direction"), -# 'construction': """ -# # -- New Restriction Net -# ?newRestrictionNet a net:Restriction_Net ; -# net:hasStructure ?sentenceRef ; -# net:coverBaseNode ?baseLeaf ; -# net:coverTargetNode ?propertyLeaf, -# ?nodeOfArg1Net ; -# net:hasRestrictionOnProperty ?propertyNet ; -# net:hasRestrictionNetValue ?arg1Net. - -# # -- New Class Net -# ?newNet a net:Composite_Class_Net ; -# net:hasStructure ?sentenceRef ; -# net:coverBaseNode ?baseLeaf ; -# net:coverNode ?propertyLeaf, -# ?nodeOfArg0Net, -# ?nodeOfArg1Net ; -# net:hasClassName ?newClassName ; -# net:hasMotherClassNet ?arg0Net ; -# net:hasRestriction01 ?newRestrictionNet. - -# # -- Propagation of relations (from nodes to nets) -# ?inRelationRole a net:Relation. -# ?inNet ?inRelationRole ?newNet. -# ?outRelationRole a net:Relation. -# ?newNet ?outRelationRole ?outNet. -# """, -# 'clause': """ -# # -- Identify Property(arg0:Class, arg1:Class) -# ?propertyNet a [rdfs:subClassOf* net:Property_Net] ; -# net:isCoreRoleLinked true ; -# net:hasStructure ?sentenceRef ; -# net:coverNode ?propertyLeaf ; -# net:hasPropertyName01 ?propertyName01. -# # -- old --- net:hasPropertyDirection net:normal_direction. -# ?propertyNet amr:role_ARG0 ?arg0Net. -# ?arg0Net a [rdfs:subClassOf* net:Class_Net] ; -# net:coverBaseNode ?baseLeaf ; -# net:coverNode ?nodeOfArg0Net ; -# net:hasClassName ?arg0Name. -# ?propertyNet amr:role_ARG1 ?arg1Net. -# ?arg1Net a [rdfs:subClassOf* net:Class_Net] ; -# net:coverBaseNode ?arg1Leaf ; -# net:coverNode ?nodeOfArg1Net ; -# net:hasClassName ?arg1Name. - -# # -- condition: disjoint cover -# FILTER NOT EXISTS {?arg0Net net:coverNode ?node. -# ?arg1Net net:coverNode ?node.} - -# # -- Identify inbound relations linked to the base leaf (for propagation) -# OPTIONAL {?inNet a [rdfs:subClassOf* net:Net] ; -# net:coverBaseNode ?inLeaf. -# ?inLeaf ?inRelationEdge ?baseLeaf. -# ?inRelationEdge amr:hasAmrRole ?inRelationRole.} - -# # -- Identify outgoing relations linked to the base leaf (for propagation) -# OPTIONAL {?outNet a [rdfs:subClassOf* net:Net] ; -# net:coverBaseNode ?outLeaf. -# ?baseLeaf ?outRelationEdge ?outLeaf. -# ?outRelationEdge amr:hasAmrRole ?outRelationRole.} -# """, -# 'binding': """ -# # -- New Class Name -# BIND (CONCAT(?arg0Name, '-', ?propertyName01) AS ?cn1). -# BIND (CONCAT(?cn1, '-', ?arg1Name) AS ?newClassName). - -# # -- New Restriction Net -# BIND (CONCAT(str(net:), 'restriction') AS ?rn1). -# BIND (CONCAT(?rn1, '_', str(?propertyName01)) AS ?rn2). -# BIND (CONCAT(?rn2, '_', str(?arg1Name)) AS ?rn3). -# BIND (uri(?rn3) AS ?newRestrictionNet). - -# # -- New Class Net -# BIND (CONCAT(str(net:), 'compositeClass') AS ?n1). -# BIND (CONCAT(?n1, '_', ?newClassName) AS ?n2). -# BIND (uri(?n2) AS ?newNet). -# """ -# } -# -- --- - - - -rule_set['create-composite-class-net-from-property-2'] = { - 'label': "create-composite-class-net-from-property-2", - 'comment': ("Create Composite Class Net (and Restriction Net): ", - " (1) from relation between two classes as ARG1 and ARG2, ", - " (2) with a relation corresponding to Core Role property"), - 'construction': f""" - - {restriction_net.construct(base_node=class_net_1.base_node, - naming='?newClassName', - target_node=atom_property_net.node, - restriction_property=atom_property_net.id, - restriction_net_value=class_net_2.id)} - {restriction_net.add_attribute(target_node=class_net_2.node)} - - - {composite_class_net.construct(base_node=class_net_1.base_node, - node=atom_property_net.base_node, - class_name='?newClassName', - mother_class_net=class_net_1.id, - restriction01=restriction_net.id)} - {composite_class_net.add_attribute(node=class_net_1.node)} - {composite_class_net.add_attribute(node=class_net_2.node)} - """, - 'clause': f""" - # *** Identify Property(arg0:Class, arg1:Class) *** - {atom_property_net.identify_net(core_role='true')} - {atom_property_net.id} amr:role_ARG1 {class_net_1.id}. - {atom_property_net.id} amr:role_ARG2 {class_net_2.id}. - - {class_net_1.identify_net()} - {class_net_2.identify_net()} - - # *** condition: disjoint cover *** - FILTER NOT EXISTS {{ - {class_net_1.id} net:coverNode ?node. - {class_net_2.id} net:coverNode ?node. - }} - - # *** Identify variable label of base leaf *** - {class_net_1.base_node} a amr:AMR_Leaf ; - amr:hasVariable ?variable. - ?variable amr:label ?varLabel. - """, - 'binding': f""" - # -- New Class Name - BIND (CONCAT({class_net_1.class_name}, '-', {atom_property_net.property_name12}) AS ?cn1). - BIND (CONCAT(?cn1, '-', {class_net_2.class_name}) AS ?newClassName). - - {restriction_net.bind_uri(atom_property_net.property_name01, class_net_2.class_name)} - - {composite_class_net.bind_uri('?newClassName', '?varLabel')} - """ -} - - - -# rule_set['create-composite-class-net-from-property-2'] = { -# 'label': "create-composite-class-net-from-property-2", -# 'comment': ("Create Composite Class Net (and Restriction Net): ", -# " (1) from relation between two classes as ARG1 and ARG2, ", -# " (2) with a relation corresponding to Core Role property", -# " (3) in normal direction"), -# 'construction': """ -# # -- New Restriction Net -# ?newRestrictionNet a net:Restriction_Net ; -# net:hasStructure ?sentenceRef ; -# net:coverBaseNode ?baseLeaf ; -# net:coverTargetNode ?propertyLeaf, -# ?nodeOfArg2Net ; -# net:hasRestrictionOnProperty ?propertyNet ; -# net:hasRestrictionNetValue ?arg2Net. - -# # -- New Class Net -# ?newNet a net:Composite_Class_Net ; -# net:hasStructure ?sentenceRef ; -# net:coverBaseNode ?baseLeaf ; -# net:coverTargetNode ?propertyLeaf, -# ?nodeOfArg1Net, -# ?nodeOfArg2Net ; -# net:hasClassName ?newClassName ; -# net:hasMotherClassNet ?arg1Net ; -# net:hasRestriction12 ?newRestrictionNet. - -# # -- Propagation of relations (from nodes to nets) -# ?inRelationRole a net:Relation. -# ?inNet ?inRelationRole ?newNet. -# ?outRelationRole a net:Relation. -# ?newNet ?outRelationRole ?outNet. -# """, -# 'clause': """ -# # -- Identify Property(arg1:Class, arg2:Class) -# ?propertyNet a [rdfs:subClassOf* net:Property_Net] ; -# net:isCoreRoleLinked true ; -# net:hasStructure ?sentenceRef ; -# net:coverNode ?propertyLeaf ; -# net:hasPropertyName12 ?propertyName12. -# ?propertyNet amr:role_ARG1 ?arg1Net. -# ?arg1Net a [rdfs:subClassOf* net:Class_Net] ; -# net:coverBaseNode ?baseLeaf ; -# net:coverNode ?nodeOfArg1Net ; -# net:hasClassName ?arg1Name. -# ?propertyNet amr:role_ARG2 ?arg2Net. -# ?arg2Net a [rdfs:subClassOf* net:Class_Net] ; -# net:coverBaseNode ?arg2Leaf ; -# net:coverNode ?nodeOfArg2Net ; -# net:hasClassName ?arg2Name. - -# # -- condition: disjoint cover -# FILTER NOT EXISTS {?arg1Net net:coverNode ?node. -# ?arg2Net net:coverNode ?node.} - -# # -- Identify inbound relations linked to the base leaf (for propagation) -# OPTIONAL {?inNet a [rdfs:subClassOf* net:Net] ; -# net:coverBaseNode ?inLeaf. -# ?inLeaf ?inRelationEdge ?baseLeaf. -# ?inRelationEdge amr:hasAmrRole ?inRelationRole.} - -# # -- Identify outgoing relations linked to the base leaf (for propagation) -# OPTIONAL {?outNet a [rdfs:subClassOf* net:Net] ; -# net:coverBaseNode ?outLeaf. -# ?baseLeaf ?outRelationEdge ?outLeaf. -# ?outRelationEdge amr:hasAmrRole ?outRelationRole.} -# """, -# 'binding': """ -# # -- New Class Name -# BIND (CONCAT(?arg1Name, '-', ?propertyName12) AS ?cn1). -# BIND (CONCAT(?cn1, '-', ?arg2Name) AS ?newClassName). - -# # -- New Restriction Net -# BIND (CONCAT(str(net:), 'restriction') AS ?rn1). -# BIND (CONCAT(?rn1, '_', str(?propertyName12)) AS ?rn2). -# BIND (CONCAT(?rn2, '_', str(?arg2Name)) AS ?rn3). -# BIND (uri(?rn3) AS ?newRestrictionNet). - -# # -- New Class Net -# BIND (CONCAT(str(net:), 'compositeClass') AS ?n1). -# BIND (CONCAT(?n1, '_', ?newClassName) AS ?n2). -# BIND (uri(?n2) AS ?newNet). -# """ -# } - - - - -rule_set['create-composite-class-net-from-property-3'] = { - 'label': "create-composite-class-net-from-property-3", - 'comment': ("Create Composite Class Net: ", - " (1) complete Composite Class Net for relation propagation"), - 'construction': f""" - {composite_class_net.define_structure()} - {composite_class_net.propagate_relations()} - """, - 'clause': f""" - # *** Identify CompositeClass in progress step INIT *** - {composite_class_net.identify_net()} - {composite_class_net.filter_already_processed_net(Net.RELATION_PROPAGATED)} - - # *** Complete clauses for net construction *** - {composite_class_net.complete_clauses_for_construction()} - """, - 'binding': f""" - """ -} - -# ************************************ -# *** OLD *** -# Dropping this rule for non-core roles. -# Cases treated as core roles, if reification, or as linguistic phenomena if not. -# *********************************** -# rule_set['create-composite-class-net-from-property-4'] = { -# 'label': "create-composite-class-net-from-property-4", -# 'comment': ("Create Composite Class Net (and Restriction Net): ", -# " (1) from relation between two classes, ", -# " (2) with a relation corresponding to Non-Core Role property"), -# 'construction': """ -# # -- New Restriction Net -# ?newRestrictionNet a net:Restriction_Net ; -# net:hasStructure ?sentenceRef ; -# net:coverBaseNode ?baseLeaf ; -# net:coverTargetNode ?argNodeOfBaseNet, ?nodeOfArgNet ; -# net:hasRestrictionOnProperty ?propertyNet ; -# net:hasRestrictionNetValue ?argNet. - -# # -- New Class Net -# ?newClassNet a net:Composite_Class_Net ; -# net:hasStructure ?sentenceRef ; -# net:coverBaseNode ?baseLeaf ; -# net:coverNode ?nodeOfBaseNet, ?nodeOfArgNet ; -# net:hasClassName ?newClassName ; -# net:hasMotherClassNet ?baseNet ; -# net:hasRestriction ?newRestrictionNet. - -# # -- Propagation of relations (from nodes to nets) -# ?inRelationRole a net:Relation. -# ?inNet ?inRelationRole ?newNet. -# ?outRelationRole a net:Relation. -# ?newNet ?outRelationRole ?outNet. -# """, -# 'clause': """ -# # -- Identify Property(Class, Class) -# ?propertyNet a [rdfs:subClassOf* net:Property_Net]; -# net:isCoreRoleLinked false ; -# net:hasStructure ?sentenceRef ; -# net:coverBaseNode ?baseLeaf ; -# # -- old --- net:targetArgumentNode ?argLeaf ; -# net:hasPropertyRole ?propertyRole ; -# net:hasPropertyName ?propertyName. -# # -- old --- FILTER ( ?propertyName != 'hasFeature' ). -# ?baseNet ?propertyRole ?argNet. -# ?baseNet a [rdfs:subClassOf* net:Class_Net] ; -# net:coverBaseNode ?baseLeaf ; -# net:coverNode ?nodeOfBaseNet ; -# net:hasClassName ?baseName. -# ?argNet a [rdfs:subClassOf* net:Class_Net] ; -# net:coverNode ?nodeOfArgNet ; -# net:hasClassName ?argName. - -# # -- condition: disjoint cover -# FILTER NOT EXISTS {?baseNet net:coverNode ?node. -# ?argNet net:coverNode ?node.} - -# # -- Identify inbound relations linked to the base leaf (for propagation) -# OPTIONAL {?inNet a [rdfs:subClassOf* net:Net] ; -# net:coverBaseNode ?inLeaf. -# ?inLeaf ?inRelationEdge ?baseLeaf. -# ?inRelationEdge amr:hasAmrRole ?inRelationRole.} - -# # -- Identify outgoing relations linked to the base leaf (for propagation) -# OPTIONAL {?outNet a [rdfs:subClassOf* net:Net] ; -# net:coverBaseNode ?outLeaf. -# ?baseLeaf ?outRelationEdge ?outLeaf. -# ?outRelationEdge amr:hasAmrRole ?outRelationRole.} -# """, -# 'binding': """ -# # -- New Class Name -# BIND (CONCAT(str(?baseName), '-', str(?propertyName)) AS ?cn1). -# BIND (CONCAT(?cn1, '-', str(?argName)) AS ?newClassName1). -# BIND (CONCAT(str(?argName), '-', str(?baseName)) AS ?newClassName2). -# BIND (IF (?propertyName != 'hasFeature', -# ?newClassName1, -# ?newClassName2) -# AS ?newClassName). - -# # -- New Restriction Net -# BIND (CONCAT(str(net:), 'restriction') AS ?rn1). -# BIND (CONCAT(?rn1, '_', str(?propertyName)) AS ?rn2). -# BIND (CONCAT(?rn2, '_', str(?argName)) AS ?rn3). -# BIND (uri(?rn3) AS ?newRestrictionNet). - -# # -- New Class Net -# BIND (CONCAT(str(net:), 'compositeClass') AS ?n1). -# BIND (CONCAT(?n1, '_', ?newClassName) AS ?n2). -# BIND (uri(?n2) AS ?newClassNet). -# """ -# } - - -#============================================================================== -# Development Test -#============================================================================== - -if __name__ == '__main__': - - print('\n' + ' *** Development Test ***') - - print('\n' + ' -- Test Query') - rule = rule_set['create-composite-class-net-from-property-3'] - test_query_1 = f"""[...] - CONSTRUCT {{ - {rule['construction']} - - }} - WHERE {{ - {rule['clause']} - - {rule['binding']} - - }} - """ - print(test_query_1) - - print('\n' + ' *** - ***') \ No newline at end of file diff --git a/tenet/scheme/amr_clara_rule/nov_transduction/composite_class_extraction_2.py b/tenet/scheme/amr_clara_rule/nov_transduction/composite_class_extraction_2.py deleted file mode 100644 index a662f621..00000000 --- a/tenet/scheme/amr_clara_rule/nov_transduction/composite_class_extraction_2.py +++ /dev/null @@ -1,291 +0,0 @@ -#!/usr/bin/python3.10 -# -*-coding:Utf-8 -* - -#============================================================================== -# TENET: AMR CTR at 'Net Expansion' level -#------------------------------------------------------------------------------ -# Module grouping compositional transduction rule_sets (CTR) for the analysis of -# AMR structures, at 'Net Expansion' level -#============================================================================== - -#============================================================================== -# CTR Set (CTR as Sparql querries) -#============================================================================== - -rule_set = {} - - -# --------------------------------------------- -# Net Expansion: Composite Class Net from Phenomena Net -# --------------------------------------------- - -rule_set['create-composite-class-net-from-phenomena-1'] = { - 'label': "create-composite-class-net-from-phenomena-1", - 'comment': ("Create Composite Class Net from relations: ", - " (1) between classes and DEGREE phenomena", - " (2) targetting attribute (:ARG2) and degree (:ARG3)"), - 'construction': """ - # -- New Class Net (on attributeNet base leaf) - ?newNet a net:Composite_Class_Net ; - net:hasStructure ?sentenceRef ; - net:coverBaseNode ?baseLeaf ; - net:coverArgNode ?degreeLeaf ; - net:hasNaming ?newClassName ; - net:hasClassName ?newClassName ; - net:hasMotherClassNet ?attributeNet. - ?degreePhenomenaNet net:targetSubAttribute ?newNet. - - # -- Propagation of relations (from nodes to nets) - ?inRelationRole a net:Relation. - ?inNet ?inRelationRole ?newNet. - ?outRelationRole a net:Relation. - ?newNet ?outRelationRole ?outNet. - """, - 'clause': """ - # -- Identify degree(attribute, degree) - ?degreePhenomenaNet a net:Phenomena_Net ; - net:coverBaseNode ?phenomenaLeaf ; - net:targetAttribute ?attributeNet ; - net:targetDegree ?degreeNet ; - net:hasPhenomenaType amr:phenomena_degree. - ?attributeNet a [rdfs:subClassOf* net:Class_Net] ; - net:coverBaseNode ?baseLeaf ; - net:hasClassName ?attributeName. - ?degreeNet a [rdfs:subClassOf* net:Class_Net] ; - net:coverBaseNode ?degreeLeaf ; - net:hasClassName ?degreeName. - - # -- Identify structure - ?root a amr:AMR_Root ; - amr:hasSentenceID ?sentenceRef. - - # -- Identify inbound relations linked to the base leaf (for propagation) - OPTIONAL {?inNet a [rdfs:subClassOf* net:Net] ; - net:coverBaseNode ?inLeaf. - ?inLeaf ?inRelationEdge ?baseLeaf. - ?inRelationEdge amr:hasAmrRole ?inRelationRole.} - - # -- Identify outgoing relations linked to the base leaf (for propagation) - OPTIONAL {?outNet a [rdfs:subClassOf* net:Net] ; - net:coverBaseNode ?outLeaf. - ?baseLeaf ?outRelationEdge ?outLeaf. - ?outRelationEdge amr:hasAmrRole ?outRelationRole.} - """, - 'binding': """ - # -- New Class Name - BIND (CONCAT(str(?degreeName), '-', - str(?attributeName)) AS ?newClassName). - - # -- New Class Net - BIND (CONCAT(str(net:), 'compositeClass') AS ?n1). - BIND (CONCAT(?n1, '_', ?newClassName) AS ?n2). - BIND (uri(?n2) AS ?newNet). - """ -} - -rule_set['create-composite-class-net-from-phenomena-2'] = { - 'label': "create-composite-class-net-from-phenomena-2", - 'comment': ("Create Composite Class Net from relations: ", - " (1) between classes and DEGREE phenomena", - " (2) targetting domain (:ARG1) and attribute (:ARG2)"), - 'construction': """ - # -- New Class Net (on domainNet base leaf) - ?newNet a net:Composite_Class_Net ; - net:hasStructure ?sentenceRef ; - net:coverBaseNode ?baseLeaf ; - net:coverArgNode ?attributeLeaf ; - net:hasNaming ?newClassName ; - net:hasClassName ?newClassName ; - net:hasMotherClassNet ?domainNet. - ?degreePhenomenaNet net:targetSubDomain ?newNet. - - # -- Propagation of relations (from nodes to nets) - ?inRelationRole a net:Relation. - ?inNet ?inRelationRole ?newNet. - ?outRelationRole a net:Relation. - ?newNet ?outRelationRole ?outNet. - """, - 'clause': """ - # -- Identify degree(domain, attribute) - ?degreePhenomenaNet a net:Phenomena_Net ; - net:coverBaseNode ?phenomenaLeaf ; - net:targetDomain ?domainNet ; - net:targetAttribute ?attributeNet ; - net:hasPhenomenaType amr:phenomena_degree. - ?domainNet a [rdfs:subClassOf* net:Class_Net] ; - net:coverBaseNode ?baseLeaf ; - net:hasClassName ?domainName. - ?attributeNet a [rdfs:subClassOf* net:Class_Net] ; - net:coverNode ?attributeLeaf ; - net:hasClassName ?attributeName. - - # -- Identify structure - ?root a amr:AMR_Root ; - amr:hasSentenceID ?sentenceRef. - - # -- Identify inbound relations linked to the base leaf (for propagation) - OPTIONAL {?inNet a [rdfs:subClassOf* net:Net] ; - net:coverBaseNode ?inLeaf. - ?inLeaf ?inRelationEdge ?baseLeaf. - ?inRelationEdge amr:hasAmrRole ?inRelationRole.} - - # -- Identify outgoing relations linked to the base leaf (for propagation) - OPTIONAL {?outNet a [rdfs:subClassOf* net:Net] ; - net:coverBaseNode ?outLeaf. - ?baseLeaf ?outRelationEdge ?outLeaf. - ?outRelationEdge amr:hasAmrRole ?outRelationRole.} - """, - 'binding': """ - # -- New Class Name - BIND (CONCAT(str(?attributeName), '-', - str(?domainName)) AS ?newClassName). - - # -- New Class Net - BIND (CONCAT(str(net:), 'compositeClass') AS ?n1). - BIND (CONCAT(?n1, '_', ?newClassName) AS ?n2). - BIND (uri(?n2) AS ?newNet). - """ -} - -rule_set['create-composite-class-net-from-phenomena-3'] = { - 'label': "create-composite-class-net-from-phenomena-3", - 'comment': ("Create Composite Class Net from relations: ", - " (1) between classes and DEGREE phenomena", - " (2) targetting sub-domain and sub-attribute"), - 'construction': """ - # -- New Class Net (on domainNet base leaf) - ?newNet a net:Composite_Class_Net ; - net:hasStructure ?sentenceRef ; - net:coverBaseNode ?baseLeaf ; - net:coverArgNode ?subAttributeLeaf ; - net:hasNaming ?newClassName ; - net:hasClassName ?newClassName ; - net:hasMotherClassNet ?subDomainNet. - ?degreePhenomenaNet net:targetSubDomain ?newNet. - - # -- Propagation of relations (from nodes to nets) - ?inRelationRole a net:Relation. - ?inNet ?inRelationRole ?newNet. - ?outRelationRole a net:Relation. - ?newNet ?outRelationRole ?outNet. - """, - 'clause': """ - # -- Identify degree(sub-domain, sub-attribute) - ?degreePhenomenaNet a net:Phenomena_Net ; - net:coverBaseNode ?phenomenaLeaf ; - net:targetDomain ?domainNet ; - net:targetSubDomain ?subDomainNet ; - net:targetSubAttribute ?subAttributeNet ; - net:hasPhenomenaType amr:phenomena_degree. - ?subDomainNet a [rdfs:subClassOf* net:Class_Net] ; - net:coverBaseNode ?baseLeaf ; - net:hasClassName ?subDomainName. - ?subAttributeNet a [rdfs:subClassOf* net:Class_Net] ; - net:coverNode ?subAttributeLeaf ; - net:hasClassName ?subAttributeName. - - # -- Identify structure - ?root a amr:AMR_Root ; - amr:hasSentenceID ?sentenceRef. - - # -- Identify inbound relations linked to the base leaf (for propagation) - OPTIONAL {?inNet a [rdfs:subClassOf* net:Net] ; - net:coverBaseNode ?inLeaf. - ?inLeaf ?inRelationEdge ?baseLeaf. - ?inRelationEdge amr:hasAmrRole ?inRelationRole.} - - # -- Identify outgoing relations linked to the base leaf (for propagation) - OPTIONAL {?outNet a [rdfs:subClassOf* net:Net] ; - net:coverBaseNode ?outLeaf. - ?baseLeaf ?outRelationEdge ?outLeaf. - ?outRelationEdge amr:hasAmrRole ?outRelationRole.} - """, - 'binding': """ - # -- New Class Name - BIND (CONCAT(str(?subAttributeName), '-', - str(?subDomainName)) AS ?newClassName). - - # -- New Class Net - BIND (CONCAT(str(net:), 'compositeClass') AS ?n1). - BIND (CONCAT(?n1, '_', ?newClassName) AS ?n2). - BIND (uri(?n2) AS ?newNet). - """ -} - -rule_set['create-composite-class-net-from-phenomena-4'] = { - 'label': "create-composite-class-net-from-phenomena-4", - 'comment': ("Create Composite Class Net from relations: ", - " (1) between classes and DEGREE phenomena", - " (2) targetting sub-domain and superlative"), - 'construction': """ - # -- New Class Net (on subDomainNet base leaf) - ?newNet a net:Composite_Class_Net ; - net:hasStructure ?sentenceRef ; - net:coverBaseNode ?superlativeLeaf ; - net:coverArgNode ?baseLeaf ; - net:hasNaming ?newClassName ; - net:hasClassName ?newClassName ; - net:hasMotherClassNet ?superlativeNet. - ?degreePhenomenaNet net:targetSubDomain ?newNet. - - # -- Propagation of relations (from nodes to nets) - ?inRelationRole a net:Relation. - ?inNet ?inRelationRole ?newNet. - ?outRelationRole a net:Relation. - ?newNet ?outRelationRole ?outNet. - """, - 'clause': """ - # -- Identify degree(sub-domain, superlative) - ?degreePhenomenaNet a net:Phenomena_Net ; - net:coverBaseNode ?phenomenaLeaf ; - net:targetSubDomain ?subDomainNet ; - net:targetSuperlative ?superlativeNet ; - net:hasPhenomenaType amr:phenomena_degree. - ?subDomainNet a [rdfs:subClassOf* net:Class_Net] ; - net:coverBaseNode ?baseLeaf ; - net:coverNodeCount ?subDomainPrecision ; - net:hasClassName ?subDomainName. - FILTER NOT EXISTS { - ?otherSubDomainNet a [rdfs:subClassOf* net:Class_Net] ; - net:coverBaseNode ?baseLeaf ; - net:coverNodeCount ?otherSubDomainPrecision. - FILTER (?otherSubDomainPrecision > ?subDomainPrecision). - } - ?superlativeNet a [rdfs:subClassOf* net:Class_Net] ; - net:coverBaseNode ?superlativeLeaf ; - net:coverNodeCount ?superlativePrecision ; - net:hasClassName ?superlativeName. - FILTER NOT EXISTS { - ?otherSuperlativeNet a [rdfs:subClassOf* net:Class_Net] ; - net:coverBaseNode ?superlativeLeaf ; - net:coverNodeCount ?otherSuperlativePrecision. - FILTER (?otherSuperlativePrecision > ?superlativePrecision). - } - - # -- Identify structure - ?root a amr:AMR_Root ; - amr:hasSentenceID ?sentenceRef. - - # -- Identify inbound relations linked to the base leaf (for propagation) - OPTIONAL {?inNet a [rdfs:subClassOf* net:Net] ; - net:coverBaseNode ?inLeaf. - ?inLeaf ?inRelationEdge ?baseLeaf. - ?inRelationEdge amr:hasAmrRole ?inRelationRole.} - - # -- Identify outgoing relations linked to the base leaf (for propagation) - OPTIONAL {?outNet a [rdfs:subClassOf* net:Net] ; - net:coverBaseNode ?outLeaf. - ?baseLeaf ?outRelationEdge ?outLeaf. - ?outRelationEdge amr:hasAmrRole ?outRelationRole.} - """, - 'binding': """ - # -- New Class Name - BIND (CONCAT(str(?subDomainName), '-in-', - str(?superlativeName)) AS ?newClassName). - - # -- New Class Net - BIND (CONCAT(str(net:), 'compositeClass') AS ?n1). - BIND (CONCAT(?n1, '_', ?newClassName) AS ?n2). - BIND (uri(?n2) AS ?newNet). - """ -} \ No newline at end of file diff --git a/tenet/scheme/amr_clara_rule/nov_transduction/composite_property_extraction.py b/tenet/scheme/amr_clara_rule/nov_transduction/composite_property_extraction.py deleted file mode 100644 index ae5fa0b1..00000000 --- a/tenet/scheme/amr_clara_rule/nov_transduction/composite_property_extraction.py +++ /dev/null @@ -1,228 +0,0 @@ -#!/usr/bin/python3.10 -# -*-coding:Utf-8 -* - -#============================================================================== -# TENET: AMR CTR at 'Net Expansion' level -#------------------------------------------------------------------------------ -# Module grouping compositional transduction rule_sets (CTR) for the analysis of -# AMR structures, at 'Net Expansion' level -#============================================================================== - -#============================================================================== -# CTR Set (CTR as Sparql querries) -#============================================================================== - -rule_set = {} - - -# --------------------------------------------- -# Net Expansion: Composite Property Net from Property Net -# --------------------------------------------- - -rule_set['create-composite-property-net-from-property-1'] = { - 'label': "create-composite-class-net-from-property-1", - 'comment': ("Create Composite Property Net from relations: ", - " (1) between two core properties", - " (2) with :ARG1 relation"), - 'construction': """ - # -- New Property Net - ?newNet a net:Composite_Property_Net ; - net:isCoreRoleLinked true ; - net:hasStructure ?sentenceRef ; - net:coverBaseNode ?baseLeaf ; - net:coverArgNode ?property2Leaf ; - net:hasPropertyType ?property1Type ; - net:hasNaming ?newPropertyName ; - net:hasPropertyName ?newPropertyName ; - net:hasMotherClassNet ?property2Net. - #net:hasRestriction ?restrictionNet. - - # -- Propagation of relations (from nodes to nets) - ?inRelationRole a net:Relation. - ?inNet ?inRelationRole ?newNet. - ?outRelationRole a net:Relation. - ?newNet ?outRelationRole ?outNet. - """, - 'clause': """ - # -- Identify ARG1(p1:Property, p2:Property) - ?property1Net a [rdfs:subClassOf* net:Property_Net] ; - net:isCoreRoleLinked true ; - net:hasStructure ?sentenceRef ; - net:coverBaseNode ?baseLeaf ; - net:hasPropertyType ?property1Type ; - net:hasPropertyName ?property1Name. - ?baseLeaf ?r1 ?property2Leaf. - ?r1 amr:hasAmrRole amr:role_ARG1. - ?property2Net a [rdfs:subClassOf* net:Property_Net] ; - net:isCoreRoleLinked true ; - net:coverBaseNode ?property2Leaf ; - net:hasPropertyName ?property2Name. - - # -- condition: disjoint cover - FILTER NOT EXISTS {?property1Leaf net:coverNode ?node. - ?property2Leaf net:coverNode ?node.} - - # -- Identify inbound relations linked to the base leaf (for propagation) - OPTIONAL {?inNet a [rdfs:subClassOf* net:Net] ; - net:coverBaseNode ?inLeaf. - ?inLeaf ?inRelationEdge ?baseLeaf. - ?inRelationEdge amr:hasAmrRole ?inRelationRole.} - - # -- Identify outgoing relations linked to the base leaf (for propagation) - OPTIONAL {?outNet a [rdfs:subClassOf* net:Net] ; - net:coverBaseNode ?outLeaf. - ?baseLeaf ?outRelationEdge ?outLeaf. - ?outRelationEdge amr:hasAmrRole ?outRelationRole.} - """, - 'binding': """ - # -- New Property Name - BIND (CONCAT(?property1Name, '-', ?property2Name) AS ?newPropertyName). - - # -- New Property Net - BIND (CONCAT(str(net:), 'compositeProperty') AS ?n1). - BIND (CONCAT(?n1, '_', ?newPropertyName) AS ?n2). - BIND (uri(?n2) AS ?newNet). - """ -} - -rule_set['create-composite-property-net-from-property-2'] = { - 'label': "create-composite-class-net-from-property-2", - 'comment': ("Create Composite Property Net from relations: ", - " (1) between two core properties", - " (2) with manner property on the same leaf of left property"), - 'construction': """ - # -- New Property Net - ?newNet a net:Composite_Property_Net ; - net:isCoreRoleLinked true ; - net:hasStructure ?sentenceRef ; - net:coverBaseNode ?baseLeaf ; - net:coverArgNode ?property2Leaf ; - net:hasPropertyType ?property1Type ; - net:hasNaming ?newPropertyName ; - net:hasPropertyName ?newPropertyName ; - net:hasMotherClassNet ?property1Net. - #net:hasRestriction ?restrictionNet. - - # -- Propagation of relations (from nodes to nets) - ?inRelationRole a net:Relation. - ?inNet ?inRelationRole ?newNet. - ?outRelationRole a net:Relation. - ?newNet ?outRelationRole ?outNet. - """, - 'clause': """ - # -- Identify cover(p1:Property, leaf1) and cover(m:Manner, leaf1) - ?property1Net a [rdfs:subClassOf* net:Property_Net] ; # property 1 - net:isCoreRoleLinked true ; - net:hasStructure ?sentenceRef ; - net:coverBaseNode ?baseLeaf ; - net:hasPropertyType ?property1Type ; - net:hasPropertyName ?property1Name. - ?mannerPropertyNet a [rdfs:subClassOf* net:Property_Net] ; # manner property - net:isCoreRoleLinked true ; - net:hasStructure ?sentenceRef ; - net:coverBaseNode ?baseLeaf ; - net:hasPropertyType ?mannerPropertyType ; - net:hasPropertyName ?mannerPropertyName. - - # -- Identify :manner(p2:Property) - ?mannerPropertyNet amr:role_manner ?property2Net. - ?property2Net a [rdfs:subClassOf* net:Property_Net] ; - net:isCoreRoleLinked true ; - net:coverBaseNode ?property2Leaf ; - net:hasPropertyName ?property2Name. - - # -- condition: disjoint cover - FILTER NOT EXISTS {?sameBaseLeaf net:coverNode ?node. - ?property2Leaf net:coverNode ?node.} - - # -- Identify inbound relations linked to the base leaf (for propagation) - OPTIONAL {?inNet a [rdfs:subClassOf* net:Net] ; - net:coverBaseNode ?inLeaf. - ?inLeaf ?inRelationEdge ?baseLeaf. - ?inRelationEdge amr:hasAmrRole ?inRelationRole.} - - # -- Identify outgoing relations linked to the base leaf (for propagation) - OPTIONAL {?outNet a [rdfs:subClassOf* net:Net] ; - net:coverBaseNode ?outLeaf. - ?baseLeaf ?outRelationEdge ?outLeaf. - ?outRelationEdge amr:hasAmrRole ?outRelationRole.} - """, - 'binding': """ - # -- New Property Name - BIND (CONCAT(?property2Name, '-', ?property1Name) AS ?newPropertyName). - # -- New Property Net - BIND (CONCAT(str(net:), 'compositeProperty') AS ?n1). - BIND (CONCAT(?n1, '_', ?newPropertyName) AS ?n2). - BIND (uri(?n2) AS ?newNet). - """ -} - - -# --------------------------------------------- -# Net Expansion: Add Restriction to Class Net from Property Net -# --------------------------------------------- - -rule_set['add-restriction-to-class-net-from-property-1'] = { - 'label': "add-restriction-to-class-net-from-property-1", - 'comment': ("Create and add a Restriction Net: ", - " (1) from relation between a class and an individual, ", - " (2) with a relation corresponding to Non-Core Role property"), - 'construction': """ - # -- New Restriction Net - ?newNet a net:Restriction_Net ; - net:hasStructure ?sentenceRef ; - net:coverBaseNode ?baseLeaf ; - net:coverTargetNode ?argNodeOfBaseNet, ?nodeOfArgNet ; - net:hasRestrictionOnProperty ?propertyNet ; - net:hasRestrictionNetValue ?argNet. - - # -- New restriction relation - ?baseNet net:hasRestriction ?newNet. - - # -- Propagation of relations (from nodes to nets) - ?inRelationRole a net:Relation. - ?inNet ?inRelationRole ?newNet. - ?outRelationRole a net:Relation. - ?newNet ?outRelationRole ?outNet. - """, - 'clause': """ - # -- Identify property(Class, Individual) - ?propertyNet a [rdfs:subClassOf* net:Property_Net]; - net:isCoreRoleLinked false ; - net:hasStructure ?sentenceRef ; - net:coverBaseNode ?baseLeaf ; - net:hasPropertyRole ?propertyRole ; - net:hasPropertyName ?propertyName. - ?baseNet a [rdfs:subClassOf* net:Class_Net] ; - net:coverBaseNode ?baseLeaf ; - net:coverNode ?nodeOfBaseNet ; - net:hasClassName ?baseName. - ?argNet a net:Individual_Net ; - net:coverNode ?nodeOfArgNet ; - net:hasIndividualLabel ?argLabel. - ?baseNet ?propertyRole ?argNet. - - # -- condition: disjoint cover - FILTER NOT EXISTS {?baseNet net:coverNode ?node. - ?argNet net:coverNode ?node.} - - # -- Identify inbound relations linked to the base leaf (for propagation) - OPTIONAL {?inNet a [rdfs:subClassOf* net:Net] ; - net:coverBaseNode ?inLeaf. - ?inLeaf ?inRelationEdge ?baseLeaf. - ?inRelationEdge amr:hasAmrRole ?inRelationRole.} - - # -- Identify outgoing relations linked to the base leaf (for propagation) - OPTIONAL {?outNet a [rdfs:subClassOf* net:Net] ; - net:coverBaseNode ?outLeaf. - ?baseLeaf ?outRelationEdge ?outLeaf. - ?outRelationEdge amr:hasAmrRole ?outRelationRole.} - """, - 'binding': """ - # -- New Restriction Net - BIND (CONCAT(str(net:), 'restriction') AS ?rn1). - BIND (CONCAT(?rn1, '_', str(?propertyName)) AS ?rn2). - BIND (CONCAT(?rn2, '_', str(?argLabel)) AS ?rn3). - BIND (uri(?rn3) AS ?newNet). - """ -} \ No newline at end of file diff --git a/tenet/scheme/amr_clara_rule/nov_transduction/phenomena_application_and.py b/tenet/scheme/amr_clara_rule/nov_transduction/phenomena_application_and.py deleted file mode 100644 index 2b0db732..00000000 --- a/tenet/scheme/amr_clara_rule/nov_transduction/phenomena_application_and.py +++ /dev/null @@ -1,254 +0,0 @@ -#!/usr/bin/python3.10 -# -*-coding:Utf-8 -* - -#============================================================================== -# TENET: AMR CTR at 'Net Expansion' level -#------------------------------------------------------------------------------ -# Module grouping compositional transduction rule_sets (CTR) for the analysis of -# AMR structures, at 'Net Expansion' level -#============================================================================== - -#============================================================================== -# Query Builder Imports -#============================================================================== - -#import query_builder.construct as construct -from query_builder.builders import * -from query_builder.element.net import Net - - -#============================================================================== -# CTR Set (CTR as Sparql querries) -#============================================================================== - -rule_set = {} - -# --------------------------------------------- -# Net Expansion: Conjunction Phenomena Net -# --------------------------------------------- - -rule_set['and-conjunction-phenomena-application-1'] = { - 'label': "and-conjunction-phenomena-application-1", - 'comment': ("Apply conjunction phenomena, step 1: ", - " (1) create logical set", - " (2) FROM and-conjunction linking some nets and a property"), - 'construction': f""" - {logical_set_net.construct(base_node=phenomena_net.base_node, - logical_constraint='"AND"', - property_net=atom_property_net.id, - content_net_1='?contentNet1')} - {logical_set_net.add_attribute(content_net_2='?contentNet2')} - {logical_set_net.add_attribute(content_net='?contentNet1')} - {logical_set_net.add_attribute(content_net='?contentNet2')} - {logical_set_net.add_attribute(content_net='?contentNet3')} - {logical_set_net.add_attribute(content_net='?contentNet4')} - {logical_set_net.add_attribute(content_net='?contentNet5')} - {logical_set_net.add_attribute(content_net='?contentNet6')} - {logical_set_net.add_attribute(content_net='?contentNet7')} - {logical_set_net.add_attribute(content_net='?contentNet8')} - {logical_set_net.add_attribute(content_net='?contentNet9')} - - {logical_set_net.propagate_relations()} - """, - 'clause': f""" - - # *** Identify Property(-, arg1:PhenomenaNet) *** - - {atom_property_net.identify_net(core_role='true')} - {atom_property_net.id} amr:role_ARG1 {phenomena_net.id}. - - - # *** Identify Phenomena(AND-conjunction, contentNet*) *** - - {phenomena_net.identify_net(phenomena_type='amr:phenomena_conjunction_and')} - - # -- old --- ?relationOp rdfs:subClassOf* amr:AMR_Op_Role. - {phenomena_net.identify_operator('1', '?contentNet')} - {phenomena_net.identify_optional_operator('2', '?contentNet')} - {phenomena_net.identify_optional_operator('3', '?contentNet')} - {phenomena_net.identify_optional_operator('4', '?contentNet')} - {phenomena_net.identify_optional_operator('5', '?contentNet')} - {phenomena_net.identify_optional_operator('6', '?contentNet')} - {phenomena_net.identify_optional_operator('7', '?contentNet')} - {phenomena_net.identify_optional_operator('8', '?contentNet')} - {phenomena_net.identify_optional_operator('9', '?contentNet')} - - - # *** Identify variable label of base leaf *** - {phenomena_net.base_node} a amr:AMR_Leaf ; - amr:hasVariable ?variable. - ?variable amr:label ?varLabel. - - {logical_set_net.complete_clauses_for_construction(phenomena_net.base_node)} - """, - 'binding': f""" - {logical_set_net.bind_uri(phenomena_net.phenomena_ref, '?varLabel')} - """ -} - -rule_set['and-conjunction-phenomena-application-2'] = { - 'label': "and-conjunction-phenomena-application-2", - 'comment': ("Apply conjunction phenomena (step 2): ", - " (1) complete Logical Set Net for naming"), - 'construction': f""" - {logical_set_net.define_naming()} - """, - 'clause': f""" - - # *** Identify LogicalSet Net *** - {logical_set_net.identify_net_without_optional_attribute( - property_net=property_net.id, - content_net_1=class_net_1.id, - content_net_2=class_net_2.id)} - - - # *** Identify property and classes *** - {property_net.identify_net(core_role='true')} - {class_net_1.identify_net()} - {class_net_2.identify_net()} - - """, - 'binding': f""" - {logical_set_net.bind_naming(property_net.property_name, - class_net_1.class_name, - class_net_2.class_name)} - """ -} - -rule_set['and-conjunction-phenomena-application-3'] = { - 'label': "and-conjunction-phenomena-application-3", - 'comment': ("Apply conjunction phenomena (step 3): ", - " (1) complete Logical Set Net with restriction(s)"), - 'construction': f""" - - {restriction_net.construct(restriction_property=property_net.id, - restriction_net_value=class_net.id)} - {restriction_net.add_attribute(node=property_net.node)} - {restriction_net.add_attribute(node=logical_set_net.node)} - {restriction_net.add_attribute(node=class_net.node)} - - {logical_set_net.add_attribute(restriction=restriction_net.id)} - """, - 'clause': f""" - # *** Identify LogicalSet Net *** - {logical_set_net.identify_net(property_net=property_net.id)} - {logical_set_net.identify_content_net(class_net.id)} - - # *** Identify property and classes *** - {property_net.identify_net(core_role='true')} - {class_net.identify_net()} - """, - 'binding': f""" - {restriction_net.bind_uri(property_net.property_name, class_net.class_name)} - """ -} - -rule_set['and-conjunction-phenomena-application-4'] = { - 'label': "and-conjunction-phenomena-application-4", - 'comment': ("Apply conjunction phenomena (step 4): ", - " (1) create composite class net", - " (2) FROM property linking class and logical set"), - 'construction': f""" - {composite_class_net.construct(base_node=class_net_0.base_node, - naming='?newClassName', - class_name='?newClassName', - mother_class_net=class_net_0.id)} - {composite_class_net.compose(class_net_0, property_net, logical_set_net)} - """, - 'clause': f""" - # *** Identify Property(arg0:Class, arg1:LogicalSet) *** - {property_net.identify_net(core_role='true')} - {property_net.id} amr:role_ARG0 {class_net_0.id}. - {property_net.id} amr:role_ARG1 {logical_set_net.id}. - - # *** Identify class and logical set *** - {class_net_0.identify_net()} - {logical_set_net.identify_net(logical_constraint='"AND"')} - - # *** condition: disjoint cover *** - FILTER NOT EXISTS {{ - {class_net_0.id} net:coverNode ?node. - {logical_set_net.id} net:coverNode ?node. - }} - - # *** Identify variable label of base leaf *** - {class_net_0.base_node} a amr:AMR_Leaf ; - amr:hasVariable ?variable. - ?variable amr:label ?varLabel. - """, - 'binding': f""" - # -- New Class Name - BIND (CONCAT({class_net_0.class_name}, '-', {logical_set_net.naming}) AS ?newClassName). - - {composite_class_net.bind_uri('?newClassName', '?varLabel')} - """ -} - -rule_set['and-conjunction-phenomena-application-5'] = { - 'label': "and-conjunction-phenomena-application-5", - 'comment': ("Apply conjunction phenomena (step 5): ", - " (1) complete Logical Set Net for relation propagation"), - 'construction': f""" - {composite_class_net.define_structure()} - {composite_class_net.propagate_relations()} - """, - 'clause': f""" - # *** Identify CompositeClass with a LogicalSet composante *** - {composite_class_net.identify_net()} - {composite_class_net.filter_already_processed_net(Net.RELATION_PROPAGATED)} - - # *** Complete clauses for net construction *** - {composite_class_net.complete_clauses_for_construction()} - """, - 'binding': f""" - """ -} - -rule_set['and-conjunction-phenomena-application-6'] = { - 'label': "and-conjunction-phenomena-application-6", - 'comment': ("Apply conjunction phenomena (step 6): ", - " (1) complete Logical Set Net by adding restrictions"), - 'construction': f""" - {composite_class_net.add_attribute(restriction01=restriction_net.id)} - """, - 'clause': f""" - # *** Identify CompositeClass in progress step INIT *** - {composite_class_net.identify_net()} - {composite_class_net.filter_already_processed_net(Net.RESTRICTION_ADDED)} - {logical_set_net.identify_net()} - {composite_class_net.identify_composante(logical_set_net.id)} - - # *** Identify Restriction *** - {restriction_net.identify_net()} - {logical_set_net.identify_restriction(restriction_net.id)} - """, - 'binding': f""" - """ -} - - -# --------------------------------------------- -# *** Under Development *** New Rule -# --------------------------------------------- - -# -- Useful query builder(s) -# * TODO * property_net = PropertyNet() -# * TODO * class_net_0 = ClassNet(0) -# * TODO * phenomena_net = PhenomenaNet() -# * TODO * and_composite_class_net = AndCompositeClassNet() - -def analyze_phenomena_and(): - rule = 'NewRule()' # !!! TODO !!! - - # rule.clause(f'{property_net.identify_net(core_role="true")}') - # rule.clause(f'{property_net.id} amr:role_ARG0 {class_net_0.id}.') - # rule.clause(f'{property_net.id} amr:role_ARG1 {phenomena_net.id}.') - # rule.clause(f'{phenomena_net.identify_net(phenomena_type='amr:phenomena_conjunction_and')}') - - # rule.operate(f'{and_composite_class_net.construct(*TODO*)}') - - # * TODO * add restrictions for and_composite_class_net --op--> class_net - - # * TODO * rule.operate(and_composite_class_net.complete_clauses_for_construction()) - - return rule diff --git a/tenet/scheme/amr_clara_rule/nov_transduction/phenomena_application_mod.py b/tenet/scheme/amr_clara_rule/nov_transduction/phenomena_application_mod.py deleted file mode 100644 index e22d6735..00000000 --- a/tenet/scheme/amr_clara_rule/nov_transduction/phenomena_application_mod.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/python3.10 -# -*-coding:Utf-8 -* - -#============================================================================== -# TENET: AMR CTR at 'Net Expansion' level -#------------------------------------------------------------------------------ -# Module grouping compositional transduction rule_sets (CTR) for the analysis of -# AMR structures, at 'Net Expansion' level -#============================================================================== - -#============================================================================== -# Query Builder Imports -#============================================================================== - -#import query_builder.construct as construct -from query_builder.builders import * -from query_builder.element.net import Net - - -#============================================================================== -# CTR Set (CTR as Sparql querries) -#============================================================================== - -rule_set = {} - - -# --------------------------------------------- -# Net Expansion: Mod Phenomena Application -# --------------------------------------------- - -rule_set['mod-phenomena-application-1'] = { - 'label': "mod-phenomena-application-1", - 'comment': ("Apply mod phenomena (step 1) to: ", - " (+) initialize composite class construction. "), - 'construction': f""" - {composite_class_net.construct(base_node=class_net_1.base_node, - class_name='?newClassName', - mother_class_net=class_net_1.id)} - {composite_class_net.compose(class_net_1, class_net_2)} - """, - 'clause': f""" - # *** Identify Mod(c1:Class, c2:Class) *** - {class_net_1.identify_net()} - {class_net_1.identify_relation('amr:role_mod', class_net_2.id)} - {class_net_2.identify_net()} - - # *** Identify variable label of base leaf *** - {class_net_1.base_node} a amr:AMR_Leaf ; - amr:hasVariable ?variable. - ?variable amr:label ?varLabel. - """, - 'binding': f""" - # -- New Class Name - BIND (CONCAT({class_net_2.class_name}, '-', {class_net_1.class_name}) - AS ?newClassName). - - {composite_class_net.bind_uri('?newClassName', '?varLabel')} - """ -} - -rule_set['mod-phenomena-application-2'] = { - 'label': "mod-phenomena-application-2", - 'comment': ("Apply mod phenomena (step 2) to: ", - " (+) complete Composite Class Net for relation propagation"), - 'construction': f""" - {composite_class_net.define_structure()} - {composite_class_net.propagate_relations()} - """, - 'clause': f""" - # *** Identify CompositeClass without relation propagated *** - {composite_class_net.identify_net()} - {composite_class_net.filter_already_processed_net(Net.RELATION_PROPAGATED)} - - # *** Complete clauses for net construction *** - {composite_class_net.complete_clauses_for_construction()} - """, - 'binding': f""" - """ -} - -rule_set['mod-phenomena-application-3'] = { - 'label': "mod-phenomena-application-3", - 'comment': ("Apply mod phenomena (step 3) to: ", - " (+) initialize Individual Net construction"), - 'construction': f""" - {individual_net.construct(base_node=class_net_2.base_node, - base_class_name='"Feature"', - individual_label='?newIndividualLabel')} - {individual_net.compose(class_net_2)} - {individual_net.define_structure()} - """, - 'clause': f""" - # *** Identify Mod(:Class, c2:Class) *** - ?net amr:role_mod {class_net_2.id}. - {class_net_2.identify_net()} - - # *** Identify variable label of base leaf *** - {class_net_2.base_node} a amr:AMR_Leaf ; - amr:hasVariable ?variable. - ?variable amr:label ?varLabel. - - # *** Complete clauses for net construction *** - {individual_net.complete_clauses_for_construction()} - """, - 'binding': f""" - # -- New Individual Label - BIND (STR({class_net_2.class_name}) AS ?newIndividualLabel). - - {individual_net.bind_uri('?newIndividualLabel', '?varLabel')} - """ -} - -rule_set['mod-phenomena-application-4'] = { - 'label': "mod-phenomena-application-4", - 'comment': ("Apply mod phenomena (step 4) to: ", - " (4) complete Composite Class Net by adding restrictions"), - 'construction': f""" - {composite_class_net.add_attribute(restriction01=restriction_net.id)} - """, - 'clause': f""" - # *** Identify CompositeClass in progress step INIT *** - {composite_class_net.identify_net()} - {composite_class_net.filter_already_processed_net(Net.RESTRICTION_ADDED)} - {logical_set_net.identify_net()} - {composite_class_net.identify_composante(logical_set_net.id)} - - # *** Identify Restriction *** - {restriction_net.identify_net()} - {logical_set_net.identify_restriction(restriction_net.id)} - """, - 'binding': f""" - """ -} diff --git a/tenet/scheme/amr_clara_rule/nov_transduction/phenomena_application_polarity.py b/tenet/scheme/amr_clara_rule/nov_transduction/phenomena_application_polarity.py deleted file mode 100644 index b55d9b42..00000000 --- a/tenet/scheme/amr_clara_rule/nov_transduction/phenomena_application_polarity.py +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/python3.10 -# -*-coding:Utf-8 -* - -#============================================================================== -# TENET: AMR CTR at 'Net Expansion' level -#------------------------------------------------------------------------------ -# Module grouping compositional transduction rule_sets (CTR) for the analysis of -# AMR structures, at 'Net Expansion' level -#============================================================================== - -#============================================================================== -# Query Builder Imports -#============================================================================== - -#import query_builder.construct as construct -from query_builder.builders import * -from query_builder.element.net import Net - - -#============================================================================== -# CTR Set (CTR as Sparql querries) -#============================================================================== - -rule_set = {} - - -# --------------------------------------------- -# Net Expansion: Polarity Phenomena Application -# --------------------------------------------- - -rule_set['nov-polarity-phenomena-application'] = { - 'label': "polarity-phenomena-application", - 'comment': ("Apply polarity phenomena to: ", - " (1) polarity relation on a property class. "), - 'construction': f""" - - # !!! TODO: restriction for negative polarity !!! - - {composite_property_net.construct(base_node=atom_property_net.base_node, - naming='?newPropertyName', - property_name='?newPropertyName')} - - {composite_property_net.propagate_relations()} - - {atom_property_net.deprecate()} - - """, - 'clause': f""" - # *** Identify Polarity(p0:Property, 'negative') *** - - {atom_property_net.identify_net(core_role='true')} - - {atom_property_net.identify_relation('amr:role_polarity', value_net.id)} - {value_net.identify_net(value_label="'negative'")} - - # *** Identify variable label of base leaf *** - {atom_property_net.base_node} a amr:AMR_Leaf ; - amr:hasVariable ?variable. - ?variable amr:label ?varLabel. - - {composite_property_net.complete_clauses_for_construction(atom_property_net.base_node)} - """, - 'binding': f""" - # -- New Property Name - BIND (CONCAT('not', '-', {atom_property_net.property_name}) AS ?newPropertyName). - - {composite_property_net.bind_uri('?newPropertyName', '?varLabel')} - """ -} diff --git a/tenet/scheme/amr_clara_rule/nov_transduction/phenomena_checking.py b/tenet/scheme/amr_clara_rule/nov_transduction/phenomena_checking.py deleted file mode 100644 index 4218333e..00000000 --- a/tenet/scheme/amr_clara_rule/nov_transduction/phenomena_checking.py +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/python3.10 -# -*-coding:Utf-8 -* - -#============================================================================== -# TENET: AMR CTR at 'Net Expansion' level -#------------------------------------------------------------------------------ -# Module grouping compositional transduction rule_sets (CTR) for the analysis of -# AMR structures, at 'Net Expansion' level -#============================================================================== - -#============================================================================== -# CTR Set (CTR as Sparql querries) -#============================================================================== - -rule_set = {} - - -# --------------------------------------------- -# Net Expansion: Conjunction Phenomena Net -# --------------------------------------------- - -rule_set['expand-and-or-conjunction-phenomena-net'] = { - 'label': "expand-and-conjunction-phenomena-net", - 'comment': ("Propagate relations for AND/OR conjunction net with: ", - " (1) incoming relation", - " (2) outgoing :op relation"), - 'construction': """ - ?leftNet ?incomingRelation ?rightNet. - """, - 'clause': """ - ?phenomenaNet a net:Phenomena_Net ; - net:hasPhenomenaType ?phenomenaType. - FILTER (?phenomenaType = amr:phenomena_conjunction_and || - ?phenomenaType = amr:phenomena_conjunction_or). - ?leftNet ?incomingRelation ?phenomenaNet. - ?phenomenaNet ?relationOp ?rightNet. - ?relationOp rdfs:subClassOf* amr:AMR_Op_Role. - """, - 'binding': """ - """ -} - - -# --------------------------------------------- -# Net Expansion: Degree Phenomena Net -# --------------------------------------------- - -rule_set['expand-degree-phenomena-net-1'] = { - 'label': "expand-degree-phenomena-net-1", - 'comment': ("Expand Degree Phenomena Net with: ", - " domain corresponding to :ARG1"), - 'construction': """ - ?degreePhenomenaNet net:targetDomain ?argTargetClassNet. - """, - 'clause': """ - ?degreePhenomenaNet a net:Phenomena_Net ; - net:coverBaseNode ?phenomenaLeaf ; - net:targetArgumentNode ?argTargetLeaf ; - net:hasPhenomenaType amr:phenomena_degree. - ?argTargetClassNet a [rdfs:subClassOf* net:Class_Net] ; - net:coverBaseNode ?argTargetLeaf. - ?phenomenaLeaf ?argEdge ?argTargetLeaf. - ?argEdge amr:hasAmrRole amr:role_ARG1. - """, - 'binding': """ - """ -} - -rule_set['expand-degree-phenomena-net-2'] = { - 'label': "expand-degree-phenomena-net-2", - 'comment': ("Expand Degree Phenomena Net with: ", - " attribute corresponding to :ARG2"), - 'construction': """ - ?degreePhenomenaNet net:targetAttribute ?argTargetClassNet. - """, - 'clause': """ - ?degreePhenomenaNet a net:Phenomena_Net ; - net:coverBaseNode ?phenomenaLeaf ; - net:targetArgumentNode ?argTargetLeaf ; - net:hasPhenomenaType amr:phenomena_degree. - ?argTargetClassNet a [rdfs:subClassOf* net:Class_Net] ; - net:coverBaseNode ?argTargetLeaf. - ?phenomenaLeaf ?argEdge ?argTargetLeaf. - ?argEdge amr:hasAmrRole amr:role_ARG2. - """, - 'binding': """ - """ -} - -rule_set['expand-degree-phenomena-net-3'] = { - 'label': "expand-degree-phenomena-net-3", - 'comment': ("Expand Degree Phenomena Net with: ", - " degree corresponding to :ARG3"), - 'construction': """ - ?degreePhenomenaNet net:targetDegree ?argTargetClassNet. - """, - 'clause': """ - ?degreePhenomenaNet a net:Phenomena_Net ; - net:coverBaseNode ?phenomenaLeaf ; - net:targetArgumentNode ?argTargetLeaf ; - net:hasPhenomenaType amr:phenomena_degree. - ?argTargetClassNet a [rdfs:subClassOf* net:Class_Net] ; - net:coverBaseNode ?argTargetLeaf. - ?phenomenaLeaf ?argEdge ?argTargetLeaf. - ?argEdge amr:hasAmrRole amr:role_ARG3. - """, - 'binding': """ - """ -} - -rule_set['expand-degree-phenomena-net-4'] = { - 'label': "expand-degree-phenomena-net-4", - 'comment': ("Expand Degree Phenomena Net with: ", - " range corresponding to :ARG4"), - 'construction': """ - ?degreePhenomenaNet net:targetRange ?argTargetClassNet. - """, - 'clause': """ - ?degreePhenomenaNet a net:Phenomena_Net ; - net:coverBaseNode ?phenomenaLeaf ; - net:targetArgumentNode ?argTargetLeaf ; - net:hasPhenomenaType amr:phenomena_degree. - ?argTargetClassNet a [rdfs:subClassOf* net:Class_Net] ; - net:coverBaseNode ?argTargetLeaf. - ?phenomenaLeaf ?argEdge ?argTargetLeaf. - ?argEdge amr:hasAmrRole amr:role_ARG4. - """, - 'binding': """ - """ -} - -rule_set['expand-degree-phenomena-net-5'] = { - 'label': "expand-degree-phenomena-net-5", - 'comment': ("Expand Degree Phenomena Net with: ", - " superlative corresponding to :ARG5"), - 'construction': """ - ?degreePhenomenaNet net:targetSuperlative ?argTargetClassNet. - """, - 'clause': """ - ?degreePhenomenaNet a net:Phenomena_Net ; - net:coverBaseNode ?phenomenaLeaf ; - net:targetArgumentNode ?argTargetLeaf ; - net:hasPhenomenaType amr:phenomena_degree. - ?argTargetClassNet a [rdfs:subClassOf* net:Class_Net] ; - net:coverBaseNode ?argTargetLeaf. - ?phenomenaLeaf ?argEdge ?argTargetLeaf. - ?argEdge amr:hasAmrRole amr:role_ARG5. - """, - 'binding': """ - """ -} - -rule_set['expand-degree-phenomena-net-6'] = { - 'label': "expand-degree-phenomena-net-6", - 'comment': ("Expand Degree Phenomena Net with: ", - " consequence corresponding to :ARG6"), - 'construction': """ - ?degreePhenomenaNet net:targetConsequence ?argTargetClassNet. - """, - 'clause': """ - ?degreePhenomenaNet a net:Phenomena_Net ; - net:coverBaseNode ?phenomenaLeaf ; - net:targetArgumentNode ?argTargetLeaf ; - net:hasPhenomenaType amr:phenomena_degree. - ?argTargetClassNet a [rdfs:subClassOf* net:Class_Net] ; - net:coverBaseNode ?argTargetLeaf. - ?phenomenaLeaf ?argEdge ?argTargetLeaf. - ?argEdge amr:hasAmrRole amr:role_ARG6. - """, - 'binding': """ - """ -} \ No newline at end of file diff --git a/tenet/scheme/amr_clara_rule/nov_transduction/technical_ctr.py b/tenet/scheme/amr_clara_rule/nov_transduction/technical_ctr.py deleted file mode 100644 index fa396dda..00000000 --- a/tenet/scheme/amr_clara_rule/nov_transduction/technical_ctr.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/python3.10 -# -*-coding:Utf-8 -* - -#============================================================================== -# TENET: AMR CTR at 'Net Expansion' level -#------------------------------------------------------------------------------ -# Module grouping compositional transduction rule_sets (CTR) for the analysis of -# AMR structures, at 'Net Expansion' level -#============================================================================== - -#============================================================================== -# CTR Set (CTR as Sparql querries) -#============================================================================== - -rule_set = {} - - -# --------------------------------------------- -# Useful technical CTR -# --------------------------------------------- - -rule_set['refine-cover-node-1'] = { - 'label': "refine-cover-node-1", - 'comment': ("Refine semantic net coverage indicators by: ", - " calculating the set of all covered nodes"), - 'construction': """ - ?net net:coverNode ?baseLeaf. - ?net net:coverNode ?argLeaf. - ?net net:coverNode ?targetLeaf. - """, - 'clause': """ - ?net a [rdfs:subClassOf* net:Net] ; - net:coverBaseNode ?baseLeaf. - OPTIONAL { ?net net:coverArgNode ?argLeaf. } - OPTIONAL { ?net net:coverTargetNode ?targetLeaf. } - """, - 'binding': """ - """ -} - -rule_set['refine-cover-node-2'] = { - 'label': "refine-cover-node-2", - 'comment': ("Refine semantic net coverage indicators by: ", - " calculating the number of covered nodes"), - 'construction': """ - ?net net:coverNodeCount ?c. - """, - 'clause': """ - SELECT ?net (COUNT(?leaf) AS ?c) - WHERE { - ?net a [rdfs:subClassOf* net:Class_Net] ; - net:coverNode ?leaf. - } - GROUP BY ?net - """, - 'binding': """ - """ -} - -# -- old --- -# rule_set['propagation-relations-to-nets'] = { -# 'label': "propagation-relations-to-nets", -# 'comment': ("Propagation relations between nodes", -# " to relations between nets"), -# 'construction': """ -# ?relationRole a net:Relation. -# ?net1 ?relationRole ?net2. -# """, -# 'clause': """ -# ?net1 a [rdfs:subClassOf* net:Net] ; -# net:coverBaseNode ?leaf1. -# ?net2 a [rdfs:subClassOf* net:Net] ; -# net:coverBaseNode ?leaf2. -# ?leaf1 ?relationEdge ?leaf2. -# ?relationEdge amr:hasAmrRole ?relationRole. -# """, -# 'binding': """ -# """ -# } -# -- --- \ No newline at end of file diff --git a/tenet/scheme/amr_clara_rule/owl_generation/__init__.py b/tenet/scheme/amr_clara_rule/owl_generation/__init__.py deleted file mode 100644 index 8d1c8b69..00000000 --- a/tenet/scheme/amr_clara_rule/owl_generation/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tenet/scheme/amr_clara_rule/owl_generation/owl_property_generator.py b/tenet/scheme/amr_clara_rule/owl_generation/owl_property_generator.py deleted file mode 100644 index 38e2380c..00000000 --- a/tenet/scheme/amr_clara_rule/owl_generation/owl_property_generator.py +++ /dev/null @@ -1,192 +0,0 @@ -#!/usr/bin/python3.10 -# -*-coding:Utf-8 -* - -#============================================================================== -# TENET: Rule to conjunctive phenomena or (rule 1) -#------------------------------------------------------------------------------ -# Net Expansion AMR rule to analyse conjunctive phenomena (or) -# Rule: property(class, or_phenomena) => compositeClass -#============================================================================== - -import rdflib -from rdflib import Graph -from rdflib.namespace import FOAF, RDF - -import transduction -from transduction import net -from transduction.rdfterm_computer import produce_uriref, produce_literal -from transduction.query_builder import generate_select_query -from transduction.naming_computer import define_axiom_naming -from transduction.naming_computer import define_composite_naming_2 - - -#============================================================================== -# Select Pattern: Atom / Composite Property Net -#============================================================================== - -def __search_pattern_1(graph): - select_data_list = ['?property_net'] - clause_list = [(f'?property_net a net:Atom_Property_Net.')] - query_code = generate_select_query(graph, select_data_list, clause_list) - rule_pattern_set = graph.query(query_code) - return rule_pattern_set - - -def __search_pattern_2(graph): - select_data_list = ['?property_net'] - clause_list = [(f'?property_net a net:Composite_Property_Net.')] - query_code = generate_select_query(graph, select_data_list, clause_list) - rule_pattern_set = graph.query(query_code) - return rule_pattern_set - - -def __get_atom_property_net_list(graph): - - # -- Atom Property List - atom_property_net_list = [] - atom_property_set = __search_pattern_1(graph) - for selection in atom_property_set: - property_net = net.AtomPropertyNet(graph, uri=selection.property_net) - atom_property_net_list.append(property_net) - - return atom_property_net_list - - -def __get_composite_property_net_list(graph): - - # -- Composite Property List - composite_property_net_list = [] - composite_property_set = __search_pattern_2(graph) - for selection in composite_property_set: - property_net = net.CompositePropertyNet(graph, uri=selection.property_net) - composite_property_net_list.append(property_net) - - return composite_property_net_list - - -def __get_mother_property_net_list(atom_property_net_list, composite_property_net_list): - - # -- URI List - mother_property_uri_list = [] - for net in composite_property_net_list: - if net.mother_property_net is not None: - mother_property_uri_list += net.mother_property_net - - # -- Net List - mother_property_net_list = [] - for net in (atom_property_net_list + composite_property_net_list): - if net.uri in mother_property_uri_list: - mother_property_net_list.append(net) - - return mother_property_net_list - - - -#============================================================================== -# Check Methods -#============================================================================== - -def __is_property_to_generate(property_net): - check_1 = property_net.is_deprecated() - if is_instance(property_net.mother_property_net, list): - check_2 = len(property_net.mother_property_net) > 0 - else: - check_2 = False - return not check_1 or check_2 - - - -#============================================================================== -# Generator Methods -#============================================================================== - -def __compute_property_uri(property_net): - if isinstance(property_net.property_uri, list) and len(property_net.property_uri) > 0: - property_uri = property_net.property_uri[0] - else: # computation of property_uri - net_naming = property_net.get_attribute_first_value(property_net.naming) - property_uri = produce_uriref(property_net.support_graph, f'ext-out:{net_naming}') - return property_uri - - -def __get_mother_property_uri(graph, mother_property_net_uri): - mother_property_net = net.PropertyNet(graph, uri=mother_property_net_uri) - return __compute_property_uri(mother_property_net) - - -def __define_triple(new_property_uri, relation, data): - triple_list = [] - for predicat in data: - triple_list.append((new_property_uri, relation, predicat)) - return triple_list - - -def __generate_owl_taxonomic_relation(graph, new_property_uri, net): - - triple_list = [] - relation = produce_uriref(graph, 'rdfs:subPropertyOf') - predicat = None - - if net.type_id == 'Atom_Property_Net': - predicat = produce_uriref(graph, 'base-out:Out_ObjectProperty') - - if net.type_id == 'Composite_Property_Net': - mother_property_net_uri = net.get_attribute_first_value(net.mother_property_net) - if mother_property_net_uri is None: - predicat = produce_uriref(graph, 'base-out:Out_ObjectProperty') - else : - predicat = __get_mother_property_uri(graph, mother_property_net_uri) - - if predicat is not None: - triple_list.append((new_property_uri, relation, predicat)) - - return triple_list - - -def __generate_owl_triple_definition(graph, net): - - triple_list = [] - - new_property_uri = __compute_property_uri(net) - - rdf_type_uri = produce_uriref(graph, RDF.type) - triple_list += __define_triple(new_property_uri, rdf_type_uri, net.property_type) - - relation = produce_uriref(graph, 'rdfs:label') - triple_list += __define_triple(new_property_uri, relation, net.property_name) - - relation = produce_uriref(graph, 'base-out:fromStructure') - triple_list += __define_triple(new_property_uri, relation, net.structure) - - triple_list += __generate_owl_taxonomic_relation(graph, new_property_uri, net) - - return triple_list - - - -#============================================================================== -# Main Method: analyze_phenomena_or_1 -#============================================================================== - -def generate_owl_property(graph): - - # -- Rule Initialization - rule_label = 'generate OWL property' - rule_triple_list = [] - - # -- Get property net listings - atom_property_net_list = __get_atom_property_net_list(graph) - composite_property_net_list = __get_composite_property_net_list(graph) - mother_property_net_list = __get_mother_property_net_list(atom_property_net_list, - composite_property_net_list) - - # -- Triple Definition for 'not deprecated property net' - for property_net in (atom_property_net_list + composite_property_net_list): - if not property_net.is_deprecated(): - rule_triple_list += __generate_owl_triple_definition(graph, property_net) - - # -- Triple Definition for 'mother property net' - for property_net in mother_property_net_list: - rule_triple_list += __generate_owl_triple_definition(graph, property_net) - - return rule_label, rule_triple_list \ No newline at end of file diff --git a/tenet/scheme/amr_clara_rule/preprocessing.py b/tenet/scheme/amr_clara_rule/preprocessing.py deleted file mode 100644 index a2f99066..00000000 --- a/tenet/scheme/amr_clara_rule/preprocessing.py +++ /dev/null @@ -1,445 +0,0 @@ -#!/usr/bin/python3.10 -# -*-coding:Utf-8 -* - -#============================================================================== -# TENET: AMR CTR at 'Data Preprocessing' level -#------------------------------------------------------------------------------ -# Module grouping compositional transduction rule_sets (CTR) for the analysis of -# AMR structures, at 'Data Preprocessing' level -#============================================================================== - -#============================================================================== -# CTR Set (CTR as Sparql querries) -#============================================================================== - -rule_set = {} - - -# --------------------------------------------- -# Preprocessing: Reclassification of concepts -# --------------------------------------------- - -rule_set['reclassify-concept-1'] = { - 'label': "reclassify-concept-1", - 'comment': "Reclassify terms concept to AMR Special concept", - 'construction': """ - ?c rdfs:subClassOf amr:AMR_Special_Concept ; - amr:hasPhenomenaLink ?phenomena. - """, - 'clause': """ - ?c a ?amrConceptClass. - VALUES ?amrConceptClass {ns3:Frame ns3:Concept ns3:NamedEntity} - ?phenomena rdfs:subClassOf* amr:AMR_Phenomena ; - amr:hasConceptLink ?phenomenaLink. - FILTER (?cLabel1 = ?phenomenaLink || - ?cLabel2 = ?phenomenaLink). - """, - 'binding':""" - BIND (strafter(str(?c), str(ns1:)) AS ?cLabel1). - BIND (strafter(str(?c), '#') AS ?cLabel2). - """ - } - - -rule_set['reclassify-concept-2'] = { - 'label': "reclassify-concept-2", - 'comment': "Reclassify terms concept to AMR Term concept", - 'construction': """ - ?c rdfs:subClassOf amr:AMR_Term_Concept. - """, - 'clause': """ - ?c a ns3:Concept. - FILTER NOT EXISTS { ?c rdfs:subClassOf amr:AMR_Special_Concept. } - FILTER ( CONTAINS(str(?c), str(ns2:)) ). - FILTER ( ?c != ns3:Frame ). - FILTER ( ?c != ns3:NamedEntity ). - """, - 'binding': '' - } - -rule_set['reclassify-concept-3'] = { - 'label': "reclassify-concept-3", - 'comment': "Reclassify core concept to AMR Relation concept", - 'construction': """ - ?c rdfs:subClassOf amr:AMR_Relation_Concept. - """, - 'clause': """ - ?c a ns3:Concept. - FILTER NOT EXISTS { ?c rdfs:subClassOf amr:AMR_Special_Concept. } - FILTER ( CONTAINS(str(?c), str(ns3:)) ). - FILTER ( ?c != ns3:Frame ). - FILTER ( ?c != ns3:NamedEntity ). - """, - 'binding': '' - } - -rule_set['reclassify-concept-4'] = { - 'label': "reclassify-concept-4", - 'comment': "Reclassify named entity to AMR Term concept", - 'construction': """ - ?c rdfs:subClassOf amr:AMR_Term_Concept. - """, - 'clause': """ - ?c a ns3:NamedEntity. - FILTER NOT EXISTS { ?c rdfs:subClassOf amr:AMR_Special_Concept. } - """, - 'binding': '' - } - -rule_set['reclassify-concept-5'] = { - 'label': "reclassify-concept-5", - 'comment': "Reclassify frame to AMR Predicat concept", - 'construction': """ - ?c rdfs:subClassOf amr:AMR_Predicat_Concept. - """, - 'clause': """ - ?c a ns3:Frame. - FILTER NOT EXISTS { ?c rdfs:subClassOf amr:AMR_Special_Concept. } - """, - 'binding': '' - } - - -# --------------------------------------------- -# Preprocessing: Reclassification of variables -# --------------------------------------------- - -rule_set['reclassify-variable'] = { - 'label': "reclassify-variable", - 'comment': "Reclassify concept instance to AMR variable", - 'construction': """ - ?v a amr:AMR_Variable. - """, - 'clause': """ - ?c rdfs:subClassOf* amr:AMR_Concept. - ?v a ?c. - """, - 'binding': '' - } - - -# --------------------------------------------- -# Preprocessing: Reclassification of roles -# --------------------------------------------- - -rule_set['reclassify-role-1'] = { - 'label': "reclassify-role-1", - 'comment': "Reclassify role to AMR core role", - 'construction': """ - ?newRole rdfs:subClassOf amr:AMR_Core_Role ; - amr:fromAmrLkFramerole ?r. - """, - 'clause': """ - ?r a ns1:FrameRole. - """, - 'binding':""" - BIND (strafter(str(?r), str(ns1:)) AS ?rLabel) - BIND (strbefore(?rLabel, '.') AS ?rolesetId) - BIND (strafter(?rLabel, '.') AS ?roleId) - BIND (CONCAT(str(amr:), 'role') AS ?n1). - BIND (CONCAT(?n1, '_', ?roleId) AS ?n2). - BIND (uri(?n2) AS ?newRole). - """ - } - -rule_set['reclassify-role-2'] = { - 'label': "reclassify-rolet-2", - 'comment': "Reclassify role to AMR non-core role", - 'construction': """ - ?newRole rdfs:subClassOf amr:AMR_NonCore_Role ; - amr:fromAmrLkRole ?r. - """, - 'clause': """ - ?r a ns3:Role. - FILTER ( ?r != ns1:FrameRole ). - FILTER NOT EXISTS { ?newRole rdfs:subClassOf* amr:AMR_Role. } - """, - 'binding':""" - BIND (strafter(str(?r), '#') AS ?rLabel) - BIND (CONCAT(str(amr:), 'role') AS ?n1). - BIND (CONCAT(?n1, '_', ?rLabel) AS ?n2). - BIND (uri(?n2) AS ?newRole). - """ - } - -rule_set['reclassify-role-3'] = { - 'label': "reclassify-rolet-3", - 'comment': "Add link with AmrLk role to AMR role", - 'construction': """ - ?newRole amr:fromAmrLkRole ?r. - """, - 'clause': """ - ?r a ns3:Role. - ?newRole rdfs:subClassOf* amr:AMR_Role. - FILTER ( ?r != ns1:FrameRole ). - """, - 'binding':""" - BIND (strafter(str(?r), '#') AS ?rLabel) - BIND (CONCAT(str(amr:), 'role') AS ?n1). - BIND (CONCAT(?n1, '_', ?rLabel) AS ?n2). - BIND (uri(?n2) AS ?newRole). - """ - } - - -# --------------------------------------------- -# Preprocessing: Addition of leafs and edges -# --------------------------------------------- - -rule_set['add-amr-leaf'] = { - 'label': "add-leaf-1", - 'comment': "Add AMR leaf corresponding to concept/variable relation", - 'construction': """ - ?newLeaf a amr:AMR_Leaf ; - amr:hasVariable ?v ; - amr:hasConcept ?c. - """, - 'clause': """ - ?c rdfs:subClassOf* amr:AMR_Concept. - ?v a ?c. - """, - 'binding':""" - BIND (strafter(str(?c), '#') AS ?cLabel1) - BIND (strafter(str(?c), str(ns1:)) AS ?cLabel2) - BIND (IF (STRLEN(?cLabel1) > 0, ?cLabel1, ?cLabel2) AS ?cLabel) - BIND (strafter(str(?v), '#') AS ?vLabel) - BIND (CONCAT(str(amr:), 'leaf') AS ?n1). - BIND (CONCAT(?n1, '_', ?cLabel) AS ?n2). - BIND (CONCAT(?n2, '_', ?vLabel) AS ?n3). - BIND (uri(?n3) AS ?newLeaf). - """ - } - - -rule_set['add-amr-edge-1'] = { - 'label': "add-amr-edge-1", - 'comment': ("Add AMR edge corresponding to a FrameRole relation", - " between two leafs"), - 'construction': """ - ?newEdge a amr:AMR_Edge ; - amr:hasRolesetID ?rolesetId ; - amr:hasRoleID ?roleId ; - amr:hasRoleTag ?roleTag. - ?leaf1 ?newEdge ?leaf2. - """, - 'clause': """ - ?r a ns1:FrameRole. - ?leaf1 amr:hasVariable ?v1. - ?leaf2 amr:hasVariable ?v2. - ?v1 ?r ?v2. - """, - 'binding':""" - BIND (strafter(str(?r), str(ns1:)) AS ?rLabel) - BIND (strbefore(?rLabel, '.') AS ?rolesetId) - BIND (strafter(?rLabel, '.') AS ?roleId) - BIND (?rLabel AS ?roleTag) - BIND (strafter(str(?v1), '#') AS ?v1Label) - BIND (strafter(str(?v2), '#') AS ?v2Label) - BIND (CONCAT(str(amr:), 'edge') AS ?n1). - BIND (CONCAT(?n1, '_', ?rLabel) AS ?n2). - BIND (CONCAT(?n2, '_', ?v1Label) AS ?n3). - BIND (CONCAT(?n3, '_', ?v2Label) AS ?n4). - BIND (uri(?n4) AS ?newEdge). - """ - } - -rule_set['add-amr-edge-2'] = { - 'label': "add-amr-edge-2", - 'comment': ("Add AMR edge corresponding to a Role relation", - " between two leafs"), - 'construction': """ - ?newEdge a amr:AMR_Edge ; - amr:hasRolesetID ?rolesetId ; - amr:hasRoleID ?roleId ; - amr:hasRoleTag ?roleTag. - ?leaf1 ?newEdge ?leaf2. - """, - 'clause': """ - ?r a ns3:Role. - ?leaf1 amr:hasVariable ?v1. - ?leaf2 amr:hasVariable ?v2. - ?v1 ?r ?v2. - """, - 'binding':""" - BIND (strafter(str(?r), '#') AS ?rLabel) - BIND (strbefore(?rLabel, '.') AS ?rolesetId) - BIND (strafter(?rLabel, '.') AS ?roleId) - BIND (?rLabel AS ?roleTag) - BIND (strafter(str(?v1), '#') AS ?v1Label) - BIND (strafter(str(?v2), '#') AS ?v2Label) - BIND (CONCAT(str(amr:), 'edge') AS ?n1). - BIND (CONCAT(?n1, '_', ?rLabel) AS ?n2). - BIND (CONCAT(?n2, '_', ?v1Label) AS ?n3). - BIND (CONCAT(?n3, '_', ?v2Label) AS ?n4). - BIND (uri(?n4) AS ?newEdge). - """ - } - - -# --------------------------------------------- -# Preprocessing: Addition of root -# --------------------------------------------- - -rule_set['add-amr-root'] = { - 'label': "add-amr-root", - 'comment': ("Add root instance in AMR_Root"), - 'construction': """ - ?newRoot a amr:AMR_Root ; - amr:hasRootLeaf ?leaf ; - amr:hasSentenceID ?graphId ; - amr:hasSentenceStatement ?graphSentence ; - amr:fromAmrLkRoot ?r. - """, - 'clause': """ - ?r a ns3:AMR. - ?r ns3:root ?lkRoot. - ?r ns3:has-id ?graphId. - ?r ns3:has-sentence ?graphSentence. - ?leaf amr:hasVariable ?lkRoot. - """, - 'binding':""" - BIND (CONCAT(str(amr:), 'root') AS ?n1). - BIND (CONCAT(?n1, '_', ?graphId) AS ?n2). - BIND (uri(?n2) AS ?newRoot). - """ - } - - -# --------------------------------------------- -# Preprocessing: Addition of values -# --------------------------------------------- - -rule_set['add-amr-value-for-name-relation'] = { - 'label': "add-value-for-name-relation", - 'comment': ("Add a value for each name relation, corresponding to ", - "variables with label in AMR Linked Data, ", - "and to the name AMR relations in AMR graphs"), - 'construction': """ - ?newValue a amr:AMR_Value ; - rdfs:label ?vLabel. - ?v amr:name ?newValue. - """, - 'clause': """ - ?v a amr:AMR_Variable. - ?v rdfs:label ?vLabel. - """, - 'binding':""" - BIND (REPLACE(?vLabel, ' ', "") AS ?vRef). - BIND (CONCAT(str(amr:), 'value') AS ?n1). - BIND (CONCAT(?n1, '_', ?vRef) AS ?n2). - BIND (uri(?n2) AS ?newValue). - """ - } - -rule_set['add-amr-value-for-quant-relation'] = { - 'label': "add-value-for-quant-relation", - 'comment': ("Add a value for each quant relation, corresponding to ", - "variables with quant Property in AMR Linked Data, ", - "and to the quant AMR relations in AMR graphs"), - 'construction': """ - ?newValue a amr:AMR_Value ; - rdfs:label ?vQuant. - ?v amr:quant ?newValue. - """, - 'clause': """ - ?v a amr:AMR_Variable. - ?v ns2:quant ?vQuant. - """, - 'binding':""" - BIND (REPLACE(?vQuant, ' ', "") AS ?vRef). - BIND (CONCAT(str(amr:), 'value') AS ?n1). - BIND (CONCAT(?n1, '_', ?vRef) AS ?n2). - BIND (uri(?n2) AS ?newValue). - """ - } - - -# --------------------------------------------- -# Preprocessing: Set labels for concepts, variables and roles -# --------------------------------------------- - -rule_set['set-amr-label-for-concepts'] = { - 'label': "set-amr label-for-concepts", - 'comment': "Set AMR label for all concepts", - 'construction': """ - ?c amr:label ?cLabel. - """, - 'clause': """ - ?c rdfs:subClassOf* amr:AMR_Concept. - """, - 'binding':""" - BIND (strafter(str(?c), '#') AS ?cLabel1) - BIND (strafter(str(?c), str(ns1:)) AS ?cLabel2) - BIND (IF (STRLEN(?cLabel1) > 0, ?cLabel1, ?cLabel2) AS ?cLabel) - """ - } - -rule_set['set-amr-label-for-variables'] = { - 'label': "set-amr-label-for-variables", - 'comment': "Set AMR label for all variables", - 'construction': """ - ?v amr:label ?vLabel. - """, - 'clause': """ - ?v a amr:AMR_Variable. - """, - 'binding':""" - BIND (strafter(str(?v), '#') AS ?vLabel) - """ - } - -rule_set['set-amr-label-for-roles'] = { - 'label': "set-amr-label-for-variables", - 'comment': "Set AMR label for all variables", - 'construction': """ - ?r amr:label ?rLabel. - """, - 'clause': """ - ?r rdfs:subClassOf* amr:AMR_Role. - """, - 'binding':""" - BIND (strafter(str(?r), 'role_') AS ?rLabel) - """ - } - - -# --------------------------------------------- -# Preprocessing: Update leafs and edges -# --------------------------------------------- - -rule_set['update-amr-edge-role-1'] = { - 'label': "update-amr-edge-role-1", - 'comment': ("Update AMR edge by adding relation with AMR_Role", - "(using comparison between label and role id)"), - 'construction': """ - ?edge amr:hasAmrRole ?role. - """, - 'clause': """ - ?edge a amr:AMR_Edge ; - amr:hasRoleID ?edgeRoleId. - ?role rdfs:subClassOf* amr:AMR_Role ; - amr:label ?roleLabel. - FILTER ( ?roleLabel != '' ). - FILTER ( ?edgeRoleId = ?roleLabel ). - """, - 'binding': '' - } - -rule_set['update-amr-edge-role-2'] = { - 'label': "update-amr-edge-role-2", - 'comment': ("Update AMR edge by adding relation with AMR_Role", - "(using comparison between label and role tag)"), - 'construction': """ - ?edge amr:hasAmrRole ?role. - """, - 'clause': """ - ?edge a amr:AMR_Edge ; - amr:hasRoleTag ?edgeRoleId. - ?role rdfs:subClassOf* amr:AMR_Role ; - amr:label ?roleLabel. - FILTER ( ?roleLabel != '' ). - FILTER ( ?edgeRoleId = ?roleLabel ). - """, - 'binding': '' - } - diff --git a/tenet/scheme/amr_clara_rule/preprocessing/__init__.py b/tenet/scheme/amr_clara_rule/preprocessing/__init__.py deleted file mode 100644 index 8d1c8b69..00000000 --- a/tenet/scheme/amr_clara_rule/preprocessing/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tenet/scheme/amr_clara_rule/preprocessing/amr_bug_fixing_1.py b/tenet/scheme/amr_clara_rule/preprocessing/amr_bug_fixing_1.py new file mode 100644 index 00000000..66dc3d56 --- /dev/null +++ b/tenet/scheme/amr_clara_rule/preprocessing/amr_bug_fixing_1.py @@ -0,0 +1,86 @@ +#!/usr/bin/python3.10 +# -*- coding: Utf-8 -*- + +#============================================================================== +# TENET: Rule to fix AMR bug +#------------------------------------------------------------------------------ +# Fix AMR bug about planet named system solar +#============================================================================== + +from rdflib import Graph, Literal + +import transduction +from transduction import net +from transduction.query_builder import generate_select_query +from transduction.rdfterm_computer import ( produce_uriref, produce_literal ) + + +#============================================================================== +# Pattern Search: bug about planet named system solar +#============================================================================== + +def __search_pattern(graph): + select_data_list = ['?solarSystem', '?originConcept'] + clause_list = ['?originConcept a ns3:NamedEntity.', + 'FILTER ( CONTAINS(str(?originConcept), str(ns4:planet)) ).', + '?solarSystem a ?originConcept.', + '?solarSystem rdfs:label "Solar System".'] + query_code = generate_select_query(graph, select_data_list, clause_list) + result_set = graph.query(query_code) + return query_code, result_set + + +#============================================================================== +# Construct Method(s) +#============================================================================== + +def __add_new_concept(graph, solarSystem, originConcept, new_label='system'): + triple_list = [] + + new_concept_uri = produce_uriref(graph, f'ns4:{new_label}') + + # -- New concept + relation = produce_uriref(graph, 'rdf:type') + value = produce_uriref(graph, 'ns3:NamedEntity') + triple_list.append((new_concept_uri, relation, value)) + + # -- Label + relation = produce_uriref(graph, 'rdfs:label') + value = Literal(new_label) + triple_list.append((new_concept_uri, relation, value)) + + # -- Linking between individual and new concept + relation = produce_uriref(graph, 'rdf:type') + triple_list.append((solarSystem, relation, new_concept_uri)) + + # -- Classification of the original concept as LinkedData (for tracing) + relation = produce_uriref(graph, 'rdfs:subClassOf') + value = produce_uriref(graph, 'amr:AMR_Linked_Data') + triple_list.append((originConcept, relation, value)) + + # -- Comment the origin concept as 'bug' + relation = produce_uriref(graph, 'rdfs:comment') + value = Literal('bug') + triple_list.append((originConcept, relation, value)) + + return triple_list + + +#============================================================================== +# Main Method +#============================================================================== + +def fix_amr_bug_1(graph): + + # -- Rule Initialization + rule_label = 'fix AMR bug (1)' + + # -- Search for patterns + _, pattern_set = __search_pattern(graph) + + # -- Selection Analyzing (1) + rule_triple_list = [] + for pattern in pattern_set: + rule_triple_list += __add_new_concept(graph, pattern.solarSystem, pattern.originConcept) + + return rule_label, rule_triple_list diff --git a/tenet/scheme/amr_clara_rule/preprocessing/amr_reification.py b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification.py deleted file mode 100644 index 94a2bd9b..00000000 --- a/tenet/scheme/amr_clara_rule/preprocessing/amr_reification.py +++ /dev/null @@ -1,934 +0,0 @@ -#!/usr/bin/python3.10 -# -*-coding:Utf-8 -* - -#============================================================================== -# TENET: AMR CTR at 'Data Preprocessing' level -#------------------------------------------------------------------------------ -# Module grouping compositional transduction rules (CTR) for the analysis of -# AMR structures, at 'Data Preprocessing' level -#============================================================================== - -#============================================================================== -# CTR Set (CTR as Sparql querries) -#============================================================================== - -rule_set = {} - - -# --------------------------------------------- -# Reclassification of concepts -# --------------------------------------------- - -rule_set['reclassify-concept-1'] = { - 'label': "reclassify-concept-1", - 'comment': ("Reclassify LK concept to AMR Relation concept for concept: ", - " (1) corresponding to a LK term, frame or named entity,", - " (2) corresponding to an AMR phenomena/relation."), - 'construction': """ - # -- New concept - ?newConcept rdfs:subClassOf amr:AMR_Relation_Concept ; - amr:label ?cLabel ; - amr:hasPhenomenaLink ?phenomena ; - amr:fromAmrLk ?c. - - # -- Classification of the original concept as LinkedData (for tracing) - ?c rdfs:subClassOf amr:AMR_Linked_Data. - """, - 'clause': """ - # -- Identify LK concept - ?c a ?amrConceptClass. - VALUES ?amrConceptClass {ns3:Frame ns3:Concept ns3:NamedEntity} - - # -- Identify phenomena matching - ?phenomena rdfs:subClassOf* amr:AMR_Phenomena ; - amr:hasConceptLink ?phenomenaLink. - BIND (strafter(str(?c), str(ns1:)) AS ?cLabel1). - BIND (strafter(str(?c), '#') AS ?cLabel2). - FILTER (?cLabel1 = ?phenomenaLink || ?cLabel2 = ?phenomenaLink). - - # -- Filter bugs - FILTER NOT EXISTS { ?c rdfs:comment 'bug'. } - """, - 'binding':""" - # -- Label - # -- already bound --- BIND (strafter(str(?c), '#') AS ?cLabel1) - # -- already bound --- BIND (strafter(str(?c), str(ns1:)) AS ?cLabel2) - BIND (IF (STRLEN(?cLabel1) > 0, ?cLabel1, ?cLabel2) AS ?cLabel) - - # -- New concept - BIND (CONCAT(str(amr:), 'concept') AS ?n1). - BIND (CONCAT(?n1, '_', ?cLabel) AS ?n2). - BIND (uri(?n2) AS ?newConcept). - """ - } - - -rule_set['reclassify-concept-2'] = { - 'label': "reclassify-concept-2", - 'comment': ("Reclassify LK concept to AMR Predicat concept for concept: ", - " (1) corresponding to a predicat (ns3 concept),", - " (2) not corresponding to a phenomena."), - 'construction': """ - # -- New concept - ?newConcept rdfs:subClassOf amr:AMR_Predicat_Concept ; - amr:label ?cLabel ; - amr:fromAmrLk ?c. - - # -- Classification of the original concept as LinkedData (for tracing) - ?c rdfs:subClassOf amr:AMR_Linked_Data. - """, - 'clause': """ - # -- Identify LK relation concepts (ns3) - ?c a ns3:Concept. - FILTER ( CONTAINS(str(?c), str(ns3:)) ). - FILTER ( ?c != ns3:Frame ). - FILTER ( ?c != ns3:NamedEntity ). - - # -- Filter phenomena/relation - FILTER NOT EXISTS {?amrC rdfs:subClassOf amr:AMR_Relation_Concept ; - amr:fromAmrLk ?c.} - - # -- Filter bugs - FILTER NOT EXISTS { ?c rdfs:comment 'bug'. } - """, - 'binding': """ - # -- Label - BIND (strafter(str(?c), '#') AS ?cLabel1) - BIND (strafter(str(?c), str(ns1:)) AS ?cLabel2) - BIND (IF (STRLEN(?cLabel1) > 0, ?cLabel1, ?cLabel2) AS ?cLabel) - - # -- New concept - BIND (CONCAT(str(amr:), 'concept') AS ?n1). - BIND (CONCAT(?n1, '_', ?cLabel) AS ?n2). - BIND (uri(?n2) AS ?newConcept). - """ - } - - -rule_set['reclassify-concept-3'] = { - 'label': "reclassify-concept-3", - 'comment': ("Reclassify LK concept to AMR Predicat concept for concept: ", - " (1) corresponding to a frame,", - " (2) not corresponding to a relation."), - 'construction': """ - # -- New concept - ?newConcept rdfs:subClassOf amr:AMR_Predicat_Concept ; - amr:label ?cLabel ; - amr:fromAmrLk ?c. - - # -- Classification of the original concept as LinkedData (for tracing) - ?c rdfs:subClassOf amr:AMR_Linked_Data. - """, - 'clause': """ - # -- Identify LK frame concepts - ?c a ns3:Frame. - - # -- Filter phenomena/relation - FILTER NOT EXISTS {?amrC rdfs:subClassOf amr:AMR_Relation_Concept ; - amr:fromAmrLk ?c.} - - # -- Filter bugs - FILTER NOT EXISTS { ?c rdfs:comment 'bug'. } - """, - 'binding': """ - # -- Label - BIND (strafter(str(?c), '#') AS ?cLabel1) - BIND (strafter(str(?c), str(ns1:)) AS ?cLabel2) - BIND (IF (STRLEN(?cLabel1) > 0, ?cLabel1, ?cLabel2) AS ?cLabel) - - # -- New concept - BIND (CONCAT(str(amr:), 'concept') AS ?n1). - BIND (CONCAT(?n1, '_', ?cLabel) AS ?n2). - BIND (uri(?n2) AS ?newConcept). - """ - } - - -rule_set['reclassify-concept-4'] = { - 'label': "reclassify-concept-4", - 'comment': ("Reclassify LK concept to AMR Term concept for concept: ", - " (1) corresponding to a term (ns2 concept),", - " (2) not corresponding to a phenomena."), - 'construction': """ - # -- New concept - ?newConcept rdfs:subClassOf amr:AMR_Term_Concept ; - amr:label ?cLabel ; - amr:fromAmrLk ?c. - - # -- Classification of the original concept as LinkedData (for tracing) - ?c rdfs:subClassOf amr:AMR_Linked_Data. - """, - 'clause': """ - # -- Identify LK term concepts - ?c a ns3:Concept. - FILTER ( CONTAINS(str(?c), str(ns2:)) ). - FILTER ( ?c != ns3:Frame ). - FILTER ( ?c != ns3:NamedEntity ). - - # -- Filter phenomena/relation - FILTER NOT EXISTS {?amrC rdfs:subClassOf amr:AMR_Relation_Concept ; - amr:fromAmrLk ?c.} - - # -- Filter bugs - FILTER NOT EXISTS { ?c rdfs:comment 'bug'. } - """, - 'binding': """ - # -- Label - BIND (strafter(str(?c), '#') AS ?cLabel1) - BIND (strafter(str(?c), str(ns1:)) AS ?cLabel2) - BIND (IF (STRLEN(?cLabel1) > 0, ?cLabel1, ?cLabel2) AS ?cLabel) - - # -- New concept - BIND (CONCAT(str(amr:), 'concept') AS ?n1). - BIND (CONCAT(?n1, '_', ?cLabel) AS ?n2). - BIND (uri(?n2) AS ?newConcept). - """ - } - - -rule_set['reclassify-concept-5'] = { - 'label': "reclassify-concept-5", - 'comment': ("Reclassify LK concept to AMR Term concept for concept: ", - " (1) corresponding to a named entity,", - " (2) not corresponding to a relation."), - 'construction': """ - # -- New concept - ?newConcept rdfs:subClassOf amr:AMR_Term_Concept ; - amr:label ?cLabel ; - amr:fromAmrLk ?c. - - # -- Classification of the original concept as LinkedData (for tracing) - ?c rdfs:subClassOf amr:AMR_Linked_Data. - """, - 'clause': """ - # -- Identify LK named entity concepts - ?c a ns3:NamedEntity. - - # -- Filter phenomena/relation - FILTER NOT EXISTS {?amrC rdfs:subClassOf amr:AMR_Relation_Concept ; - amr:fromAmrLk ?c.} - - # -- Filter bugs - FILTER NOT EXISTS { ?c rdfs:comment 'bug'. } - """, - 'binding': """ - # -- Label - BIND (strafter(str(?c), '#') AS ?cLabel1) - BIND (strafter(str(?c), str(ns1:)) AS ?cLabel2) - BIND (IF (STRLEN(?cLabel1) > 0, ?cLabel1, ?cLabel2) AS ?cLabel) - - # -- New concept - BIND (CONCAT(str(amr:), 'concept') AS ?n1). - BIND (CONCAT(?n1, '_', ?cLabel) AS ?n2). - BIND (uri(?n2) AS ?newConcept). - """ - } - - -# --------------------------------------------- -# Reclassification of roles *** OLD *** -# --------------------------------------------- - -# rule_set['reclassify-role-1'] = { -# 'label': "reclassify-role-1", -# 'comment': "Reclassify role to AMR core role", -# 'construction': """ -# # -- New AMR core role -# ?newRole rdfs:subClassOf amr:AMR_Core_Role ; -# amr:label ?roleId ; -# amr:fromAmrLk ?r. -# """, -# 'clause': """ -# # -- Identify core role -# ?r a ns1:FrameRole. -# """, -# '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) - -# # -- Id -# BIND (strbefore(?rLabel, '.') AS ?rolesetId) -# BIND (strafter(?rLabel, '.') AS ?roleId) - -# # -- New role -# BIND (CONCAT(str(amr:), 'role') AS ?n1). -# BIND (CONCAT(?n1, '_', ?roleId) AS ?n2). -# 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 -# FILTER NOT EXISTS {?newRole rdfs:subClassOf* amr:AMR_Role ; -# amr:fromAmrLk ?r.} -# """, -# '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). -# """ -# } - - -# --------------------------------------------- -# Set labels for variables and roles -# --------------------------------------------- - -# rule_set['set-amr-label-for-variables'] = { -# 'label': "set-amr-label-for-variables", -# 'comment': "Set AMR label for all variables", -# 'construction': """ -# ?v amr:label ?vLabel. -# """, -# 'clause': """ -# ?v a amr:AMR_Variable. -# """, -# 'binding':""" -# BIND (strafter(str(?v), '#') AS ?vLabel) -# """ -# } - -# rule_set['set-amr-label-for-roles'] = { -# 'label': "set-amr-label-for-variables", -# 'comment': "Set AMR label for all variables", -# 'construction': """ -# ?r amr:label ?rLabel. -# """, -# 'clause': """ -# ?r rdfs:subClassOf* amr:AMR_Role. -# """, -# 'binding':""" -# BIND (strafter(str(?r), 'role_') AS ?rLabel) -# """ -# } - - -# --------------------------------------------- -# Reification of some roles as first-class concept -# --------------------------------------------- - -rule_set['reify-roles-as-concept'] = { - 'label': "reify-roles-as-concept", - 'comment': ("reify some LK roles to AMR Relation concept for: ", - " (1) AMR relation with reification,", - " (2) non core LK role ", - " (3) matching between role and reification relation."), - 'construction': """ - # -- New concept - ?newConcept rdfs:subClassOf amr:AMR_Predicat_Concept ; - amr:isReifiedConcept true ; - amr:label ?reificationConcept ; - amr:fromAmrLk ?r. - - # -- Classification of the original concept as LinkedData (for tracing) - ?r rdfs:subClassOf amr:AMR_Linked_Data. - """, - 'clause': """ - # -- Identify AMR relation with reification - ?reifiableRelation rdfs:subClassOf amr:AMR_Relation ; - amr:hasReification true ; - amr:hasRelationName ?relationName ; - amr:hasReificationConcept ?reificationConcept. - # -- old --- amr:hasReificationDomain ?reificationDomain ; - # -- old --- amr:hasReificationRange ?reificationRange. - - # -- Identify non core role - ?r a ns3:Role. - FILTER ( ?r != ns1:FrameRole ). - - # -- Identify role and reification relation matching - BIND (strafter(str(?r), str(ns1:)) AS ?rLabel1). - BIND (strafter(str(?r), '#') AS ?rLabel2). - FILTER (?rLabel1 = ?relationName || ?rLabel2 = ?relationName). - """, - 'binding': """ - # -- New concept - BIND (CONCAT(str(amr:), 'concept') AS ?n1). - BIND (CONCAT(?n1, '_', ?relationName) AS ?n2). - BIND (uri(?n2) AS ?newConcept). - """ - } - - -# --------------------------------------------- -# Reclassification of variables -# --------------------------------------------- - -rule_set['reclassify-existing-variable'] = { - 'label': "reclassify-existing-variable", - 'comment': "Reclassify existing LK variable to AMR variable", - 'construction': """ - # -- New variable - ?newVariable a amr:AMR_Variable ; - amr:label ?vLabel ; - amr:fromAmrLk ?v. - - # -- Name relation - ?newVariable amr:name ?vName. - - # -- Classification of the original concept as LinkedData (for tracing) - ?v rdfs:subClassOf amr:AMR_Linked_Data. - """, - 'clause': """ - # -- Identify variable - ?c rdfs:subClassOf* amr:AMR_Concept ; - amr:fromAmrLk ?linkedC. - ?v a ?linkedC. - - # -- Identify rdfs:label (corresponding to name relation) - OPTIONAL {?v rdfs:label ?vName} - """, - 'binding': """ - # -- New label - BIND (strafter(str(?v), '#') AS ?vLabel) - - # -- New variable - BIND (CONCAT(str(amr:), 'variable') AS ?n1). - BIND (CONCAT(?n1, '_', ?vLabel) AS ?n2). - BIND (uri(?n2) AS ?newVariable). - """ - } - - -rule_set['add-new-variable-for-reified-concept'] = { - 'label': "add-new-variable-for-reified-concept", - 'comment': "Add new variable for reified concept", - 'construction': """ - # -- New variable - ?newVariable a amr:AMR_Variable ; - amr:isReifiedVariable true ; - amr:label ?vLabel. - - # -- Linking new variable to LK role (for tracing) - ?newVariable a ?r. - """, - 'clause': """ - # -- Identify reified concept - ?reifiedConcept rdfs:subClassOf amr:AMR_Predicat_Concept ; - amr:isReifiedConcept true ; - amr:label ?cLabel ; - amr:fromAmrLk ?r. - # -- old --- ?vIn ?r ?vOut. - """, - 'binding': """# -- New label - BIND (strafter(str(?r), '#') AS ?rLabel1) - BIND (strafter(str(?r), str(ns1:)) AS ?rLabel2) - BIND (IF (STRLEN(?rLabel1) > 0, ?rLabel1, ?rLabel2) AS ?rLabel) - BIND (SUBSTR(?rLabel, 1, 1) AS ?vLetter) - BIND (CONCAT(?vLetter, '9') AS ?vLabel). - - # -- old --- - # -- old --- BIND (strafter(str(?vIn), '#') AS ?vl1). - # -- old --- BIND (CONCAT(?vl1, ?vLetter) AS ?vl2). - # -- old --- BIND (CONCAT(?vl2, strafter(str(?vOut), '#')) AS ?vl3). - - # -- New variable - BIND (CONCAT(str(amr:), 'variable') AS ?n1). - BIND (CONCAT(?n1, '_', ?vLabel) AS ?n2). - BIND (uri(?n2) AS ?newVariable). - """ - } - - -# --------------------------------------------- -# Addition of leafs -# --------------------------------------------- - -rule_set['add-amr-leaf-for-reclassified-concept'] = { - 'label': "add-amr-leaf-for-reclassified-concept", - 'comment': "Add AMR leaf corresponding to concept/variable relation", - 'construction': """ - # -- New leaf - ?newLeaf a amr:AMR_Leaf ; - amr:hasVariable ?newV ; - amr:hasConcept ?c. - """, - 'clause': """ - # -- Identify concept - ?c rdfs:subClassOf* amr:AMR_Concept ; - amr:label ?cLabel ; - amr:fromAmrLk ?linkedC. - - # -- Identify new variable - ?newV a amr:AMR_Variable ; - amr:label ?vLabel ; - amr:fromAmrLk ?v. - - # -- identify matching between concept and (LK) variable - ?v a ?linkedC. - """, - 'binding':""" - # -- New labels - # -- old --- BIND (strafter(str(?linkedC), '#') AS ?cLabel1) - # -- old --- BIND (strafter(str(?linkedC), str(ns1:)) AS ?cLabel2) - # -- old --- BIND (IF (STRLEN(?cLabel1) > 0, ?cLabel1, ?cLabel2) AS ?cLabel) - # -- old --- BIND (strafter(str(?v), '#') AS ?vLabel) - - # -- New leaf - BIND (CONCAT(str(amr:), 'leaf') AS ?n1). - BIND (CONCAT(?n1, '_', ?cLabel) AS ?n2). - BIND (CONCAT(?n2, '_', ?vLabel) AS ?n3). - BIND (uri(?n3) AS ?newLeaf). - """ - } - - -rule_set['add-amr-leaf-for-reified-concept'] = { - 'label': "add-amr-leaf-for-reified-concept", - 'comment': "Add AMR leaf corresponding to reified concept (with new variable)", - 'construction': """ - # -- New leaf - ?newLeaf a amr:AMR_Leaf ; - amr:isReifiedLeaf true ; - amr:hasVariable ?v ; - amr:hasConcept ?c. - """, - 'clause': """ - # -- Identify reified concept - ?c rdfs:subClassOf* amr:AMR_Concept ; - amr:isReifiedConcept true ; - amr:label ?cLabel ; - amr:fromAmrLk ?linkedC. - - # -- Identify reified variable - ?v a amr:AMR_Variable ; - amr:isReifiedVariable true ; - amr:label ?vLabel. - - # -- Identify matching between reified concept and variable - ?v a ?linkedC. - """, - 'binding':""" - # -- New labels - # -- old --- BIND (strafter(str(?linkedC), '#') AS ?cLabel1) - # -- old --- BIND (strafter(str(?linkedC), str(ns1:)) AS ?cLabel2) - # -- old --- BIND (IF (STRLEN(?cLabel1) > 0, ?cLabel1, ?cLabel2) AS ?cLabel) - # -- old --- BIND (strafter(str(?v), '#') AS ?vLabel) - - # -- New leaf - BIND (CONCAT(str(amr:), 'leaf') AS ?n1). - BIND (CONCAT(?n1, '_', ?cLabel) AS ?n2). - BIND (CONCAT(?n2, '_', ?vLabel) AS ?n3). - BIND (uri(?n3) AS ?newLeaf). - """ - } - - -# --------------------------------------------- -# Addition of edges -# --------------------------------------------- - -rule_set['add-amr-edge-for-core-relation'] = { - 'label': "add-amr-edge-for-core-relation", - 'comment': ("Add AMR edge corresponding to: ", - " (x) LK core relation between two leafs"), - 'construction': """ - # -- New edge - ?newEdge a amr:AMR_Edge ; - amr:hasRoleID ?roleId. - # -- old --- amr:hasRolesetID ?rolesetId ; - # -- old --- amr:hasRoleID ?roleId ; - # -- old --- amr:hasRoleTag ?roleTag. - - # -- New relation between leafs - ?leaf1 ?newEdge ?leaf2. - """, - 'clause': """ - # -- Identify LK relation - ?r a ?amrLkRelation. - 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 - ?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 - BIND (strafter(str(?r), '#') AS ?rLabel1) - BIND (strafter(str(?r), str(ns1:)) AS ?rLabel2) - BIND (IF (STRLEN(?rLabel1) > 0, ?rLabel1, ?rLabel2) AS ?rLabel) - BIND (IF (CONTAINS(?rLabel, "."), - strafter(?rLabel, '.'), - ?rLabel) AS ?roleId) - # -- old --- BIND (IF (STRLEN(?rLabel1) > 0, ?rLabel1, ?rLabel2) AS ?rLabel3) - # -- old --- BIND (IF (CONTAINS(?rLabel3, "."), ?rLabel3, 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 edge - BIND (CONCAT(str(amr:), 'edge') AS ?n1). - BIND (CONCAT(?n1, '_', ?v1Label) AS ?n2). - BIND (CONCAT(?n2, '_', ?roleId) AS ?n3). - BIND (CONCAT(?n3, '_', ?v2Label) AS ?n4). - BIND (uri(?n4) AS ?newEdge). - """ - } - -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, '_', ?rvLabel) AS ?n02). - BIND (CONCAT(?n02, '_', ?roleId0) AS ?n03). - BIND (CONCAT(?n03, '_', ?v1Label) 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'] = { - 'label': "add-amr-edge-for-name-relation", - 'comment': ("Add AMR edge corresponding to: ", - " (x) leaf with name relation."), - 'construction': """ - # -- New value - ?newValue a amr:AMR_Value ; - rdfs:label ?vName. - - # -- New edge - ?newEdge a amr:AMR_Edge ; - amr:hasRoleID ?roleId. - # -- old --- amr:hasRolesetID ?rolesetId ; - # -- old --- amr:hasRoleID ?roleId ; - # -- old --- amr:hasRoleTag ?roleTag. - - # -- New relation between leaf and value - ?leaf ?newEdge ?newValue. - """, - 'clause': """ - # -- Identify leaf with name relation - ?leaf a amr:AMR_Leaf ; - amr:hasVariable ?v ; - amr:hasConcept ?c. - ?v a amr:AMR_Variable ; - amr:label ?vLabel ; - amr:name ?vName. - """, - 'binding':""" - # -- New value - BIND (REPLACE(?vName, ' ', "") AS ?nvLabel). - BIND (CONCAT(str(amr:), 'value') AS ?nv1). - BIND (CONCAT(?nv1, '_', ?nvLabel) AS ?nv2). - BIND (uri(?nv2) AS ?newValue). - - # -- New labels - BIND ('amr.name' AS ?rLabel). - BIND (strbefore(?rLabel, '.') AS ?rolesetId). - BIND (strafter(?rLabel, '.') AS ?roleId). - BIND (?rLabel AS ?roleTag). - # -- old --- BIND (strafter(str(?v), '#') AS ?vLabel). - - # -- New edge - BIND (CONCAT(str(amr:), 'edge') AS ?ne1). - BIND (CONCAT(?ne1, '_', ?vLabel) AS ?ne2). - BIND (CONCAT(?ne2, '_', ?roleId) AS ?ne3). - BIND (CONCAT(?ne3, '_', ?nvLabel) AS ?ne4). - BIND (uri(?ne4) AS ?newEdge). - """ - } - - -rule_set['add-amr-edge-for-quant-relation'] = { - 'label': "add-value-for-quant-relation", - 'comment': ("Add AMR edge corresponding to: ", - " (x) leaf with quant relation."), - 'construction': """ - # -- New value - ?newValue a amr:AMR_Value ; - rdfs:label ?vLabel. - - # -- New edge - ?newEdge a amr:AMR_Edge ; - amr:hasRoleID ?roleId. - # -- old --- amr:hasRolesetID ?rolesetId ; - # -- old --- amr:hasRoleID ?roleId ; - # -- old --- amr:hasRoleTag ?roleTag. - - # -- New relation between leaf and value - ?leaf ?newEdge ?newValue. - """, - 'clause': """ - # -- Identify leaf - ?leaf a amr:AMR_Leaf ; - amr:hasVariable ?v ; - amr:hasConcept ?c. - ?v a amr:AMR_Variable ; - amr:label ?vLabel ; - amr:fromAmrLk ?vLink. - - # -- Identify matching with quant relation (ns2:quant) - ?vLink ns2:quant ?vQuant. - """, - 'binding':""" - # -- New label - BIND (REPLACE(?vQuant, ' ', "") AS ?nvLabel). - - # -- New value - BIND (CONCAT(str(amr:), 'value') AS ?nv1). - BIND (CONCAT(?nv1, '_', ?nvLabel) AS ?nv2). - BIND (uri(?nv2) AS ?newValue). - - # -- New labels - BIND ('amr.quant' AS ?rLabel). - BIND (strbefore(?rLabel, '.') AS ?rolesetId). - BIND (strafter(?rLabel, '.') AS ?roleId). - BIND (?rLabel AS ?roleTag). - # -- old --- BIND (strafter(str(?v), '#') AS ?vLabel). - - # -- New edge - BIND (CONCAT(str(amr:), 'edge') AS ?ne1). - BIND (CONCAT(?ne1, '_', ?vLabel) AS ?ne2). - BIND (CONCAT(?ne2, '_', ?roleId) AS ?ne3). - BIND (CONCAT(?ne3, '_', ?nvLabel) AS ?ne4). - BIND (uri(?ne4) AS ?newEdge). - """ - } - - -rule_set['add-amr-edge-for-polarity-relation'] = { - 'label': "add-amr-edge-for-polarity-relation", - 'comment': ("Add AMR edge corresponding to: ", - " (x) leaf with polarity relation."), - 'construction': """ - # -- New value - ?newValue a amr:AMR_Value ; - rdfs:label ?nvLabel. - - # -- New edge - ?newEdge a amr:AMR_Edge ; - amr:hasRoleID ?roleId. - # -- old --- amr:hasRolesetID ?rolesetId ; - # -- old --- amr:hasRoleID ?roleId ; - # -- old --- amr:hasRoleTag ?roleTag. - - # -- New relation between leaf and value - ?leaf ?newEdge ?newValue. - """, - 'clause': """ - # -- Identify leaf - ?leaf a amr:AMR_Leaf ; - amr:hasVariable ?v ; - amr:hasConcept ?c. - ?v a amr:AMR_Variable ; - amr:label ?vLabel ; - amr:fromAmrLk ?vLink. - - # -- Identify matching with polarity relation (ns2:polarity) - ?vLink ns2:polarity ?vPolarity. - """, - 'binding':""" - # -- New label - BIND (REPLACE(?vPolarity, ' ', "") AS ?nvl1). - BIND (REPLACE(?nvl1, '-', 'negative') AS ?nvLabel). - - # -- New value - BIND (CONCAT(str(amr:), 'value') AS ?nv1). - BIND (CONCAT(?nv1, '_', ?nvLabel) AS ?nv2). - BIND (uri(?nv2) AS ?newValue). - - # -- New labels - BIND ('amr.polarity' AS ?rLabel). - BIND (strbefore(?rLabel, '.') AS ?rolesetId). - BIND (strafter(?rLabel, '.') AS ?roleId). - BIND (?rLabel AS ?roleTag). - # -- old --- BIND (strafter(str(?v), '#') AS ?vLabel). - - # -- New edge - BIND (CONCAT(str(amr:), 'edge') AS ?ne1). - BIND (CONCAT(?ne1, '_', ?vLabel) AS ?ne2). - BIND (CONCAT(?ne2, '_', ?roleId) AS ?ne3). - BIND (CONCAT(?ne3, '_', ?nvLabel) AS ?ne4). - BIND (uri(?ne4) AS ?newEdge). - """ - } - - -# --------------------------------------------- -# Update leafs and edges *** TODO *** -# --------------------------------------------- - -rule_set['update-amr-edge-role-1'] = { - 'label': "update-amr-edge-role-1", - 'comment': ("Update AMR edge by adding relation with AMR_Role", - "(using comparison between label and role id)"), - 'construction': """ - ?edge amr:hasAmrRole ?role. - """, - 'clause': """ - ?edge a amr:AMR_Edge ; - amr:hasRoleID ?edgeRoleId. - ?role rdfs:subClassOf* amr:AMR_Role ; - amr:label ?roleLabel. - FILTER ( ?roleLabel != '' ). - FILTER ( ?edgeRoleId = ?roleLabel ). - """, - 'binding': '' - } - -# rule_set['update-amr-edge-role-2'] = { -# 'label': "update-amr-edge-role-2", -# 'comment': ("Update AMR edge by adding relation with AMR_Role", -# "(using comparison between label and role tag)"), -# 'construction': """ -# ?edge amr:hasAmrRole ?role. -# """, -# 'clause': """ -# ?edge a amr:AMR_Edge ; -# amr:hasRoleTag ?edgeRoleId. -# ?role rdfs:subClassOf* amr:AMR_Role ; -# amr:label ?roleLabel. -# FILTER ( ?roleLabel != '' ). -# FILTER ( ?edgeRoleId = ?roleLabel ). -# """, -# 'binding': '' -# } - - -# --------------------------------------------- -# Preprocessing: Addition of root -# --------------------------------------------- - -rule_set['add-amr-root'] = { - 'label': "add-amr-root", - 'comment': ("Add root instance in AMR_Root"), - 'construction': """ - # -- New root - ?newRoot a amr:AMR_Root ; - amr:hasRootLeaf ?leaf ; - amr:hasSentenceID ?graphId ; - amr:hasSentenceStatement ?graphSentence ; - amr:fromAmrLk ?r. - """, - 'clause': """ - # -- Identify root in AMR-LK - ?r a ns3:AMR. - ?r ns3:root ?lkRoot. - ?r ns3:has-id ?graphId. - ?r ns3:has-sentence ?graphSentence. - ?leaf amr:hasVariable ?varRoot. - ?varRoot a amr:AMR_Variable ; - amr:fromAmrLk ?lkRoot. - """, - 'binding':""" - # -- New root - BIND (CONCAT(str(amr:), 'root') AS ?n1). - BIND (CONCAT(?n1, '_', ?graphId) AS ?n2). - BIND (uri(?n2) AS ?newRoot). - """ - } - diff --git a/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_1.py b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_1.py new file mode 100644 index 00000000..2ff339cc --- /dev/null +++ b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_1.py @@ -0,0 +1,96 @@ +#!/usr/bin/python3.10 +# -*-coding:Utf-8 -* + +#============================================================================== +# TENET: Rule to reify AMR element (from AMR-LK to AMR-RDF format) +#------------------------------------------------------------------------------ +# Reclassify LK concept to AMR Predicat concept for concept (1) corresponding +# to a LK term, frame or named entity, and (2) corresponding to an AMR +# phenomena/relation. +#============================================================================== + +from rdflib import Graph + +import transduction +from transduction import net +from transduction.query_builder import generate_select_query +from transduction.rdfterm_computer import ( produce_uriref, produce_literal ) + + +#============================================================================== +# Pattern Search: leaf{variable, concept} +#============================================================================== + +def __search_pattern(graph): + select_data_list = ['?amrlk_concept', '?phenomena', '?label_1', '?label_2'] + clause_list = [f'?amrlk_concept a ?amrConceptClass.', + f'VALUES ?amrConceptClass {{ns3:Frame ns3:Concept ns3:NamedEntity}}', + f'?phenomena rdfs:subClassOf* amr:AMR_Phenomena.', + f'?phenomena amr:hasConceptLink ?phenomenaLink.', + f'BIND (strafter(str(?amrlk_concept), str(ns1:)) AS ?label_1).', + f'BIND (strafter(str(?amrlk_concept), "#") AS ?label_2).', + f'FILTER (?label_1 = ?phenomenaLink || ?label_2 = ?phenomenaLink).', + f'FILTER NOT EXISTS {{ ?amrlk_concept rdfs:comment "bug". }}'] + query_code = generate_select_query(graph, select_data_list, clause_list) + result_set = graph.query(query_code) + return query_code, result_set + + + +#============================================================================== +# Construct Method(s) +#============================================================================== + +def __reclassify_as_amr_relation_concept( + graph, amrlk_concept, phenomena, label_1, label_2): + + triple_list = [] + + label = label_1 if len(label_1) > 0 else label_2 + new_concept_uri = produce_uriref(graph, f'amr:concept_{label}') + + # -- New concept + relation = produce_uriref(graph, 'rdfs:subClassOf') + value = produce_uriref(graph, 'amr:AMR_Relation_Concept') + triple_list.append((new_concept_uri, relation, value)) + + # -- Label + relation = produce_uriref(graph, 'amr:label') + triple_list.append((new_concept_uri, relation, label)) + + # -- Phenomena Link + relation = produce_uriref(graph, 'amr:hasPhenomenaLink') + triple_list.append((new_concept_uri, relation, phenomena)) + + # -- AMR-LK trace + relation = produce_uriref(graph, 'amr:fromAmrLk') + triple_list.append((new_concept_uri, relation, amrlk_concept)) + + # -- Classification of the original concept as LinkedData (for tracing) + relation = produce_uriref(graph, 'rdfs:subClassOf') + value = produce_uriref(graph, 'amr:AMR_Linked_Data') + triple_list.append((amrlk_concept, relation, value)) + + return triple_list + + + +#============================================================================== +# Main Method +#============================================================================== + +def reclassify_concept_1(graph): + + # -- Rule Initialization + rule_label = 'reclassify AMR-LD concept (1)' + + # -- Search for patterns + _, pattern_set = __search_pattern(graph) + + # -- Selection Analyzing (1) + rule_triple_list = [] + for pattern in pattern_set: + rule_triple_list += __reclassify_as_amr_relation_concept( + graph, pattern.amrlk_concept, pattern.phenomena, pattern.label_1, pattern.label_2) + + return rule_label, rule_triple_list \ No newline at end of file diff --git a/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_10.py b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_10.py new file mode 100644 index 00000000..da3f5917 --- /dev/null +++ b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_10.py @@ -0,0 +1,86 @@ +#!/usr/bin/python3.10 +# -*- coding: Utf-8 -*- + +#============================================================================== +# TENET: Rule to add AMR leaf for reified concept +#------------------------------------------------------------------------------ +# Add AMR leaf corresponding to reified concept (with new variable) +#============================================================================== + +from rdflib import Graph, Literal + +import transduction +from transduction import net +from transduction.query_builder import generate_select_query +from transduction.rdfterm_computer import ( produce_uriref, produce_literal ) + + +#============================================================================== +# Pattern Search: concept{variable, concept} +#============================================================================== + +def __search_pattern(graph): + select_data_list = ['?concept', '?cLabel', '?variable', '?vLabel'] + clause_list = ['?concept rdfs:subClassOf* amr:AMR_Concept .', + '?concept amr:isReifiedConcept true .', + '?concept amr:label ?cLabel .', + '?concept amr:fromAmrLk ?linkedC .', + '?variable a amr:AMR_Variable .', + '?variable amr:isReifiedVariable true .', + '?variable amr:label ?vLabel .', + '?variable a ?linkedC .'] + query_code = generate_select_query(graph, select_data_list, clause_list) + result_set = graph.query(query_code) + return query_code, result_set + + +#============================================================================== +# Construct Method(s) +#============================================================================== + +def __add_amr_leaf(graph, concept, cLabel, variable, vLabel): + triple_list = [] + + # -- New leaf + new_leaf_uri = produce_uriref(graph, f'amr:leaf_{cLabel}_{vLabel}') + relation = produce_uriref(graph, 'rdf:type') + value = produce_uriref(graph, 'amr:AMR_Leaf') + triple_list.append((new_leaf_uri, relation, value)) + + # -- Reification flag + relation = produce_uriref(graph, 'amr:isReifiedLeaf') + value = Literal(True) + triple_list.append((new_leaf_uri, relation, value)) + + # -- Relation: hasVariable + relation = produce_uriref(graph, 'amr:hasVariable') + triple_list.append((new_leaf_uri, relation, variable)) + + # -- Relation: hasConcept + relation = produce_uriref(graph, 'amr:hasConcept') + triple_list.append((new_leaf_uri, relation, concept)) + + return triple_list + + +#============================================================================== +# Main Method +#============================================================================== + +def add_amr_leaf_for_reified_concept(graph): + + # -- Rule Initialization + rule_label = 'add AMR leaf for reified concept' + + # -- Search for patterns + _, pattern_set = __search_pattern(graph) + + # -- Selection Analyzing (1) + rule_triple_list = [] + for pattern in pattern_set: + rule_triple_list += __add_amr_leaf( + graph, pattern.concept, pattern.cLabel, pattern.variable, pattern.vLabel) + + return rule_label, rule_triple_list + + diff --git a/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_11.py b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_11.py new file mode 100644 index 00000000..48799430 --- /dev/null +++ b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_11.py @@ -0,0 +1,90 @@ +#!/usr/bin/python3.10 +# -*- coding: Utf-8 -*- + +#============================================================================== +# TENET: Rule to add AMR edge for core relation +#------------------------------------------------------------------------------ +# Add AMR edge corresponding to LK core relation between two leafs. +#============================================================================== + +from rdflib import Graph + +import transduction +from transduction import net +from transduction.query_builder import generate_select_query +from transduction.rdfterm_computer import ( produce_uriref, produce_literal ) + + +#============================================================================== +# Pattern Search: core relation{leaf1, leaf2} +#============================================================================== + +def __search_pattern(graph): + select_data_list = ['?v1Label', '?v2Label', '?roleId', '?leaf1', '?leaf2'] + clause_list = ['?r a ?amrLkRelation .', + 'VALUES ?amrLkRelation {ns1:FrameRole ns3:Role} .', + 'FILTER NOT EXISTS {{', + '?newConcept rdfs:subClassOf amr:AMR_Predicat_Concept .', + '?newConcept amr:isReifiedConcept true .', + '?newConcept amr:fromAmrLk ?r .', + '}}', + '?leaf1 amr:hasVariable ?v1 .', + '?leaf2 amr:hasVariable ?v2 .', + '?v1 a amr:AMR_Variable .', + '?v1 amr:label ?v1Label .', + '?v1 amr:fromAmrLk ?v1Link .', + '?v2 a amr:AMR_Variable .', + '?v2 amr:label ?v2Label .', + '?v2 amr:fromAmrLk ?v2Link .', + '?v1Link ?r ?v2Link .', + f'BIND (strafter(str(?r), "#") AS ?rLabel1)', + f'BIND (strafter(str(?r), str(ns1:)) AS ?rLabel2)', + f'BIND (IF (STRLEN(?rLabel1) > 0, ?rLabel1, ?rLabel2) AS ?rLabel)', + f'BIND (IF (CONTAINS(?rLabel, "."), strafter(?rLabel, "."), ?rLabel) AS ?roleId)'] + query_code = generate_select_query(graph, select_data_list, clause_list) + result_set = graph.query(query_code) + return query_code, result_set + + + +#============================================================================== +# Construct Method(s) +#============================================================================== + +def __add_amr_edge(graph, v1Label, v2Label, roleId, leaf1, leaf2): + triple_list = [] + + # -- New edge + new_edge_uri = produce_uriref(graph, f'amr:edge_{v1Label}_{v2Label}') + relation = produce_uriref(graph, 'rdf:type') + value = produce_uriref(graph, 'amr:AMR_Edge') + triple_list.append((new_edge_uri, relation, value)) + + # -- Relation: hasRoleID + relation = produce_uriref(graph, 'amr:hasRoleID') + triple_list.append((new_edge_uri, relation, roleId)) + + # -- New relation between leafs + triple_list.append((leaf1, new_edge_uri, leaf2)) + + return triple_list + +#============================================================================== +# Main Method +#============================================================================== + +def add_amr_edge_for_core_relation(graph): + + # -- Rule Initialization + rule_label = 'add AMR edge for core relation' + + # -- Search for patterns + _, pattern_set = __search_pattern(graph) + + # -- Selection Analyzing + rule_triple_list = [] + for pattern in pattern_set: + rule_triple_list += __add_amr_edge( + graph, pattern.v1Label, pattern.v2Label, pattern.roleId, pattern.leaf1, pattern.leaf2) + + return rule_label, rule_triple_list diff --git a/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_12.py b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_12.py new file mode 100644 index 00000000..96ab513f --- /dev/null +++ b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_12.py @@ -0,0 +1,105 @@ +#!/usr/bin/python3.10 +# -*- coding: Utf-8 -*- + +#============================================================================== +# TENET: Rule to add AMR edge for reified concept +#------------------------------------------------------------------------------ +# Add AMR edge corresponding to reification of LK non-core relation to concept. +#============================================================================== + +from rdflib import Graph + +import transduction +from transduction import net +from transduction.query_builder import generate_select_query +from transduction.rdfterm_computer import ( produce_uriref, produce_literal ) + + +#============================================================================== +# Pattern Search: reified concept{reified leaf, leaf1, leaf2} +#============================================================================== + +def __search_pattern(graph): + select_data_list = ['?rvLabel', + '?roleId0', '?roleId1', + '?v1Label', '?v2Label', + '?reifiedLeaf', '?leaf1', '?leaf2'] + clause_list = ['?reifiedLeaf a amr:AMR_Leaf.', + '?reifiedLeaf amr:isReifiedLeaf true.', + '?reifiedLeaf amr:hasVariable ?reifiedVariable.', + '?reifiedLeaf amr:hasConcept ?reifiedConcept.', + '?reifiedVariable amr:label ?rvLabel.', + '?reifiedConcept amr:fromAmrLk ?r.', + '?leaf1 amr:hasVariable ?v1.', + '?leaf2 amr:hasVariable ?v2.', + '?v1 a amr:AMR_Variable.', + '?v1 amr:label ?v1Label.', + '?v1 amr:fromAmrLk ?v1Link.', + '?v2 a amr:AMR_Variable.', + '?v2 amr:label ?v2Label.', + '?v2 amr:fromAmrLk ?v2Link.', + '?v1Link ?r ?v2Link.', + 'BIND ("ARG0" AS ?roleId0)', + 'BIND ("ARG1" AS ?roleId1)'] + query_code = generate_select_query(graph, select_data_list, clause_list) + result_set = graph.query(query_code) + return query_code, result_set + + +#============================================================================== +# Construct Method(s) +#============================================================================== + +def __add_amr_edge(graph, + rvLabel, roleId0, roleId1, v1Label, v2Label, + reifiedLeaf, leaf1, leaf2): + triple_list = [] + + # -- New edge 0 + new_edge_0_uri = produce_uriref(graph, f'amr:edge_{rvLabel}_{roleId0}_{v1Label}') + relation = produce_uriref(graph, 'rdf:type') + value = produce_uriref(graph, 'amr:AMR_Edge') + triple_list.append((new_edge_0_uri, relation, value)) + + # -- Relation: hasRoleID for new edge 0 + relation = produce_uriref(graph, 'amr:hasRoleID') + triple_list.append((new_edge_0_uri, relation, roleId0)) + + # -- New edge 1 + new_edge_1_uri = produce_uriref(graph, f'amr:edge_{rvLabel}_{roleId1}_{v2Label}') + relation = produce_uriref(graph, 'rdf:type') + value = produce_uriref(graph, 'amr:AMR_Edge') + triple_list.append((new_edge_1_uri, relation, value)) + + # -- Relation: hasRoleID for new edge 1 + relation = produce_uriref(graph, 'amr:hasRoleID') + triple_list.append((new_edge_1_uri, relation, roleId1)) + + # -- New relation between leafs + triple_list.append((reifiedLeaf, new_edge_0_uri, leaf1)) + triple_list.append((reifiedLeaf, new_edge_1_uri, leaf2)) + + return triple_list + + +#============================================================================== +# Main Method +#============================================================================== + +def add_amr_edge_for_reified_concept(graph): + + # -- Rule Initialization + rule_label = 'add AMR edge for reified concept' + + # -- Search for patterns + _, pattern_set = __search_pattern(graph) + + # -- Selection Analyzing + rule_triple_list = [] + for pattern in pattern_set: + rule_triple_list += __add_amr_edge( + graph, + pattern.rvLabel, pattern.roleId0, pattern.roleId1, pattern.v1Label, pattern.v2Label, + pattern.reifiedLeaf, pattern.leaf1, pattern.leaf2) + + return rule_label, rule_triple_list diff --git a/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_13.py b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_13.py new file mode 100644 index 00000000..534fed0b --- /dev/null +++ b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_13.py @@ -0,0 +1,90 @@ +#!/usr/bin/python3.10 +# -*- coding: Utf-8 -*- + +#============================================================================== +# TENET: Rule to add AMR edge for name relation +#------------------------------------------------------------------------------ +# Add AMR edge corresponding to leaf with name relation. +#============================================================================== + +from rdflib import Graph, Literal + +import transduction +from transduction import net +from transduction.query_builder import generate_select_query +from transduction.rdfterm_computer import ( produce_uriref, produce_literal ) + + +#============================================================================== +# Pattern Search: leaf with name relation +#============================================================================== + +def __search_pattern(graph): + select_data_list = ['?leaf', '?varLabel', '?valueLabel'] + clause_list = ['?leaf a amr:AMR_Leaf.', + '?leaf amr:hasVariable ?v.', + '?leaf amr:hasConcept ?c.', + '?v a amr:AMR_Variable.', + '?v amr:label ?varLabel.', + '?v amr:name ?varName.', + 'BIND (REPLACE(?varName, " ", "") AS ?valueLabel).'] + query_code = generate_select_query(graph, select_data_list, clause_list) + result_set = graph.query(query_code) + return query_code, result_set + + + +#============================================================================== +# Construct Method(s) +#============================================================================== + +def __add_amr_edge(graph, leaf, varLabel, valueLabel, roleId='name'): + triple_list = [] + + # -- New value + new_value_uri = produce_uriref(graph, f'amr:value_{valueLabel}') + relation = produce_uriref(graph, 'rdf:type') + value = produce_uriref(graph, 'amr:AMR_Value') + triple_list.append((new_value_uri, relation, value)) + + # -- Value label + relation = produce_uriref(graph, 'rdfs:label') + value = valueLabel + triple_list.append((new_value_uri, relation, value)) + + # -- New edge + new_edge_uri = produce_uriref(graph, f'amr:edge_{varLabel}_{roleId}_{valueLabel}') + relation = produce_uriref(graph, 'rdf:type') + value = produce_uriref(graph, 'amr:AMR_Edge') + triple_list.append((new_edge_uri, relation, value)) + + # -- Relation: hasRoleID for new edge + relation = produce_uriref(graph, 'amr:hasRoleID') + value = Literal(f'{roleId}') + triple_list.append((new_edge_uri, relation, value)) + + # -- New relation between leaf and value + triple_list.append((leaf, new_edge_uri, new_value_uri)) + + return triple_list + + +#============================================================================== +# Main Method +#============================================================================== + +def add_amr_edge_for_name_relation(graph): + + # -- Rule Initialization + rule_label = 'add AMR edge for name relation' + + # -- Search for patterns + _, pattern_set = __search_pattern(graph) + + # -- Selection Analyzing + rule_triple_list = [] + for pattern in pattern_set: + rule_triple_list += __add_amr_edge( + graph, pattern.leaf, pattern.varLabel, pattern.valueLabel) + + return rule_label, rule_triple_list diff --git a/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_14.py b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_14.py new file mode 100644 index 00000000..7fe482bd --- /dev/null +++ b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_14.py @@ -0,0 +1,95 @@ +#!/usr/bin/python3.10 +# -*- coding: Utf-8 -*- + +#============================================================================== +# TENET: Rule to add AMR edge for quant relation +#------------------------------------------------------------------------------ +# Add AMR edge corresponding to leaf with quant relation. +#============================================================================== + +from rdflib import Graph, Literal + +import transduction +from transduction import net +from transduction.query_builder import generate_select_query +from transduction.rdfterm_computer import ( produce_uriref, produce_literal ) + + +#============================================================================== +# Pattern Search: leaf{quant} +#============================================================================== + +#============================================================================== +# Pattern Search: leaf with quant relation +#============================================================================== + +def __search_pattern(graph): + select_data_list = ['?leaf', '?varLabel', '?valueLabel'] + clause_list = ['?leaf a amr:AMR_Leaf.', + '?leaf amr:hasVariable ?v.', + '?leaf amr:hasConcept ?c.', + '?v a amr:AMR_Variable.', + '?v amr:label ?varLabel.', + '?v amr:fromAmrLk ?vLink.', + '?vLink ns2:quant ?vQuant.', + 'BIND (REPLACE(?vQuant, " ", "") AS ?valueLabel).' + ] + query_code = generate_select_query(graph, select_data_list, clause_list) + result_set = graph.query(query_code) + return query_code, result_set + + +#============================================================================== +# Construct Method(s) +#============================================================================== + +def __add_amr_edge(graph, leaf, varLabel, valueLabel, roleId='quant'): + triple_list = [] + + # -- New value + new_value_uri = produce_uriref(graph, f'amr:value_{valueLabel}') + relation = produce_uriref(graph, 'rdf:type') + value = produce_uriref(graph, 'amr:AMR_Value') + triple_list.append((new_value_uri, relation, value)) + + # -- Value label + relation = produce_uriref(graph, 'rdfs:label') + value = valueLabel + triple_list.append((new_value_uri, relation, value)) + + # -- New edge + new_edge_uri = produce_uriref(graph, f'amr:edge_{varLabel}_{roleId}_{valueLabel}') + relation = produce_uriref(graph, 'rdf:type') + value = produce_uriref(graph, 'amr:AMR_Edge') + triple_list.append((new_edge_uri, relation, value)) + + # -- Relation: hasRoleID for new edge + relation = produce_uriref(graph, 'amr:hasRoleID') + value = Literal(f'{roleId}') + triple_list.append((new_edge_uri, relation, value)) + + # -- New relation between leaf and value + triple_list.append((leaf, new_edge_uri, new_value_uri)) + + return triple_list + + +#============================================================================== +# Main Method +#============================================================================== + +def add_amr_edge_for_quant_relation(graph): + + # -- Rule Initialization + rule_label = 'add AMR edge for quant relation' + + # -- Search for patterns + _, pattern_set = __search_pattern(graph) + + # -- Selection Analyzing + rule_triple_list = [] + for pattern in pattern_set: + rule_triple_list += __add_amr_edge( + graph, pattern.leaf, pattern.varLabel, pattern.valueLabel) + + return rule_label, rule_triple_list diff --git a/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_15.py b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_15.py new file mode 100644 index 00000000..9e687442 --- /dev/null +++ b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_15.py @@ -0,0 +1,92 @@ +#!/usr/bin/python3.10 +# -*- coding: Utf-8 -*- + +#============================================================================== +# TENET: Rule to add AMR edge for polarity relation +#------------------------------------------------------------------------------ +# Add AMR edge corresponding to leaf with polarity relation. +#============================================================================== + +from rdflib import Graph, Literal + +import transduction +from transduction import net +from transduction.query_builder import generate_select_query +from transduction.rdfterm_computer import ( produce_uriref, produce_literal ) + + +#============================================================================== +# Pattern Search: leaf{polarity} +#============================================================================== + +def __search_pattern(graph): + select_data_list = ['?leaf', '?varLabel', '?valueLabel'] + clause_list = ['?leaf a amr:AMR_Leaf.', + '?leaf amr:hasVariable ?v.', + '?leaf amr:hasConcept ?c.', + '?v a amr:AMR_Variable.', + '?v amr:label ?varLabel.', + '?v amr:fromAmrLk ?vLink.', + '?vLink ns2:polarity ?vPolarity.', + 'BIND (REPLACE(?vPolarity, " ", "") AS ?nvl1).', + 'BIND (REPLACE(?nvl1, "-", "negative") AS ?valueLabel).' + ] + query_code = generate_select_query(graph, select_data_list, clause_list) + result_set = graph.query(query_code) + return query_code, result_set + + +#============================================================================== +# Construct Method(s) +#============================================================================== + +def __add_amr_edge(graph, leaf, varLabel, valueLabel, roleId='polarity'): + triple_list = [] + + # -- New value + new_value_uri = produce_uriref(graph, f'amr:value_{valueLabel}') + relation = produce_uriref(graph, 'rdf:type') + value = produce_uriref(graph, 'amr:AMR_Value') + triple_list.append((new_value_uri, relation, value)) + + # -- Value label + relation = produce_uriref(graph, 'rdfs:label') + value = valueLabel + triple_list.append((new_value_uri, relation, value)) + + # -- New edge + new_edge_uri = produce_uriref(graph, f'amr:edge_{varLabel}_{roleId}_{valueLabel}') + relation = produce_uriref(graph, 'rdf:type') + value = produce_uriref(graph, 'amr:AMR_Edge') + triple_list.append((new_edge_uri, relation, value)) + + # -- Relation: hasRoleID for new edge + relation = produce_uriref(graph, 'amr:hasRoleID') + value = Literal(f'{roleId}') + triple_list.append((new_edge_uri, relation, value)) + + # -- New relation between leaf and value + triple_list.append((leaf, new_edge_uri, new_value_uri)) + + return triple_list + + +#============================================================================== +# Main Method +#============================================================================== + +def add_amr_edge_for_polarity_relation(graph): + + # -- Rule Initialization + rule_label = 'add AMR edge for polarity relation' + + # -- Search for patterns + _, pattern_set = __search_pattern(graph) + + # -- Selection Analyzing (1) + rule_triple_list = [] + for pattern in pattern_set: + rule_triple_list += __add_amr_edge( + graph, pattern.leaf, pattern.varLabel, pattern.valueLabel) + + return rule_label, rule_triple_list diff --git a/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_16.py b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_16.py new file mode 100644 index 00000000..ed237273 --- /dev/null +++ b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_16.py @@ -0,0 +1,67 @@ +#!/usr/bin/python3.10 +# -*- coding: Utf-8 -*- + +#============================================================================== +# TENET: Rule to update AMR edge role by adding relation with AMR_Role +#------------------------------------------------------------------------------ +# Update AMR edge by adding relation with AMR_Role using comparison between +# label and role ID. +#============================================================================== + +from rdflib import Graph + +import transduction +from transduction import net +from transduction.query_builder import generate_select_query +from transduction.rdfterm_computer import ( produce_uriref, produce_literal ) + + +#============================================================================== +# Pattern Search: edge{amr:hasAmrRole / role{amr:label}} +#============================================================================== + +def __search_pattern(graph): + select_data_list = ['?edge', '?role'] + clause_list = ['?edge a amr:AMR_Edge.', + '?edge amr:hasRoleID ?edgeRoleId.', + '?role rdfs:subClassOf* amr:AMR_Role.', + '?role amr:label ?roleLabel.', + 'FILTER ( ?roleLabel != "" ).', + 'FILTER ( ?edgeRoleId = ?roleLabel ).'] + query_code = generate_select_query(graph, select_data_list, clause_list) + result_set = graph.query(query_code) + return query_code, result_set + + +#============================================================================== +# Construct Method(s) +#============================================================================== + +def __update_amr_edge_role(graph, edge, role): + triple_list = [] + + # -- Add relation with AMR_Role + relation = produce_uriref(graph, 'amr:hasAmrRole') + triple_list.append((edge, relation, role)) + + return triple_list + + +#============================================================================== +# Main Method +#============================================================================== + +def update_amr_edge_role_1(graph): + + # -- Rule Initialization + rule_label = 'update AMR edge role 1' + + # -- Search for patterns + _, pattern_set = __search_pattern(graph) + + # -- Selection Analyzing (1) + rule_triple_list = [] + for pattern in pattern_set: + rule_triple_list += __update_amr_edge_role(graph, pattern.edge, pattern.role) + + return rule_label, rule_triple_list diff --git a/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_17.py b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_17.py new file mode 100644 index 00000000..300a681f --- /dev/null +++ b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_17.py @@ -0,0 +1,91 @@ +#!/usr/bin/python3.10 +# -*- coding: Utf-8 -*- + +#============================================================================== +# TENET: Rule to add root instance in AMR_Root +#------------------------------------------------------------------------------ +# Add root instance in AMR_Root. +#============================================================================== + +from rdflib import Graph + +import transduction +from transduction import net +from transduction.query_builder import generate_select_query +from transduction.rdfterm_computer import ( produce_uriref, produce_literal ) + + +#============================================================================== +# Pattern Search: r{ns3:root / ns3:has-id / ns3:has-sentence} -- +# lkRoot / varRoot{amr:fromAmrLk} +#============================================================================== + +def __search_pattern(graph): + select_data_list = ['?leaf', '?graphId', '?graphSentence', '?originRoot'] + clause_list = ['?originRoot a ns3:AMR.', + '?originRoot ns3:root ?lkRoot.', + '?originRoot ns3:has-id ?graphId.', + '?originRoot ns3:has-sentence ?graphSentence.', + '?leaf amr:hasVariable ?varRoot.', + '?varRoot a amr:AMR_Variable.', + '?varRoot amr:fromAmrLk ?lkRoot'] + query_code = generate_select_query(graph, select_data_list, clause_list) + result_set = graph.query(query_code) + return query_code, result_set + + + +#============================================================================== +# Construct Method(s) +#============================================================================== + +def __add_amr_root(graph, leaf, graphId, graphSentence, originRoot): + triple_list = [] + + # -- New root + new_root_uri = produce_uriref(graph, f'amr:root_{graphId}') + relation = produce_uriref(graph, 'rdf:type') + value = produce_uriref(graph, 'amr:AMR_Value') + triple_list.append((new_root_uri, relation, value)) + + # -- Relation: hasRootLeaf for new root + relation = produce_uriref(graph, 'amr:hasRootLeaf') + value = leaf + triple_list.append((new_root_uri, relation, value)) + + # -- Relation: hasSentenceID for new root + relation = produce_uriref(graph, 'amr:hasSentenceID') + value = graphId + triple_list.append((new_root_uri, relation, value)) + + # -- Relation: hasSentenceStatement for new root + relation = produce_uriref(graph, 'amr:hasSentenceStatement') + value = graphSentence + triple_list.append((new_root_uri, relation, value)) + + # -- Linking new variable to LK role (for tracing) + relation = produce_uriref(graph, 'amr:fromAmrLk') + triple_list.append((new_root_uri, relation, originRoot)) + + return triple_list + + +#============================================================================== +# Main Method +#============================================================================== + +def add_amr_root(graph): + + # -- Rule Initialization + rule_label = 'add AMR root' + + # -- Search for patterns + _, pattern_set = __search_pattern(graph) + + # -- Selection Analyzing (1) + rule_triple_list = [] + for pattern in pattern_set: + rule_triple_list += __add_amr_root( + graph, pattern.leaf, pattern.graphId, pattern.graphSentence, pattern.originRoot) + + return rule_label, rule_triple_list diff --git a/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_2.py b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_2.py new file mode 100644 index 00000000..d050be1f --- /dev/null +++ b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_2.py @@ -0,0 +1,91 @@ +#!/usr/bin/python3.10 +# -*-coding:Utf-8 -* + +#============================================================================== +# TENET: Rule to reify AMR element (from AMR-LK to AMR-RDF format) +#------------------------------------------------------------------------------ +# Reclassify LK concept to AMR Predicat concept for concept (1) corresponding +# to a predicat (ns3 concept) and (2) not corresponding to a relation. +#============================================================================== + +from rdflib import Graph + +import transduction +from transduction import net +from transduction.query_builder import generate_select_query +from transduction.rdfterm_computer import ( produce_uriref, produce_literal ) + + +#============================================================================== +# Pattern Search: leaf{variable, concept} +#============================================================================== + +def __search_pattern(graph): + select_data_list = ['?amrlk_concept', '?label_1', '?label_2'] + clause_list = [f'?amrlk_concept a ns3:Concept.', + f'FILTER ( CONTAINS(str(?amrlk_concept), str(ns3:)) ).', + f'FILTER ( ?amrlk_concept != ns3:Frame ).', + f'FILTER ( ?amrlk_concept != ns3:NamedEntity ).', + f'FILTER NOT EXISTS {{ ?amrC rdfs:subClassOf amr:AMR_Relation_Concept ; amr:fromAmrLk ?amrlk_concept.}}', + f'BIND (strafter(str(?amrlk_concept), str(ns1:)) AS ?label_1).', + f'BIND (strafter(str(?amrlk_concept), "#") AS ?label_2).', + f'FILTER NOT EXISTS {{ ?amrlk_concept rdfs:comment "bug". }}'] + query_code = generate_select_query(graph, select_data_list, clause_list) + result_set = graph.query(query_code) + return query_code, result_set + + + +#============================================================================== +# Construct Method(s) +#============================================================================== + +def __reclassify_as_amr_predicat_concept( + graph, amrlk_concept, label_1, label_2): + + triple_list = [] + + label = label_1 if len(label_1) > 0 else label_2 + new_concept_uri = produce_uriref(graph, f'amr:concept_{label}') + + # -- New concept + relation = produce_uriref(graph, 'rdfs:subClassOf') + value = produce_uriref(graph, 'amr:AMR_Predicat_Concept') + triple_list.append((new_concept_uri, relation, value)) + + # -- Label + relation = produce_uriref(graph, 'amr:label') + triple_list.append((new_concept_uri, relation, label)) + + # -- AMR-LK trace + relation = produce_uriref(graph, 'amr:fromAmrLk') + triple_list.append((new_concept_uri, relation, amrlk_concept)) + + # -- Classification of the original concept as LinkedData (for tracing) + relation = produce_uriref(graph, 'rdfs:subClassOf') + value = produce_uriref(graph, 'amr:AMR_Linked_Data') + triple_list.append((amrlk_concept, relation, value)) + + return triple_list + + + +#============================================================================== +# Main Method +#============================================================================== + +def reclassify_concept_2(graph): + + # -- Rule Initialization + rule_label = 'reclassify AMR-LD concept (2)' + + # -- Search for patterns + _, pattern_set = __search_pattern(graph) + + # -- Selection Analyzing (1) + rule_triple_list = [] + for pattern in pattern_set: + rule_triple_list += __reclassify_as_amr_predicat_concept( + graph, pattern.amrlk_concept, pattern.label_1, pattern.label_2) + + return rule_label, rule_triple_list \ No newline at end of file diff --git a/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_3.py b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_3.py new file mode 100644 index 00000000..6585fc3b --- /dev/null +++ b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_3.py @@ -0,0 +1,88 @@ +#!/usr/bin/python3.10 +# -*-coding:Utf-8 -* + +#============================================================================== +# TENET: Rule to reify AMR element (from AMR-LK to AMR-RDF format) +#------------------------------------------------------------------------------ +# Reclassify LK concept to AMR Predicat concept for concept (1) corresponding +# to a frame and (2) not corresponding to a relation. +#============================================================================== + +from rdflib import Graph + +import transduction +from transduction import net +from transduction.query_builder import generate_select_query +from transduction.rdfterm_computer import ( produce_uriref, produce_literal ) + + +#============================================================================== +# Pattern Search: leaf{variable, concept} +#============================================================================== + +def __search_pattern(graph): + select_data_list = ['?amrlk_concept', '?label_1', '?label_2'] + clause_list = [f'?amrlk_concept a ns3:Frame.', + f'FILTER NOT EXISTS {{ ?amrC rdfs:subClassOf amr:AMR_Relation_Concept ; amr:fromAmrLk ?amrlk_concept.}}', + f'BIND (strafter(str(?amrlk_concept), str(ns1:)) AS ?label_1).', + f'BIND (strafter(str(?amrlk_concept), "#") AS ?label_2).', + f'FILTER NOT EXISTS {{ ?amrlk_concept rdfs:comment "bug". }}'] + query_code = generate_select_query(graph, select_data_list, clause_list) + result_set = graph.query(query_code) + return query_code, result_set + + + +#============================================================================== +# Construct Method(s) +#============================================================================== + +def __reclassify_as_amr_predicat_concept( + graph, amrlk_concept, label_1, label_2): + + triple_list = [] + + label = label_1 if len(label_1) > 0 else label_2 + new_concept_uri = produce_uriref(graph, f'amr:concept_{label}') + + # -- New concept + relation = produce_uriref(graph, 'rdfs:subClassOf') + value = produce_uriref(graph, 'amr:AMR_Predicat_Concept') + triple_list.append((new_concept_uri, relation, value)) + + # -- Label + relation = produce_uriref(graph, 'amr:label') + triple_list.append((new_concept_uri, relation, label)) + + # -- AMR-LK trace + relation = produce_uriref(graph, 'amr:fromAmrLk') + triple_list.append((new_concept_uri, relation, amrlk_concept)) + + # -- Classification of the original concept as LinkedData (for tracing) + relation = produce_uriref(graph, 'rdfs:subClassOf') + value = produce_uriref(graph, 'amr:AMR_Linked_Data') + triple_list.append((amrlk_concept, relation, value)) + + return triple_list + + + +#============================================================================== +# Main Method +#============================================================================== + +def reclassify_concept_3(graph): + + # -- Rule Initialization + rule_label = 'reclassify AMR-LD concept (3)' + + # -- Search for patterns + _, pattern_set = __search_pattern(graph) + + # -- Selection Analyzing (1) + rule_triple_list = [] + for pattern in pattern_set: + rule_triple_list += __reclassify_as_amr_predicat_concept( + graph, pattern.amrlk_concept, pattern.label_1, pattern.label_2) + + return rule_label, rule_triple_list \ No newline at end of file diff --git a/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_4.py b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_4.py new file mode 100644 index 00000000..ab44f62c --- /dev/null +++ b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_4.py @@ -0,0 +1,91 @@ +#!/usr/bin/python3.10 +# -*-coding:Utf-8 -* + +#============================================================================== +# TENET: Rule to reify AMR element (from AMR-LK to AMR-RDF format) +#------------------------------------------------------------------------------ +# Reclassify LK concept to AMR Term concept for concept (1) corresponding +# to a term (ns2 concept) and (1) not corresponding to a relation. +#============================================================================== + +from rdflib import Graph + +import transduction +from transduction import net +from transduction.query_builder import generate_select_query +from transduction.rdfterm_computer import ( produce_uriref, produce_literal ) + + +#============================================================================== +# Pattern Search: leaf{variable, concept} +#============================================================================== + +def __search_pattern(graph): + select_data_list = ['?amrlk_concept', '?label_1', '?label_2'] + clause_list = [f'?amrlk_concept a ns3:Concept.', + f'FILTER ( CONTAINS(str(?amrlk_concept), str(ns2:)) ).', + f'FILTER ( ?amrlk_concept != ns3:Frame ).', + f'FILTER ( ?amrlk_concept != ns3:NamedEntity ).', + f'FILTER NOT EXISTS {{ ?amrC rdfs:subClassOf amr:AMR_Relation_Concept ; amr:fromAmrLk ?amrlk_concept.}}', + f'BIND (strafter(str(?amrlk_concept), str(ns1:)) AS ?label_1).', + f'BIND (strafter(str(?amrlk_concept), "#") AS ?label_2).', + f'FILTER NOT EXISTS {{ ?amrlk_concept rdfs:comment "bug". }}'] + query_code = generate_select_query(graph, select_data_list, clause_list) + result_set = graph.query(query_code) + return query_code, result_set + + + +#============================================================================== +# Construct Method(s) +#============================================================================== + +def __reclassify_as_amr_term_concept( + graph, amrlk_concept, label_1, label_2): + + triple_list = [] + + label = label_1 if len(label_1) > 0 else label_2 + new_concept_uri = produce_uriref(graph, f'amr:concept_{label}') + + # -- New concept + relation = produce_uriref(graph, 'rdfs:subClassOf') + value = produce_uriref(graph, 'amr:AMR_Term_Concept') + triple_list.append((new_concept_uri, relation, value)) + + # -- Label + relation = produce_uriref(graph, 'amr:label') + triple_list.append((new_concept_uri, relation, label)) + + # -- AMR-LK trace + relation = produce_uriref(graph, 'amr:fromAmrLk') + triple_list.append((new_concept_uri, relation, amrlk_concept)) + + # -- Classification of the original concept as LinkedData (for tracing) + relation = produce_uriref(graph, 'rdfs:subClassOf') + value = produce_uriref(graph, 'amr:AMR_Linked_Data') + triple_list.append((amrlk_concept, relation, value)) + + return triple_list + + + +#============================================================================== +# Main Method +#============================================================================== + +def reclassify_concept_4(graph): + + # -- Rule Initialization + rule_label = 'reclassify AMR-LD concept (4)' + + # -- Search for patterns + _, pattern_set = __search_pattern(graph) + + # -- Selection Analyzing (1) + rule_triple_list = [] + for pattern in pattern_set: + rule_triple_list += __reclassify_as_amr_term_concept( + graph, pattern.amrlk_concept, pattern.label_1, pattern.label_2) + + return rule_label, rule_triple_list \ No newline at end of file diff --git a/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_5.py b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_5.py new file mode 100644 index 00000000..68714f14 --- /dev/null +++ b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_5.py @@ -0,0 +1,88 @@ +#!/usr/bin/python3.10 +# -*-coding:Utf-8 -* + +#============================================================================== +# TENET: Rule to reify AMR element (from AMR-LK to AMR-RDF format) +#------------------------------------------------------------------------------ +# Reclassify LK concept to AMR Predicat concept for concept (1) corresponding +# to a named entity and (1) not corresponding to a relation. +#============================================================================== + +from rdflib import Graph + +import transduction +from transduction import net +from transduction.query_builder import generate_select_query +from transduction.rdfterm_computer import ( produce_uriref, produce_literal ) + + +#============================================================================== +# Pattern Search: leaf{variable, concept} +#============================================================================== + +def __search_pattern(graph): + select_data_list = ['?amrlk_concept', '?label_1', '?label_2'] + clause_list = [f'?amrlk_concept a ns3:NamedEntity.', + f'FILTER NOT EXISTS {{ ?amrC rdfs:subClassOf amr:AMR_Relation_Concept ; amr:fromAmrLk ?amrlk_concept.}}', + f'BIND (strafter(str(?amrlk_concept), str(ns1:)) AS ?label_1).', + f'BIND (strafter(str(?amrlk_concept), "#") AS ?label_2).', + f'FILTER NOT EXISTS {{ ?amrlk_concept rdfs:comment "bug". }}'] + query_code = generate_select_query(graph, select_data_list, clause_list) + result_set = graph.query(query_code) + return query_code, result_set + + + +#============================================================================== +# Construct Method(s) +#============================================================================== + +def __reclassify_as_amr_term_concept( + graph, amrlk_concept, label_1, label_2): + + triple_list = [] + + label = label_1 if len(label_1) > 0 else label_2 + new_concept_uri = produce_uriref(graph, f'amr:concept_{label}') + + # -- New concept + relation = produce_uriref(graph, 'rdfs:subClassOf') + value = produce_uriref(graph, 'amr:AMR_Term_Concept') + triple_list.append((new_concept_uri, relation, value)) + + # -- Label + relation = produce_uriref(graph, 'amr:label') + triple_list.append((new_concept_uri, relation, label)) + + # -- AMR-LK trace + relation = produce_uriref(graph, 'amr:fromAmrLk') + triple_list.append((new_concept_uri, relation, amrlk_concept)) + + # -- Classification of the original concept as LinkedData (for tracing) + relation = produce_uriref(graph, 'rdfs:subClassOf') + value = produce_uriref(graph, 'amr:AMR_Linked_Data') + triple_list.append((amrlk_concept, relation, value)) + + return triple_list + + + +#============================================================================== +# Main Method +#============================================================================== + +def reclassify_concept_5(graph): + + # -- Rule Initialization + rule_label = 'reclassify AMR-LD concept (5)' + + # -- Search for patterns + _, pattern_set = __search_pattern(graph) + + # -- Selection Analyzing (1) + rule_triple_list = [] + for pattern in pattern_set: + rule_triple_list += __reclassify_as_amr_term_concept( + graph, pattern.amrlk_concept, pattern.label_1, pattern.label_2) + + return rule_label, rule_triple_list \ No newline at end of file diff --git a/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_6.py b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_6.py new file mode 100644 index 00000000..0028d398 --- /dev/null +++ b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_6.py @@ -0,0 +1,98 @@ +#!/usr/bin/python3.10 +# -*-coding:Utf-8 -* + +#============================================================================== +# TENET: Rule to reify roles as AMR Relation concept +#------------------------------------------------------------------------------ +# Reify some LK roles to AMR Relation concept for: +# (1) AMR relation with reification, +# (2) non core LK role, +# (3) matching between role and reification relation. +#============================================================================== + +from rdflib import Graph, Literal + +import transduction +from transduction import net +from transduction.query_builder import generate_select_query +from transduction.rdfterm_computer import ( produce_uriref, produce_literal ) + + +#============================================================================== +# Pattern Search +#============================================================================== + +def __search_pattern(graph): + select_data_list = ['?originConcept', '?relationName', '?reificationConcept'] + clause_list = [f'?reifiableRelation rdfs:subClassOf amr:AMR_Relation .', + f'?reifiableRelation amr:hasReification true .', + f'?reifiableRelation amr:hasRelationName ?relationName .', + f'?reifiableRelation amr:hasReificationConcept ?reificationConcept .', + f'?originConcept a ns3:Role .', + f'FILTER (?originConcept != ns1:FrameRole) .', + f'BIND (strafter(str(?originConcept), str(ns1:)) AS ?rLabel1) .', + f'BIND (strafter(str(?originConcept), "#") AS ?rLabel2) .', + f'FILTER (?rLabel1 = ?relationName || ?rLabel2 = ?relationName) .'] + query_code = generate_select_query(graph, select_data_list, clause_list) + result_set = graph.query(query_code) + return query_code, result_set + + +#============================================================================== +# Construct Method(s) +#============================================================================== + +def __reify_roles_as_concept( + graph, originConcept, relationName, reificationConcept): + + triple_list = [] + + new_concept_uri = produce_uriref(graph, f'amr:concept_{relationName}') + + # -- New concept + relation = produce_uriref(graph, 'rdfs:subClassOf') + value = produce_uriref(graph, 'amr:AMR_Predicat_Concept') + triple_list.append((new_concept_uri, relation, value)) + + # -- Reification flag + relation = produce_uriref(graph, 'amr:isReifiedConcept') + value = Literal(True) + triple_list.append((new_concept_uri, relation, value)) + + # -- Label + relation = produce_uriref(graph, 'amr:label') + triple_list.append((new_concept_uri, relation, reificationConcept)) + + # -- AMR-LK trace + relation = produce_uriref(graph, 'amr:fromAmrLk') + triple_list.append((new_concept_uri, relation, originConcept)) + + # -- Classification of the original concept as LinkedData (for tracing) + relation = produce_uriref(graph, 'rdfs:subClassOf') + value = produce_uriref(graph, 'amr:AMR_Linked_Data') + triple_list.append((originConcept, relation, value)) + + return triple_list + + + +#============================================================================== +# Main Method +#============================================================================== + +def reify_roles_as_concept(graph): + + # -- Rule Initialization + rule_label = 'reify roles as concept' + + # -- Search for patterns + _, pattern_set = __search_pattern(graph) + + # -- Selection Analyzing (1) + rule_triple_list = [] + for pattern in pattern_set: + rule_triple_list += __reify_roles_as_concept( + graph, pattern.originConcept, pattern.relationName, pattern.reificationConcept) + + return rule_label, rule_triple_list + diff --git a/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_7.py b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_7.py new file mode 100644 index 00000000..5f5bcb3c --- /dev/null +++ b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_7.py @@ -0,0 +1,92 @@ +#!/usr/bin/python3.10 +# -*-coding:Utf-8 -* + +#============================================================================== +# TENET: Rule to reclassify existing LK variable to AMR variable +#------------------------------------------------------------------------------ +# Reclassify existing LK variable to AMR variable. +#============================================================================== + +from rdflib import Graph + +import transduction +from transduction import net +from transduction.query_builder import generate_select_query +from transduction.rdfterm_computer import ( produce_uriref, produce_literal ) + + +#============================================================================== +# Pattern Search: leaf{variable, concept} +#============================================================================== + +def __search_pattern(graph): + select_data_list = ['?v', '?vLabel', '?vName'] + clause_list = [f'?c rdfs:subClassOf* amr:AMR_Concept .', + f'?c amr:fromAmrLk ?linkedC.', + f'?v a ?linkedC.', + f'BIND (strafter(str(?v), "#") AS ?vLabel)', + f'OPTIONAL {{ ?v rdfs:label ?vName }}'] + query_code = generate_select_query(graph, select_data_list, clause_list) + result_set = graph.query(query_code) + return query_code, result_set + + + +#============================================================================== +# Construct Method(s) +#============================================================================== + +def __reclassify_existing_variable( + graph, v, vLabel, vName): + + triple_list = [] + + # -- New variable + new_variable_uri = produce_uriref(graph, f'amr:variable_{vLabel}') + relation = produce_uriref(graph, 'rdf:type') + value = produce_uriref(graph, 'amr:AMR_Variable') + triple_list.append((new_variable_uri, relation, value)) + + # -- Label + relation = produce_uriref(graph, 'amr:label') + value = produce_literal(graph, vLabel) + triple_list.append((new_variable_uri, relation, value)) + + # -- AMR-LK trace + relation = produce_uriref(graph, 'amr:fromAmrLk') + triple_list.append((new_variable_uri, relation, v)) + + # -- Name relation + if vName is not None: + relation = produce_uriref(graph, 'amr:name') + value = produce_literal(graph, vName) + triple_list.append((new_variable_uri, relation, value)) + + # -- Classification of the original concept as LinkedData (for tracing) + relation = produce_uriref(graph, 'rdfs:subClassOf') + value = produce_uriref(graph, 'amr:AMR_Linked_Data') + triple_list.append((v, relation, value)) + + return triple_list + + +#============================================================================== +# Main Method +#============================================================================== + +def reclassify_existing_variable(graph): + + # -- Rule Initialization + rule_label = 'reclassify existing variable' + + # -- Search for patterns + _, pattern_set = __search_pattern(graph) + + # -- Selection Analyzing (1) + rule_triple_list = [] + for pattern in pattern_set: + rule_triple_list += __reclassify_existing_variable( + graph, pattern.v, pattern.vLabel, pattern.vName) + + return rule_label, rule_triple_list + diff --git a/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_8.py b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_8.py new file mode 100644 index 00000000..4c6d44dc --- /dev/null +++ b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_8.py @@ -0,0 +1,90 @@ +#!/usr/bin/python3.10 +# -*-coding:Utf-8 -* + +#============================================================================== +# TENET: Rule to add new variable for reified concept +#------------------------------------------------------------------------------ +# Add new variable for reified concept based on the given conditions. +#============================================================================== + +from rdflib import Graph, Literal + +import transduction +from transduction import net +from transduction.query_builder import generate_select_query +from transduction.rdfterm_computer import ( produce_uriref, produce_literal ) + + +#============================================================================== +# Pattern Search: reifiedConcept +#============================================================================== + +def __search_pattern(graph): + select_data_list = ['?originConcept', '?vLetter', '?vLabel'] + clause_list = [f'?reifiedConcept rdfs:subClassOf amr:AMR_Predicat_Concept .', + f'?reifiedConcept amr:isReifiedConcept true .', + f'?reifiedConcept amr:label ?cLabel .', + f'?reifiedConcept amr:fromAmrLk ?originConcept.', + f'BIND (strafter(str(?originConcept), str(ns1:)) AS ?rLabel1) .', + f'BIND (strafter(str(?originConcept), "#") AS ?rLabel2) .', + f'BIND (IF (STRLEN(?rLabel1) > 0, ?rLabel1, ?rLabel2) AS ?rLabel)', + f'BIND (SUBSTR(?rLabel, 1, 1) AS ?vLetter)', + f'BIND (CONCAT(?vLetter, "9") AS ?vLabel).'] + query_code = generate_select_query(graph, select_data_list, clause_list) + result_set = graph.query(query_code) + return query_code, result_set + + + +#============================================================================== +# Construct Method(s) +#============================================================================== + +def __add_new_variable_for_reified_concept(graph, originConcept, vLetter, vLabel): + + triple_list = [] + + new_variable_uri = produce_uriref(graph, f'amr:variable_{vLabel}') + + # -- New variable + relation = produce_uriref(graph, 'rdf:type') + value = produce_uriref(graph, 'amr:AMR_Variable') + triple_list.append((new_variable_uri, relation, value)) + + # -- Reification flag + relation = produce_uriref(graph, 'amr:isReifiedVariable') + value = Literal(True) + triple_list.append((new_variable_uri, relation, value)) + + # -- Label + relation = produce_uriref(graph, 'amr:label') + triple_list.append((new_variable_uri, relation, vLabel)) + + # -- Linking new variable to LK role + relation = produce_uriref(graph, 'rdf:type') + triple_list.append((new_variable_uri, relation, originConcept)) + + return triple_list + + + +#============================================================================== +# Main Method +#============================================================================== + +def add_new_variable_for_reified_concept(graph): + + # -- Rule Initialization + rule_label = 'add new variable for reified concept' + + # -- Search for patterns + _, pattern_set = __search_pattern(graph) + + # -- Selection Analyzing + rule_triple_list = [] + for pattern in pattern_set: + rule_triple_list += __add_new_variable_for_reified_concept( + graph, pattern.originConcept, pattern.vLetter, pattern.vLabel) + + return rule_label, rule_triple_list + diff --git a/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_9.py b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_9.py new file mode 100644 index 00000000..a9c2d7e4 --- /dev/null +++ b/tenet/scheme/amr_clara_rule/preprocessing/amr_reification_9.py @@ -0,0 +1,79 @@ +#!/usr/bin/python3.10 +# -*- coding: Utf-8 -*- + +#============================================================================== +# TENET: Rule to add AMR leaf for reclassified concept +#------------------------------------------------------------------------------ +# Add AMR leaf corresponding to the relation between concept and variable. +#============================================================================== + +from rdflib import Graph + +import transduction +from transduction import net +from transduction.query_builder import generate_select_query +from transduction.rdfterm_computer import ( produce_uriref, produce_literal ) + + +#============================================================================== +# Pattern Search: concept{variable, concept} +#============================================================================== + +def __search_pattern(graph): + select_data_list = ['?concept', '?cLabel', '?variable', '?vLabel'] + clause_list = [f'?concept rdfs:subClassOf* amr:AMR_Concept .', + f'?concept amr:label ?cLabel .', + f'?concept amr:fromAmrLk ?linkedC .', + f'?variable a amr:AMR_Variable .', + f'?variable amr:label ?vLabel .', + f'?variable amr:fromAmrLk ?v .', + f'?v a ?linkedC .'] + query_code = generate_select_query(graph, select_data_list, clause_list) + result_set = graph.query(query_code) + return query_code, result_set + + +#============================================================================== +# Construct Method(s) +#============================================================================== + +def __add_amr_leaf(graph, concept, cLabel, variable, vLabel): + triple_list = [] + + # -- New leaf + new_leaf_uri = produce_uriref(graph, f'amr:leaf_{cLabel}_{vLabel}') + relation = produce_uriref(graph, 'rdf:type') + value = produce_uriref(graph, 'amr:AMR_Leaf') + triple_list.append((new_leaf_uri, relation, value)) + + # -- Relation: hasVariable + relation = produce_uriref(graph, 'amr:hasVariable') + triple_list.append((new_leaf_uri, relation, variable)) + + # -- Relation: hasConcept + relation = produce_uriref(graph, 'amr:hasConcept') + triple_list.append((new_leaf_uri, relation, concept)) + + return triple_list + + +#============================================================================== +# Main Method +#============================================================================== + +def add_amr_leaf_for_reclassified_concept(graph): + + # -- Rule Initialization + rule_label = 'add AMR leaf for reclassified concept' + + # -- Search for patterns + _, pattern_set = __search_pattern(graph) + + # -- Selection Analyzing (1) + rule_triple_list = [] + for pattern in pattern_set: + rule_triple_list += __add_amr_leaf( + graph, pattern.concept, pattern.cLabel, pattern.variable, pattern.vLabel) + + return rule_label, rule_triple_list + diff --git a/tenet/scheme/amr_clara_rule/preprocessing/amrld_correcting.py b/tenet/scheme/amr_clara_rule/preprocessing/amrld_correcting.py deleted file mode 100644 index ae4aac51..00000000 --- a/tenet/scheme/amr_clara_rule/preprocessing/amrld_correcting.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/python3.10 -# -*-coding:Utf-8 -* - -#============================================================================== -# TENET: AMR CTR at 'Data Preprocessing' level -#------------------------------------------------------------------------------ -# Module grouping compositional transduction rule_sets (CTR) for the analysis of -# AMR structures, at 'Data Preprocessing' level -#============================================================================== - -#============================================================================== -# CTR Set (CTR as Sparql querries) -#============================================================================== - -rule_set = {} - - -# --------------------------------------------- -# Fix some bugs with named entities -# --------------------------------------------- - -rule_set['fix-amr-bug-about-system-solar-planet'] = { - 'label': "fix-amr-bug-about-system-solar-planet", - 'comment': "Fix AMR bug about planet named system solar", - 'construction': """ - # -- New concept - ?newC a ns3:NamedEntity ; - rdfs:label ?newLabel. - ?solarSystem a ?newC. - - # -- Tracing original concept as LinkedData and bug - ?c rdfs:subClassOf amr:AMR_Linked_Data. - ?c rdfs:comment 'bug'. - """, - 'clause': """ - # -- Identify bug about planet named system solar - ?c a ns3:NamedEntity. - FILTER ( CONTAINS(str(?c), str(ns4:planet)) ). - ?solarSystem a ?c ; - rdfs:label 'Solar System'. - """, - 'binding':""" - # -- New concept - BIND (str('system') AS ?newLabel). - BIND (CONCAT(str(ns4:), ?newLabel) AS ?n1). - BIND (uri(?n1) AS ?newC). - """ - } - diff --git a/tenet/scheme/amr_master_rule/__rule_pattern.py b/tenet/scheme/amr_master_rule/__rule_pattern.py deleted file mode 100644 index c4a3a882..00000000 --- a/tenet/scheme/amr_master_rule/__rule_pattern.py +++ /dev/null @@ -1,169 +0,0 @@ -#!/usr/bin/python3.10 -# -*-coding:Utf-8 -* - -#============================================================================== -# TENET: Rule to xxx (rule i) [TODO] -#------------------------------------------------------------------------------ -# Net Expansion AMR rule to xxx -# Rule: property(arg0:class, arg1:class) => compositeClass [TODO] -#============================================================================== - -from rdflib import Graph - -import transduction as transduction -from transduction import net -from transduction.query_builder import generate_select_query -from transduction.naming_computer import define_composite_naming_1, define_restriction_naming - - -#============================================================================== -# Select Pattern: property(arg0:class, arg1:class) -#============================================================================== - -def __rule_pattern_query_code(graph): # TODO - select_data_list = ['?property_net', '?class_net_0', '?class_net_1'] - clause_list = [] - clause_list.append(f'?property_net a [rdfs:subClassOf* net:Property_Net].') - clause_list.append(f'FILTER NOT EXISTS {{ ?property_net a net:Deprecated_Net. }}') - clause_list.append(f'?class_net_0 a [rdfs:subClassOf* net:Class_Net].') - clause_list.append(f'FILTER NOT EXISTS {{ ?class_net_0 a net:Deprecated_Net. }}') - clause_list.append(f'?class_net_1 a [rdfs:subClassOf* net:Class_Net].') - clause_list.append(f'FILTER NOT EXISTS {{ ?class_net_1 a net:Deprecated_Net. }}') - clause_list.append(f'?property_net amr:role_ARG0 ?class_net_0.') - clause_list.append(f'?property_net amr:role_ARG1 ?class_net_1.') - query_code = generate_select_query(graph, select_data_list, clause_list) - return query_code - - -def __search_pattern(graph): - query_code = __rule_pattern_query_code(graph) - rule_pattern_set = graph.query(query_code) - return rule_pattern_set - - - -#============================================================================== -# Net Checking -#============================================================================== - -def __verify_disjoint_cover(class_net_0, class_net_1): - check = True - for node in class_net_0.node: - if node in class_net_1.node: check = False - return check - - - -#============================================================================== -# Relation Propagation -#============================================================================== - -def __filter_relation(relation_list): - result_list = [] - for relation in relation_list: - check = True - (s, p, o) = relation - if s == o: check = False - if check: result_list.append(relation) - return result_list - - -def __propagate_relation(target_net, base_net): - # -- target_net.input_relation_list = base_net.input_relation_list - out_relation_list = __filter_relation(base_net.output_relation_list) - target_net.output_relation_list = out_relation_list - - - -#============================================================================== -# Construct Methods: construction of composite class net -#============================================================================== - -def __construct_restriction_net(graph, property_net_1, property_net_2): - - restriction_net = net.RestrictionNet(graph) - restriction_net.compose(property_net_1, property_net_2) - - # -- Data Computation - restriction_net.restriction_property = property_net_1.uri - restriction_net.restriction_net_value = property_net_2.uri - - # -- Relation Propagation: None - - # -- Net Naming - restriction_net.naming = define_restriction_naming(property_net_1, property_net_2) - - # -- Finalization - restriction_net.finalize() - triple_list = restriction_net.generate_triple_definition() - - return restriction_net, triple_list - - - -def __construct_composite_class_net_from_3_nets( - graph, base_class_net, core_property_net, target_class_net): - - # -- Net Composition - composite_class_net = net.CompositePropertyNet(graph) - composite_class_net.compose(base_class_net, core_property_net, target_class_net) - - # -- Data Computation - composite_class_net.mother_class_net = base_class_net.uri - - # -- Restriction Computation - restriction_net, triple_list_1 = __construct_restriction_net(graph, core_property_net, target_class_net) - composite_class_net.restriction = restriction_net.uri - - # -- Relation Propagation - __propagate_relation(composite_class_net, base_class_net) - - # -- Net Naming - composite_class_net.naming = define_composite_naming_1( - base_class_net, core_property_net, target_class_net) - - # -- Finalization - composite_class_net.finalize() - triple_list_2 = composite_class_net.generate_triple_definition() - result_triple_list = triple_list_1 + triple_list_2 - - return composite_class_net, result_triple_list - - - -#============================================================================== -# Main Method -#============================================================================== - -def extract_xxx(graph): # TODO - - # -- Rule Initialization - rule_label = 'extract xxx [ property(arg0:class, arg1:class) ]' - - # -- Search for patterns - rule_pattern_set = __search_pattern(graph) - - # -- Selection Analyzing (1) - rule_triple_list = [] - for selection_1 in rule_pattern_set: - - # -- Net Selection - property_net = net.PropertyNet(graph, uri=selection_1.property_net) - class_net_0 = net.ClassNet(graph, uri=selection_1.class_net_0) - class_net_1 = net.ClassNet(graph, uri=selection_1.class_net_1) - - # -- Condition: disjoint cover - if __verify_disjoint_cover(class_net_0, class_net_1): - - # -- New Net Construction (from 3 nets) - new_class, triple_list = __construct_composite_class_net_from_3_nets( - graph, class_net_0, property_net, class_net_1) - - # -- Resulting List Update - # class_net_list.append(new_class) - rule_triple_list += triple_list - - # -- Deprecation: Origin Class Net - rule_triple_list += class_net_0.deprecate() - - return rule_label, rule_triple_list \ No newline at end of file diff --git a/tenet/scheme/odrl_amr_scheme_1.py b/tenet/scheme/odrl_amr_scheme_1.py index 30929e09..fc6141af 100644 --- a/tenet/scheme/odrl_amr_scheme_1.py +++ b/tenet/scheme/odrl_amr_scheme_1.py @@ -53,56 +53,39 @@ default_refinement_sequence = { 'rule_key_list': [] } -transduction_refinement_sequence = { - 'label': 'transduction-refinement-sequence', - 'comment': 'Refinement Sequence for Transduction Processing', - 'rule_key_list': ['refine-cover-node-1', - 'refine-cover-node-2']#, - #'propagation-relations-to-nets'] - } - # --------------------------------------------- # Preprocessing Sequence(s) # --------------------------------------------- -amrld_correcting_sequence = { - 'label': 'amrld-correcting-sequence', - 'comment': 'correction of AMR-LD data for some known anomalies', - 'rule_key_list': ['fix-amr-bug-about-system-solar-planet'] - } - -amr_reification_sequence = { - 'label': 'amr-reification-sequence', - 'comment': 'AMR reification from AMR-Linked-Data to AMR (tenet) structure', - 'rule_key_list': ['reclassify-concept-1', - 'reclassify-concept-2', - 'reclassify-concept-3', - 'reclassify-concept-4', - 'reclassify-concept-5', - # --old --- 'reclassify-role-1', - # --old --- 'reclassify-role-2', - 'reify-roles-as-concept', - 'reclassify-existing-variable', - 'add-new-variable-for-reified-concept', - 'add-amr-leaf-for-reclassified-concept', - 'add-amr-leaf-for-reified-concept', - 'add-amr-edge-for-core-relation', - 'add-amr-edge-for-reified-concept', - 'add-amr-edge-for-name-relation', - 'add-amr-edge-for-quant-relation', - 'add-amr-edge-for-polarity-relation', - # --old --- 'set-amr-label-for-variables', - # --old --- 'set-amr-label-for-roles', - 'update-amr-edge-role-1', - # --old --- 'update-amr-edge-role-2', - 'add-amr-root'] - } +amr_bug_fixing_sequence = ['Bug fixing for some known anomalies of AMR-LD data', + rule.fix_amr_bug_1 + ] + +amr_reification_sequence = ['AMR reification from AMR-Linked-Data to AMR (tenet) structure', + rule.reclassify_concept_1, + rule.reclassify_concept_2, + rule.reclassify_concept_3, + rule.reclassify_concept_4, + rule.reclassify_concept_5, + rule.reify_roles_as_concept, + rule.reclassify_existing_variable, + rule.add_new_variable_for_reified_concept, + rule.add_amr_leaf_for_reclassified_concept, + rule.add_amr_leaf_for_reified_concept, + rule.add_amr_edge_for_core_relation, + rule.add_amr_edge_for_reified_concept, + rule.add_amr_edge_for_name_relation, + rule.add_amr_edge_for_quant_relation, + rule.add_amr_edge_for_polarity_relation, + rule.update_amr_edge_role_1, + rule.add_amr_root + ] -# # --------------------------------------------- -# # Transduction Sequences -# # --------------------------------------------- +# --------------------------------------------- +# Transduction Sequences +# --------------------------------------------- atomic_extraction_sequence = ['atomic extraction sequence', rule.extract_atom_class, @@ -149,9 +132,9 @@ odrl_extraction_sequence = ['ODRL extraction sequence', ] -# # --------------------------------------------- -# # ODRL Generation -# # --------------------------------------------- +# --------------------------------------------- +# ODRL Generation +# --------------------------------------------- odrl_rule_generation_sequence = ['ODRL Rule Generation Sequence', rule.generate_odrl_rule] @@ -164,19 +147,18 @@ odrl_rule_generation_sequence = ['ODRL Rule Generation Sequence', scheme = { - 'preprocessing': [default_refinement_sequence, - amrld_correcting_sequence, + 'Preprocessing': [default_refinement_sequence, + amr_bug_fixing_sequence, amr_reification_sequence], - 'transduction': [transduction_refinement_sequence, + 'transduction': [default_refinement_sequence, atomic_extraction_sequence, - classification_sequence_1, - phenomena_analyze_sequence_1, - phenomena_analyze_sequence_2, - action_property_extraction_sequence, - composite_class_extraction_sequence, - odrl_extraction_sequence - ], + classification_sequence_1, + phenomena_analyze_sequence_1, + phenomena_analyze_sequence_2, + action_property_extraction_sequence, + composite_class_extraction_sequence, + odrl_extraction_sequence], 'generation': [default_refinement_sequence, odrl_rule_generation_sequence] diff --git a/tenet/scheme/owl_amr_scheme_1.py b/tenet/scheme/owl_amr_scheme_1.py index f586fcf6..4d2feb0c 100644 --- a/tenet/scheme/owl_amr_scheme_1.py +++ b/tenet/scheme/owl_amr_scheme_1.py @@ -150,8 +150,7 @@ scheme = { 'Preprocessing': [default_refinement_sequence, amr_bug_fixing_sequence, - amr_reification_sequence - ], + amr_reification_sequence], 'Transduction': [default_refinement_sequence, atomic_extraction_sequence, diff --git a/tenet/scheme/amr_clara_rule/__rule_pattern.py b/tests/main_tests/__rule_pattern.py similarity index 100% rename from tenet/scheme/amr_clara_rule/__rule_pattern.py rename to tests/main_tests/__rule_pattern.py diff --git a/tests/main_tests/test_odrl_output/aos16-20230619/aos16_factoid.ttl b/tests/main_tests/test_odrl_output/aos16-20230619/aos16_factoid.ttl new file mode 100644 index 00000000..4249e136 --- /dev/null +++ b/tests/main_tests/test_odrl_output/aos16-20230619/aos16_factoid.ttl @@ -0,0 +1,11 @@ +@base <http://https://tenet.tetras-libre.fr/demo/clara/16//factoid> . +@prefix ns1: <http://www.w3.org/ns/odrl/2/> . + +<https://tenet.tetras-libre.fr/extract-result#policy_unknown> ns1:obligation """[ + odrl:target <http://example.com/asset:any.unknown> ; + odrl:assignee <http://example.com/asset:any.you> ; + odrl:action rdf:credit ]""", + """[ + odrl:assignee <http://example.com/asset:any.you> ; + odrl:action cc:Notice ]""" . + diff --git a/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.log b/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.log new file mode 100644 index 00000000..524200b7 --- /dev/null +++ b/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.log @@ -0,0 +1,159 @@ +- INFO - [TENET] Extraction Processing +- INFO - + === Process Initialization === +- INFO - -- Process Setting +- INFO - ----- Corpus source: /home/lamenji/Workspace/Tetras/tenet/tests/main_tests/test_data/amrDocuments/dev/asail_odrl_sentences/s16.stog.amr.ttl (amr) +- INFO - ----- Base output dir: /home/lamenji/Workspace/Tetras/tenet/tests/main_tests/test_odrl_output/aos16-20230619/aos16_factoid.ttl +- INFO - ----- technical dir path: /home/lamenji/Workspace/Tetras/tenet/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/ +- INFO - ----- Ontology target (id): https://tenet.tetras-libre.fr/demo/clara/16/ +- INFO - ----- Current path: /home/lamenji/Workspace/Tetras/tenet/tenet +- DEBUG - ----- Config file: /home/lamenji/Workspace/Tetras/tenet/tenet/odrl_amr_config.xml +- DEBUG - + *** Config (Full Parameters) *** + -- Base Parameters + ----- config file: /home/lamenji/Workspace/Tetras/tenet/tenet/odrl_amr_config.xml + ----- uuid: https://tenet.tetras-libre.fr/demo/clara/16/ + ----- technical base name: tenet.tetras-libre.fr_demo_clara_16 + ----- source corpus: /home/lamenji/Workspace/Tetras/tenet/tests/main_tests/test_data/amrDocuments/dev/asail_odrl_sentences/s16.stog.amr.ttl + ----- target reference: base + ----- process level: sentence + ----- source type: amr + ----- extraction scheme: odrl_amr_scheme_1 + -- Directories + ----- base directory: ./ + ----- structure directory: ./structure/ + ----- CTS directory: ./scheme/ + ----- target frame directory: ./../input/targetFrameStructure/ + ----- input document directory: + ----- base output dir: /home/lamenji/Workspace/Tetras/tenet/tests/main_tests/test_odrl_output/aos16-20230619/aos16_factoid.ttl + ----- output directory: /home/lamenji/Workspace/Tetras/tenet/tests/main_tests/test_odrl_output/aos16-20230619/aos16_factoid.ttltenet.tetras-libre.fr_demo_clara_16-20230619/ + ----- sentence output directory: /home/lamenji/Workspace/Tetras/tenet/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/ + ----- technical dir path: /home/lamenji/Workspace/Tetras/tenet/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/ + -- Config File Definition + ----- schema file: ./structure/amr-rdf-schema.ttl + ----- semantic net file: ./structure/odrl-snet-schema.ttl + ----- config param file: ./structure/config-parameters.ttl + ----- base ontology file: ./structure/base-ontology.ttl + ----- CTS file: ./scheme/odrl_amr_scheme_1.py + -- Useful References for Ontology + ----- base URI: https://tenet.tetras-libre.fr/working + ----- ontology suffix: -ontology.ttl + ----- ontology seed suffix: -ontology-seed.ttl + -- Source File Definition + ----- source sentence file: /home/lamenji/Workspace/Tetras/tenet/tests/main_tests/test_data/amrDocuments/dev/asail_odrl_sentences/s16.stog.amr.ttl**/*.ttl + -- Target File Definition + ----- frame ontology file: ./../input/targetFrameStructure/base-ontology.ttl + ----- frame ontology seed file: ./../input/targetFrameStructure/base-ontology-seed.ttl + -- Output + ----- ontology namespace: https://tenet.tetras-libre.fr/base-ontology/ + ----- output file: /home/lamenji/Workspace/Tetras/tenet/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16.ttl + *** - *** +- INFO - + === Extraction Processing === +- INFO - -- Work Structure Preparation +- DEBUG - --- Graph Initialization +- DEBUG - ----- Configuration Loading +- DEBUG - -------- RDF Schema (320) +- DEBUG - -------- Semantic Net Definition (470) +- DEBUG - -------- Config Parameter Definition (504) +- DEBUG - ----- Frame Ontology Loading +- DEBUG - -------- Base Ontology produced as output (534) +- DEBUG - --- Source Data Import +- DEBUG - ----- Sentence Loading +- DEBUG - -------- /home/lamenji/Workspace/Tetras/tenet/tests/main_tests/test_data/amrDocuments/dev/asail_odrl_sentences/s16.stog.amr.ttl (592) +- DEBUG - --- Export work graph as turtle +- DEBUG - ----- Work graph file: /home/lamenji/Workspace/Tetras/tenet/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16.ttl +- INFO - ----- Sentence (id): asail_odrl_sentences-16 +- INFO - ----- Sentence (text): You must keep intact all copyright notices for the Work and give the Original Author credit. +- INFO - -- Loading Extraction Scheme (odrl_amr_scheme_1) +- DEBUG - ----- Step number: 3 +- INFO - -- Loading Extraction Rules (amr_clara_rule/*) +- DEBUG - ----- Total rule number: 0 +- INFO - -- Step 1: Preprocessing +- INFO - --- Sequence: Bug fixing for some known anomalies of AMR-LD data +- DEBUG - ----- fix AMR bug (1): 0/0 new triple (592, 0:00:00.019815) +- INFO - --- Sequence: AMR reification from AMR-Linked-Data to AMR (tenet) structure +- INFO - ----- reclassify AMR-LD concept (1): 10/10 new triples (602, 0:00:00.082534) +- INFO - ----- reclassify AMR-LD concept (2): 4/4 new triples (606, 0:00:00.032731) +- INFO - ----- reclassify AMR-LD concept (3): 24/24 new triples (630, 0:00:00.025118) +- INFO - ----- reclassify AMR-LD concept (4): 12/12 new triples (642, 0:00:00.037867) +- INFO - ----- reclassify AMR-LD concept (5): 4/4 new triples (646, 0:00:00.023141) +- DEBUG - ----- reify roles as concept: 0/0 new triple (646, 0:00:00.027120) +- INFO - ----- reclassify existing variable: 52/52 new triples (698, 0:00:00.014695) +- DEBUG - ----- add new variable for reified concept: 0/0 new triple (698, 0:00:00.029362) +- INFO - ----- add AMR leaf for reclassified concept: 39/39 new triples (737, 0:00:00.023248) +- DEBUG - ----- add AMR leaf for reified concept: 0/0 new triple (737, 0:00:00.008366) +- INFO - ----- add AMR edge for core relation: 42/42 new triples (779, 0:00:00.083041) +- DEBUG - ----- add AMR edge for reified concept: 0/0 new triple (779, 0:00:00.018270) +- DEBUG - ----- add AMR edge for name relation: 0/0 new triple (779, 0:00:00.014448) +- DEBUG - ----- add AMR edge for quant relation: 0/0 new triple (779, 0:00:00.016405) +- DEBUG - ----- add AMR edge for polarity relation: 0/0 new triple (779, 0:00:00.023287) +- INFO - ----- update AMR edge role 1: 14/14 new triples (793, 0:00:00.072730) +- INFO - ----- add AMR root: 5/5 new triples (798, 0:00:00.009480) +- DEBUG - --- Serializing graph to tenet.tetras-libre.fr_demo_clara_16_Preprocessing +- DEBUG - ----- step: Preprocessing +- DEBUG - ----- id: https://tenet.tetras-libre.fr/demo/clara/16/ +- DEBUG - ----- work_file: /home/lamenji/Workspace/Tetras/tenet/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_Preprocessing.ttl +- DEBUG - ----- base: http://https://tenet.tetras-libre.fr/demo/clara/16//Preprocessing +- INFO - ----- 206 triples extracted during Preprocessing step +- INFO - -- Step 2: transduction +- INFO - --- Sequence: atomic extraction sequence +- INFO - ----- extract atom classes: 24/24 new triples (822, 0:00:00.105268) +- DEBUG - ----- extract atom individuals: 0/0 new triple (822, 0:00:00.015837) +- INFO - ----- extract atomic properties: 86/86 new triples (908, 0:00:00.199945) +- DEBUG - ----- extract atom values: 0/0 new triple (908, 0:00:00.006181) +- INFO - ----- extract atom phenomena: 14/14 new triples (922, 0:00:00.047625) +- INFO - ----- propagate atom relations: 20/56 new triples (942, 0:00:00.808479) +- INFO - --- Sequence: classification sequence (1) +- INFO - ----- classify modality phenomena: 1/5 new triple (943, 0:00:00.029792) +- INFO - ----- reclassify argument property to class: 31/38 new triples (974, 0:00:00.126978) +- INFO - --- Sequence: phenomena analyze sequence (1) +- DEBUG - ----- analyze "polarity" phenomena (1): 0/0 new triple (974, 0:00:00.005813) +- DEBUG - ----- analyze "polarity" phenomena (2): 0/0 new triple (974, 0:00:00.011429) +- DEBUG - ----- analyze "polarity" phenomena (3): 0/0 new triple (974, 0:00:00.010828) +- DEBUG - ----- analyze "polarity" phenomena (4): 0/0 new triple (974, 0:00:00.028704) +- DEBUG - ----- analyze "polarity" phenomena (5): 0/0 new triple (974, 0:00:00.032452) +- INFO - ----- analyze modifier phenomena (mod): 45/54 new triples (1019, 0:00:00.153919) +- DEBUG - ----- classify modality phenomena: 0/10 new triple (1019, 0:00:00.043277) +- INFO - --- Sequence: phenomena analyze sequence (2) +- DEBUG - ----- analyze "or" phenomena (1): 0/0 new triple (1019, 0:00:00.009819) +- DEBUG - ----- analyze "or" phenomena (2): 0/0 new triple (1019, 0:00:00.009356) +- DEBUG - ----- analyze "and" phenomena (1): 0/0 new triple (1019, 0:00:00.009438) +- INFO - ----- analyze "and" phenomena (2): 2/28 new triples (1021, 0:00:00.212900) +- INFO - --- Sequence: action property extraction sequence +- INFO - ----- extract action properties (1): 41/52 new triples (1062, 0:00:00.153848) +- INFO - ----- extract action properties (2): 28/37 new triples (1090, 0:00:00.129904) +- INFO - --- Sequence: composite class extraction sequence +- DEBUG - ----- extract composite classes (1): 0/0 new triple (1090, 0:00:00.029623) +- DEBUG - ----- extract composite classes (2): 0/0 new triple (1090, 0:00:00.023873) +- INFO - --- Sequence: ODRL extraction sequence +- INFO - ----- extract ODRL actions: 31/36 new triples (1121, 0:00:00.169166) +- INFO - ----- extract ODRL rules: 18/52 new triples (1139, 0:00:00.188198) +- DEBUG - --- Serializing graph to tenet.tetras-libre.fr_demo_clara_16_transduction +- DEBUG - ----- step: transduction +- DEBUG - ----- id: https://tenet.tetras-libre.fr/demo/clara/16/ +- DEBUG - ----- work_file: /home/lamenji/Workspace/Tetras/tenet/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_transduction.ttl +- DEBUG - ----- base: http://https://tenet.tetras-libre.fr/demo/clara/16//transduction +- INFO - ----- 341 triples extracted during transduction step +- INFO - -- Step 3: generation +- INFO - --- Sequence: ODRL Rule Generation Sequence +- INFO - ----- generate ODRL rule: 2/2 new triples (1141, 0:00:00.079675) +- DEBUG - --- Serializing graph to tenet.tetras-libre.fr_demo_clara_16_generation +- DEBUG - ----- step: generation +- DEBUG - ----- id: https://tenet.tetras-libre.fr/demo/clara/16/ +- DEBUG - ----- work_file: /home/lamenji/Workspace/Tetras/tenet/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_generation.ttl +- DEBUG - ----- base: http://https://tenet.tetras-libre.fr/demo/clara/16//generation +- INFO - ----- 2 triples extracted during generation step +- DEBUG - --- Serializing graph to factoid file (/home/lamenji/Workspace/Tetras/tenet/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_factoid.ttl) +- DEBUG - ----- Number of factoids: 2 +- DEBUG - ----- Graph base: http://https://tenet.tetras-libre.fr/demo/clara/16//factoid +- INFO - + === Final Ontology Generation === +- INFO - -- Making complete factoid graph by merging the result factoids +- INFO - ----- Total factoid number: 2 +- INFO - -- Serializing graph to factoid string +- INFO - ----- Graph base: http://https://tenet.tetras-libre.fr/demo/clara/16//factoid +- INFO - -- Serializing graph to factoid file +- INFO - ----- Ontology Turtle File: /home/lamenji/Workspace/Tetras/tenet/tests/main_tests/test_odrl_output/aos16-20230619/aos16_factoid.ttl +- INFO - + === Done === diff --git a/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16.ttl b/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16.ttl new file mode 100644 index 00000000..bdbcaeb0 --- /dev/null +++ b/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16.ttl @@ -0,0 +1,830 @@ +@base <https://tenet.tetras-libre.fr/working/https://tenet.tetras-libre.fr/demo/clara/16/> . +@prefix : <https://amr.tetras-libre.fr/rdf/schema#> . +@prefix cprm: <https://tenet.tetras-libre.fr/config/parameters#> . +@prefix net: <https://tenet.tetras-libre.fr/semantic-net#> . +@prefix ns11: <http://amr.isi.edu/frames/ld/v1.2.2/> . +@prefix ns21: <http://amr.isi.edu/rdf/core-amr#> . +@prefix ns3: <http://amr.isi.edu/rdf/amr-terms#> . +@prefix owl: <http://www.w3.org/2002/07/owl#> . +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix sys: <https://tenet.tetras-libre.fr/base-ontology#> . +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . + +ns21:Concept a rdfs:Class, + owl:Class ; + rdfs:label "AMR-Concept" ; + rdfs:subClassOf :AMR_Linked_Data . + +ns21:Role a rdfs:Class, + owl:Class ; + rdfs:label "AMR-Role" ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a3> a ns11:author-01 ; + ns11:author-01.ARG0 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#p> . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#root01> a ns21:AMR ; + ns21:has-id "asail_odrl_sentences-16" ; + ns21:has-sentence "You must keep intact all copyright notices for the Work and give the Original Author credit." ; + ns21:root <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o> . + +<http://amr.isi.edu/amr_data/test-1#root01> ns21:hasID "test-1" ; + ns21:hasSentence "The sun is a star." ; + ns21:root <http://amr.isi.edu/amr_data/test-1#s> . + +<http://amr.isi.edu/amr_data/test-2#root01> ns21:hasID "test-2" ; + ns21:hasSentence "Earth is a planet." ; + ns21:root <http://amr.isi.edu/amr_data/test-2#p> . + +ns11:author-01.ARG0 a ns11:FrameRole . + +ns11:copyright-01.ARG1 a ns11:FrameRole . + +ns11:credit-01.ARG0 a ns11:FrameRole . + +ns11:credit-01.ARG1 a ns11:FrameRole . + +ns11:keep-01.ARG0 a ns11:FrameRole . + +ns11:keep-01.ARG1 a ns11:FrameRole . + +ns11:notice-03.ARG1 a ns11:FrameRole . + +ns11:obligate-01.ARG1 a ns11:FrameRole . + +ns11:obligate-01.ARG2 a ns11:FrameRole . + +ns3:domain a ns21:Role, + owl:AnnotationProperty, + owl:NamedIndividual . + +ns3:mod a ns21:Role . + +ns3:op1 a ns21:Role . + +ns3:op2 a ns21:Role . + +ns21:hasID a owl:AnnotationProperty . + +ns21:hasSentence a owl:AnnotationProperty . + +ns21:root a owl:AnnotationProperty . + +<https://amr.tetras-libre.fr/rdf/schema> a owl:Ontology ; + owl:versionIRI :0.1 . + +:AMR_DataProperty a owl:DatatypeProperty . + +:AMR_Predicat_Concept a owl:Class ; + rdfs:subClassOf :AMR_Concept . + +:AMR_Prep_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +:AMR_Relation_Concept a owl:Class ; + rdfs:subClassOf :AMR_Concept . + +:AMR_Root a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +:AMR_Term_Concept a owl:Class ; + rdfs:subClassOf :AMR_Concept . + +:AMR_Value a owl:Class ; + rdfs:subClassOf :AMR_Element . + +:AMR_Variable a owl:Class ; + rdfs:subClassOf :AMR_Element . + +:fromAmrLkFramerole a owl:AnnotationProperty ; + rdfs:subPropertyOf :fromAmrLk . + +:fromAmrLkRole a owl:AnnotationProperty ; + rdfs:subPropertyOf :fromAmrLk . + +:fromAmrLkRoot a owl:AnnotationProperty ; + rdfs:subPropertyOf :fromAmrLk . + +:getDirectPropertyName a owl:AnnotationProperty ; + rdfs:subPropertyOf :getProperty . + +:getInversePropertyName a owl:AnnotationProperty ; + rdfs:subPropertyOf :getProperty . + +:getPropertyType a owl:AnnotationProperty ; + rdfs:subPropertyOf :getProperty . + +:hasConcept a owl:ObjectProperty ; + rdfs:domain :AMR_Leaf ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasConceptLink a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasLink . + +:hasEdgeLink a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasLink . + +:hasReification a owl:AnnotationProperty ; + rdfs:range xsd:boolean ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasReificationConcept a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasReificationDefinition . + +:hasReificationDomain a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasReificationDefinition . + +:hasReificationRange a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasReificationDefinition . + +:hasRelationName a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasRoleID a owl:ObjectProperty ; + rdfs:domain :AMR_Edge ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasRoleTag a owl:ObjectProperty ; + rdfs:domain :AMR_Edge ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasRolesetID a owl:ObjectProperty ; + rdfs:domain :AMR_Edge ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasRootLeaf a owl:ObjectProperty ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasSentenceID a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasSentenceStatement a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasVariable a owl:ObjectProperty ; + rdfs:domain :AMR_Leaf ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:label a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:phenomena_conjunction_and a owl:Class ; + rdfs:subClassOf :phenomena_conjunction ; + :hasConceptLink "and" ; + :label "conjunction-AND" . + +:phenomena_conjunction_or a owl:Class ; + rdfs:subClassOf :phenomena_conjunction ; + :hasConceptLink "or" ; + :label "conjunction-OR" . + +:phenomena_degree a owl:Class ; + rdfs:subClassOf :AMR_Phenomena ; + :hasConceptLink "have-degree-91" ; + :label "degree" . + +:phenomena_modality_obligation a owl:Class ; + rdfs:subClassOf :phenomena_modality ; + :hasConceptLink "obligate-01" ; + :label "obligation-modality" . + +:phenomena_modality_possible a owl:Class ; + rdfs:subClassOf :phenomena_modality ; + :hasConceptLink "allow-01", + "grant-01", + "likely-01", + "permit-01", + "possible-01" ; + :label "possible-modality" . + +:phenomena_modality_prohibition a owl:Class ; + rdfs:subClassOf :phenomena_modality ; + :hasConceptLink "prohibit-01" ; + :label "prohibition-modality" . + +:relation_domain a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "domain" . + +:relation_manner a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification true ; + :hasReificationConcept "hasManner" ; + :hasReificationDomain "ARG1" ; + :hasReificationRange "ARG2" ; + :hasRelationName "manner" . + +:relation_mod a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "mod" . + +:relation_name a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "name" . + +:relation_part a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification true ; + :hasReificationConcept "hasPart" ; + :hasReificationDomain "ARG1" ; + :hasReificationRange "ARG2" ; + :hasRelationName "part" . + +:relation_polarity a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "polarity" . + +:relation_quant a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "quant" . + +:role_ARG0 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG0" . + +:role_ARG1 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG1" . + +:role_ARG2 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG2" . + +:role_ARG3 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG3" . + +:role_ARG4 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG4" . + +:role_ARG5 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG5" . + +:role_ARG6 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG6" . + +:role_ARG7 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG7" . + +:role_ARG8 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG8" . + +:role_ARG9 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG9" . + +:role_domain a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :hasRelationName "domain" ; + :label "domain" ; + :toReifyAsConcept "domain" ; + :toReifyWithBaseEdge "ARG0" ; + :toReifyWithHeadEdge "ARG1" . + +:role_have-degree-91 a owl:Class ; + rdfs:subClassOf :AMR_Specific_Role ; + :getPropertyType <net:specificProperty> . + +:role_manner a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :getDirectPropertyName "manner" ; + :getPropertyType owl:DataProperty ; + :label "manner" ; + :toReifyAsConcept "manner" ; + :toReifyWithBaseEdge "ARG0" ; + :toReifyWithHeadEdge "ARG1" . + +:role_mod a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :getDirectPropertyName "hasFeature"^^xsd:string ; + :getPropertyType rdfs:subClassOf, + owl:ObjectProperty ; + :label "mod" ; + :toReifyAsConcept "mod" ; + :toReifyWithBaseEdge "ARG0" ; + :toReifyWithHeadEdge "ARG1" . + +:role_name a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :label "name" . + +:role_op1 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op1" . + +:role_op2 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op2" . + +:role_op3 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op3" . + +:role_op4 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op4" . + +:role_op5 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op5" . + +:role_op6 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op6" . + +:role_op7 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op7" . + +:role_op8 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op8" . + +:role_op9 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op9" . + +:role_part a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :getDirectPropertyName "hasPart"^^xsd:string ; + :getInversePropertyName "partOf"^^xsd:string ; + :getPropertyType owl:ObjectProperty ; + :toReifyAsConcept "part" ; + :toReifyWithBaseEdge "ARG0" ; + :toReifyWithHeadEdge "ARG1" . + +:role_polarity a owl:Class ; + rdfs:subClassOf :AMR_Specific_Role ; + :label "polarity" . + +:role_quant a owl:Class ; + rdfs:subClassOf :AMR_Specific_Role ; + :label "quant" . + +:toReifyAsConcept a owl:AnnotationProperty ; + rdfs:subPropertyOf :toReify . + +:toReifyWithBaseEdge a owl:AnnotationProperty ; + rdfs:subPropertyOf :toReify . + +:toReifyWithHeadEdge a owl:AnnotationProperty ; + rdfs:subPropertyOf :toReify . + +<https://tenet.tetras-libre.fr/base-ontology> a owl:Ontology . + +sys:Event a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:Undetermined_Thing a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:fromStructure a owl:AnnotationProperty ; + rdfs:subPropertyOf sys:Out_AnnotationProperty . + +sys:hasDegree a owl:ObjectProperty ; + rdfs:subPropertyOf sys:Out_ObjectProperty . + +sys:hasFeature a owl:ObjectProperty ; + rdfs:subPropertyOf sys:Out_ObjectProperty . + +<https://tenet.tetras-libre.fr/config/parameters> a owl:Ontology . + +cprm:Config_Parameters a owl:Class ; + cprm:baseURI "https://tenet.tetras-libre.fr/" ; + cprm:netURI "https://tenet.tetras-libre.fr/semantic-net#" ; + cprm:newClassRef "new-class#" ; + cprm:newPropertyRef "new-relation#" ; + cprm:objectRef "object_" ; + cprm:targetOntologyURI "https://tenet.tetras-libre.fr/base-ontology/" . + +cprm:baseURI a rdf:Property ; + rdfs:label "Base URI" ; + rdfs:domain cprm:Frame ; + rdfs:range xsd:string ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:netURI a rdf:Property ; + rdfs:label "Net URI" ; + rdfs:domain cprm:Frame ; + rdfs:range xsd:string ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:newClassRef a rdf:Property ; + rdfs:label "Reference for a new class" ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:newPropertyRef a rdf:Property ; + rdfs:label "Reference for a new property" ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:objectRef a rdf:Property ; + rdfs:label "Object Reference" ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:targetOntologyURI a rdf:Property ; + rdfs:label "URI of classes in target ontology" ; + rdfs:domain cprm:Frame ; + rdfs:range xsd:string ; + rdfs:subPropertyOf cprm:configParamProperty . + +<https://tenet.tetras-libre.fr/semantic-net> a owl:Ontology . + +net:Action_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:Action_Property_Net a owl:Class ; + rdfs:subClassOf net:Property_Net . + +net:Atom_Class_Net a owl:Class ; + rdfs:subClassOf net:Class_Net . + +net:Atom_Property_Net a owl:Class ; + rdfs:subClassOf net:Property_Net . + +net:Composite_Class_Net a owl:Class ; + rdfs:subClassOf net:Class_Net . + +net:Composite_Property_Net a owl:Class ; + rdfs:subClassOf net:Property_Net . + +net:Deprecated_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:Feature a owl:Class ; + rdfs:subClassOf net:Net_Structure . + +net:Individual_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:Modality_Phenomena_Net a owl:Class ; + rdfs:subClassOf net:Phenomena_Net . + +net:Relation a owl:Class ; + rdfs:subClassOf net:Net_Structure . + +net:Rule_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:Value_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:abstractionClass a owl:AnnotationProperty ; + rdfs:label "abstraction class" ; + rdfs:subPropertyOf net:objectValue . + +net:atomType a owl:AnnotationProperty ; + rdfs:label "atom type" ; + rdfs:subPropertyOf net:objectType . + +net:entityClass a owl:AnnotationProperty ; + rdfs:label "entity class" ; + rdfs:subPropertyOf net:objectValue . + +net:featureClass a owl:AnnotationProperty ; + rdfs:label "feature class" ; + rdfs:subPropertyOf net:objectValue . + +net:has_atom a owl:AnnotationProperty ; + rdfs:label "has atom" ; + rdfs:subPropertyOf net:has_object . + +net:has_class a owl:AnnotationProperty ; + rdfs:label "is class" ; + rdfs:subPropertyOf net:objectValue . + +net:has_class_name a owl:AnnotationProperty ; + rdfs:subPropertyOf net:has_value . + +net:has_class_uri a owl:AnnotationProperty ; + rdfs:label "class uri" ; + rdfs:subPropertyOf net:objectValue . + +net:has_concept a owl:AnnotationProperty ; + rdfs:label "concept "@fr ; + rdfs:subPropertyOf net:objectValue . + +net:has_entity a owl:AnnotationProperty ; + rdfs:label "has entity" ; + rdfs:subPropertyOf net:has_object . + +net:has_feature a owl:AnnotationProperty ; + rdfs:label "has feature" ; + rdfs:subPropertyOf net:has_object . + +net:has_instance a owl:AnnotationProperty ; + rdfs:label "entity instance" ; + rdfs:subPropertyOf net:objectValue . + +net:has_instance_uri a owl:AnnotationProperty ; + rdfs:label "instance uri" ; + rdfs:subPropertyOf net:objectValue . + +net:has_item a owl:AnnotationProperty ; + rdfs:label "has item" ; + rdfs:subPropertyOf net:has_object . + +net:has_mother_class a owl:AnnotationProperty ; + rdfs:label "has mother class" ; + rdfs:subPropertyOf net:objectValue . + +net:has_mother_class_uri a owl:AnnotationProperty ; + rdfs:label "parent class uri" ; + rdfs:subPropertyOf net:objectValue . + +net:has_node a owl:AnnotationProperty ; + rdfs:label "UNL Node" ; + rdfs:subPropertyOf net:netProperty . + +net:has_parent a owl:AnnotationProperty ; + rdfs:label "has parent" ; + rdfs:subPropertyOf net:has_object . + +net:has_parent_class a owl:AnnotationProperty ; + rdfs:label "parent class" ; + rdfs:subPropertyOf net:objectValue . + +net:has_parent_class_uri a owl:AnnotationProperty ; + rdfs:label "parent class uri" ; + rdfs:subPropertyOf net:objectValue . + +net:has_possible_domain a owl:AnnotationProperty ; + rdfs:label "has possible domain" ; + rdfs:subPropertyOf net:has_object . + +net:has_possible_range a owl:AnnotationProperty ; + rdfs:label "has possible range" ; + rdfs:subPropertyOf net:has_object . + +net:has_relation a owl:AnnotationProperty ; + rdfs:label "has relation" ; + rdfs:subPropertyOf net:has_relation_value . + +net:has_source a owl:AnnotationProperty ; + rdfs:label "has source" ; + rdfs:subPropertyOf net:has_relation_value . + +net:has_structure a owl:AnnotationProperty ; + rdfs:label "Linguistic Structure (in UNL Document)" ; + rdfs:subPropertyOf net:netProperty . + +net:has_target a owl:AnnotationProperty ; + rdfs:label "has target" ; + rdfs:subPropertyOf net:has_relation_value . + +net:inverse_direction a owl:NamedIndividual . + +net:listGuiding a owl:AnnotationProperty ; + rdfs:label "Guiding connector of a list (or, and)" ; + rdfs:subPropertyOf net:objectValue . + +net:modCat1 a owl:AnnotationProperty ; + rdfs:label "Modality Category (level 1)" ; + rdfs:subPropertyOf net:objectValue . + +net:modCat2 a owl:AnnotationProperty ; + rdfs:label "Modality Category (level 2)" ; + rdfs:subPropertyOf net:objectValue . + +net:normal_direction a owl:NamedIndividual . + +net:type a owl:AnnotationProperty ; + rdfs:label "type "@fr ; + rdfs:subPropertyOf net:netProperty . + +net:verbClass a owl:AnnotationProperty ; + rdfs:label "verb class" ; + rdfs:subPropertyOf net:objectValue . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a> a ns21:and ; + ns3:op1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#k> ; + ns3:op2 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c2> . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a2> a ns21:all . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c> a ns11:copyright-01 ; + ns11:copyright-01.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#w> . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c2> a ns11:credit-01 ; + ns11:credit-01.ARG0 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> ; + ns11:credit-01.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#p> . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#ii> a ns3:intact . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#k> a ns11:keep-01 ; + ns11:keep-01.ARG0 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> ; + ns11:keep-01.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#n> . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#n> a ns11:notice-03 ; + ns11:notice-03.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c> ; + ns3:mod <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a2>, + <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#ii> . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o> a ns11:obligate-01 ; + ns11:obligate-01.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> ; + ns11:obligate-01.ARG2 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a> . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o2> a ns3:original . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#w> a ns11:work-01 . + +<http://amr.isi.edu/amr_data/test-1#s> ns3:domain <http://amr.isi.edu/amr_data/test-1#s2> . + +<http://amr.isi.edu/amr_data/test-2#p> rdfs:label "Earth" . + +<http://amr.isi.edu/entity-types#person> a ns21:NamedEntity . + +ns11:author-01 a ns21:Frame . + +ns11:copyright-01 a ns21:Frame . + +ns11:credit-01 a ns21:Frame . + +ns11:keep-01 a ns21:Frame . + +ns11:notice-03 a ns21:Frame . + +ns11:obligate-01 a ns21:Frame . + +ns11:work-01 a ns21:Frame . + +ns3:intact a ns21:Concept . + +ns3:original a ns21:Concept . + +ns3:you a ns21:Concept . + +ns21:AMR a owl:Class ; + rdfs:subClassOf :AMR_Linked_Data . + +ns21:NamedEntity a ns21:Concept, + owl:Class, + owl:NamedIndividual ; + rdfs:label "AMR-EntityType", + "AMR-Term" ; + rdfs:subClassOf :AMR_Linked_Data . + +ns21:all a ns21:Concept . + +ns21:and a ns21:Concept . + +sys:Degree a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:Entity a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:Feature a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:Out_AnnotationProperty a owl:AnnotationProperty . + +net:Phenomena_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:has_value a owl:AnnotationProperty ; + rdfs:subPropertyOf net:netProperty . + +net:objectType a owl:AnnotationProperty ; + rdfs:label "object type" ; + rdfs:subPropertyOf net:objectProperty . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#p> a <http://amr.isi.edu/entity-types#person> ; + ns3:mod <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o2> . + +:AMR_Leaf a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +:hasLink a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:phenomena_conjunction a owl:Class ; + rdfs:subClassOf :AMR_Phenomena ; + :hasConceptLink "contrast-01", + "either", + "neither" ; + :label "conjunction" . + +sys:Out_ObjectProperty a owl:ObjectProperty . + +net:Class_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:objectProperty a owl:AnnotationProperty ; + rdfs:label "object attribute" . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> a ns3:you . + +:AMR_Concept a owl:Class ; + rdfs:subClassOf :AMR_Element . + +:AMR_Edge a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +:AMR_Phenomena a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +:AMR_Specific_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +:fromAmrLk a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:getProperty a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasReificationDefinition a owl:AnnotationProperty ; + rdfs:range rdfs:Literal ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:phenomena_modality a owl:Class ; + rdfs:subClassOf :AMR_Phenomena . + +:toReify a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +net:Net_Structure a owl:Class ; + rdfs:label "Semantic Net Structure" ; + rdfs:comment "A semantic net captures a set of nodes, and associates this set with type(s) and value(s)." . + +net:Property_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:has_relation_value a owl:AnnotationProperty ; + rdfs:label "has relation value" ; + rdfs:subPropertyOf net:has_object . + +:AMR_Element a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +:AMR_NonCore_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +:AMR_Role a owl:Class ; + rdfs:subClassOf :AMR_Element . + +sys:Out_Structure a owl:Class ; + rdfs:label "Output Ontology Structure" . + +net:netProperty a owl:AnnotationProperty ; + rdfs:label "netProperty" . + +:AMR_Linked_Data a owl:Class . + +:AMR_ObjectProperty a owl:ObjectProperty ; + rdfs:subPropertyOf owl:topObjectProperty . + +:AMR_Structure a owl:Class . + +cprm:configParamProperty a rdf:Property ; + rdfs:label "Config Parameter Property" . + +ns21:Frame a ns21:Concept, + owl:Class, + owl:NamedIndividual ; + rdfs:label "AMR-PropBank-Frame" ; + rdfs:subClassOf :AMR_Linked_Data . + +rdf:Property a owl:Class . + +:AMR_Relation a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +net:Net a owl:Class ; + rdfs:subClassOf net:Net_Structure . + +net:has_object a owl:AnnotationProperty ; + rdfs:label "relation" ; + rdfs:subPropertyOf net:netProperty . + +ns11:FrameRole a ns21:Role, + owl:Class, + owl:NamedIndividual ; + rdfs:label "AMR-PropBank-Role" ; + rdfs:subClassOf :AMR_Linked_Data . + +:AMR_Op_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +:AMR_AnnotationProperty a owl:AnnotationProperty . + +:AMR_Core_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +net:objectValue a owl:AnnotationProperty ; + rdfs:label "valuations"@fr ; + rdfs:subPropertyOf net:objectProperty . + +[] a owl:AllDisjointClasses ; + owl:members ( sys:Degree sys:Entity sys:Feature ) . + diff --git a/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_Preprocessing.ttl b/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_Preprocessing.ttl new file mode 100644 index 00000000..bb02a7bd --- /dev/null +++ b/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_Preprocessing.ttl @@ -0,0 +1,1090 @@ +@base <http://https://tenet.tetras-libre.fr/demo/clara/16//Preprocessing> . +@prefix : <https://amr.tetras-libre.fr/rdf/schema#> . +@prefix cprm: <https://tenet.tetras-libre.fr/config/parameters#> . +@prefix net: <https://tenet.tetras-libre.fr/semantic-net#> . +@prefix ns11: <http://amr.isi.edu/frames/ld/v1.2.2/> . +@prefix ns21: <http://amr.isi.edu/rdf/core-amr#> . +@prefix ns3: <http://amr.isi.edu/rdf/amr-terms#> . +@prefix owl: <http://www.w3.org/2002/07/owl#> . +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix sys: <https://tenet.tetras-libre.fr/base-ontology#> . +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . + +ns21:Concept a rdfs:Class, + owl:Class ; + rdfs:label "AMR-Concept" ; + rdfs:subClassOf :AMR_Linked_Data . + +ns21:Role a rdfs:Class, + owl:Class ; + rdfs:label "AMR-Role" ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/test-1#root01> ns21:hasID "test-1" ; + ns21:hasSentence "The sun is a star." ; + ns21:root <http://amr.isi.edu/amr_data/test-1#s> . + +<http://amr.isi.edu/amr_data/test-2#root01> ns21:hasID "test-2" ; + ns21:hasSentence "Earth is a planet." ; + ns21:root <http://amr.isi.edu/amr_data/test-2#p> . + +ns11:author-01.ARG0 a ns11:FrameRole . + +ns11:copyright-01.ARG1 a ns11:FrameRole . + +ns11:credit-01.ARG0 a ns11:FrameRole . + +ns11:credit-01.ARG1 a ns11:FrameRole . + +ns11:keep-01.ARG0 a ns11:FrameRole . + +ns11:keep-01.ARG1 a ns11:FrameRole . + +ns11:notice-03.ARG1 a ns11:FrameRole . + +ns11:obligate-01.ARG1 a ns11:FrameRole . + +ns11:obligate-01.ARG2 a ns11:FrameRole . + +ns3:domain a ns21:Role, + owl:AnnotationProperty, + owl:NamedIndividual . + +ns3:mod a ns21:Role . + +ns3:op1 a ns21:Role . + +ns3:op2 a ns21:Role . + +ns21:hasID a owl:AnnotationProperty . + +ns21:hasSentence a owl:AnnotationProperty . + +ns21:root a owl:AnnotationProperty . + +<https://amr.tetras-libre.fr/rdf/schema> a owl:Ontology ; + owl:versionIRI :0.1 . + +:AMR_DataProperty a owl:DatatypeProperty . + +:AMR_Prep_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +:AMR_Root a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +:edge_a3_p a :AMR_Edge ; + :hasAmrRole :role_ARG0 ; + :hasRoleID "ARG0" . + +:edge_a_c2 a :AMR_Edge ; + :hasAmrRole :role_op2 ; + :hasRoleID "op2" . + +:edge_a_k a :AMR_Edge ; + :hasAmrRole :role_op1 ; + :hasRoleID "op1" . + +:edge_c2_p a :AMR_Edge ; + :hasAmrRole :role_ARG1 ; + :hasRoleID "ARG1" . + +:edge_c2_y a :AMR_Edge ; + :hasAmrRole :role_ARG0 ; + :hasRoleID "ARG0" . + +:edge_c_w a :AMR_Edge ; + :hasAmrRole :role_ARG1 ; + :hasRoleID "ARG1" . + +:edge_k_n a :AMR_Edge ; + :hasAmrRole :role_ARG1 ; + :hasRoleID "ARG1" . + +:edge_k_y a :AMR_Edge ; + :hasAmrRole :role_ARG0 ; + :hasRoleID "ARG0" . + +:edge_n_a2 a :AMR_Edge ; + :hasAmrRole :role_mod ; + :hasRoleID "mod" . + +:edge_n_c a :AMR_Edge ; + :hasAmrRole :role_ARG1 ; + :hasRoleID "ARG1" . + +:edge_n_ii a :AMR_Edge ; + :hasAmrRole :role_mod ; + :hasRoleID "mod" . + +:edge_o_a a :AMR_Edge ; + :hasAmrRole :role_ARG2 ; + :hasRoleID "ARG2" . + +:edge_o_y a :AMR_Edge ; + :hasAmrRole :role_ARG1 ; + :hasRoleID "ARG1" . + +:edge_p_o2 a :AMR_Edge ; + :hasAmrRole :role_mod ; + :hasRoleID "mod" . + +:fromAmrLkFramerole a owl:AnnotationProperty ; + rdfs:subPropertyOf :fromAmrLk . + +:fromAmrLkRole a owl:AnnotationProperty ; + rdfs:subPropertyOf :fromAmrLk . + +:fromAmrLkRoot a owl:AnnotationProperty ; + rdfs:subPropertyOf :fromAmrLk . + +:getDirectPropertyName a owl:AnnotationProperty ; + rdfs:subPropertyOf :getProperty . + +:getInversePropertyName a owl:AnnotationProperty ; + rdfs:subPropertyOf :getProperty . + +:getPropertyType a owl:AnnotationProperty ; + rdfs:subPropertyOf :getProperty . + +:hasConcept a owl:ObjectProperty ; + rdfs:domain :AMR_Leaf ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasConceptLink a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasLink . + +:hasEdgeLink a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasLink . + +:hasReification a owl:AnnotationProperty ; + rdfs:range xsd:boolean ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasReificationConcept a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasReificationDefinition . + +:hasReificationDomain a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasReificationDefinition . + +:hasReificationRange a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasReificationDefinition . + +:hasRelationName a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasRoleID a owl:ObjectProperty ; + rdfs:domain :AMR_Edge ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasRoleTag a owl:ObjectProperty ; + rdfs:domain :AMR_Edge ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasRolesetID a owl:ObjectProperty ; + rdfs:domain :AMR_Edge ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasRootLeaf a owl:ObjectProperty ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasSentenceID a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasSentenceStatement a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasVariable a owl:ObjectProperty ; + rdfs:domain :AMR_Leaf ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:label a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:leaf_author-01_a3 a :AMR_Leaf ; + :edge_a3_p :leaf_person_p ; + :hasConcept :concept_author-01 ; + :hasVariable :variable_a3 . + +:phenomena_conjunction_or a owl:Class ; + rdfs:subClassOf :phenomena_conjunction ; + :hasConceptLink "or" ; + :label "conjunction-OR" . + +:phenomena_degree a owl:Class ; + rdfs:subClassOf :AMR_Phenomena ; + :hasConceptLink "have-degree-91" ; + :label "degree" . + +:phenomena_modality_possible a owl:Class ; + rdfs:subClassOf :phenomena_modality ; + :hasConceptLink "allow-01", + "grant-01", + "likely-01", + "permit-01", + "possible-01" ; + :label "possible-modality" . + +:phenomena_modality_prohibition a owl:Class ; + rdfs:subClassOf :phenomena_modality ; + :hasConceptLink "prohibit-01" ; + :label "prohibition-modality" . + +:relation_domain a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "domain" . + +:relation_manner a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification true ; + :hasReificationConcept "hasManner" ; + :hasReificationDomain "ARG1" ; + :hasReificationRange "ARG2" ; + :hasRelationName "manner" . + +:relation_mod a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "mod" . + +:relation_name a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "name" . + +:relation_part a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification true ; + :hasReificationConcept "hasPart" ; + :hasReificationDomain "ARG1" ; + :hasReificationRange "ARG2" ; + :hasRelationName "part" . + +:relation_polarity a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "polarity" . + +:relation_quant a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "quant" . + +:role_ARG3 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG3" . + +:role_ARG4 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG4" . + +:role_ARG5 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG5" . + +:role_ARG6 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG6" . + +:role_ARG7 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG7" . + +:role_ARG8 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG8" . + +:role_ARG9 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG9" . + +:role_domain a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :hasRelationName "domain" ; + :label "domain" ; + :toReifyAsConcept "domain" ; + :toReifyWithBaseEdge "ARG0" ; + :toReifyWithHeadEdge "ARG1" . + +:role_have-degree-91 a owl:Class ; + rdfs:subClassOf :AMR_Specific_Role ; + :getPropertyType <net:specificProperty> . + +:role_manner a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :getDirectPropertyName "manner" ; + :getPropertyType owl:DataProperty ; + :label "manner" ; + :toReifyAsConcept "manner" ; + :toReifyWithBaseEdge "ARG0" ; + :toReifyWithHeadEdge "ARG1" . + +:role_name a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :label "name" . + +:role_op3 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op3" . + +:role_op4 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op4" . + +:role_op5 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op5" . + +:role_op6 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op6" . + +:role_op7 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op7" . + +:role_op8 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op8" . + +:role_op9 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op9" . + +:role_part a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :getDirectPropertyName "hasPart"^^xsd:string ; + :getInversePropertyName "partOf"^^xsd:string ; + :getPropertyType owl:ObjectProperty ; + :toReifyAsConcept "part" ; + :toReifyWithBaseEdge "ARG0" ; + :toReifyWithHeadEdge "ARG1" . + +:role_polarity a owl:Class ; + rdfs:subClassOf :AMR_Specific_Role ; + :label "polarity" . + +:role_quant a owl:Class ; + rdfs:subClassOf :AMR_Specific_Role ; + :label "quant" . + +:root_asail_odrl_sentences-16 a :AMR_Value ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#root01> ; + :hasRootLeaf :leaf_obligate-01_o ; + :hasSentenceID "asail_odrl_sentences-16" ; + :hasSentenceStatement "You must keep intact all copyright notices for the Work and give the Original Author credit." . + +:toReifyAsConcept a owl:AnnotationProperty ; + rdfs:subPropertyOf :toReify . + +:toReifyWithBaseEdge a owl:AnnotationProperty ; + rdfs:subPropertyOf :toReify . + +:toReifyWithHeadEdge a owl:AnnotationProperty ; + rdfs:subPropertyOf :toReify . + +<https://tenet.tetras-libre.fr/base-ontology> a owl:Ontology . + +sys:Event a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:Undetermined_Thing a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:fromStructure a owl:AnnotationProperty ; + rdfs:subPropertyOf sys:Out_AnnotationProperty . + +sys:hasDegree a owl:ObjectProperty ; + rdfs:subPropertyOf sys:Out_ObjectProperty . + +sys:hasFeature a owl:ObjectProperty ; + rdfs:subPropertyOf sys:Out_ObjectProperty . + +<https://tenet.tetras-libre.fr/config/parameters> a owl:Ontology . + +cprm:Config_Parameters a owl:Class ; + cprm:baseURI "https://tenet.tetras-libre.fr/" ; + cprm:netURI "https://tenet.tetras-libre.fr/semantic-net#" ; + cprm:newClassRef "new-class#" ; + cprm:newPropertyRef "new-relation#" ; + cprm:objectRef "object_" ; + cprm:targetOntologyURI "https://tenet.tetras-libre.fr/base-ontology/" . + +cprm:baseURI a rdf:Property ; + rdfs:label "Base URI" ; + rdfs:domain cprm:Frame ; + rdfs:range xsd:string ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:netURI a rdf:Property ; + rdfs:label "Net URI" ; + rdfs:domain cprm:Frame ; + rdfs:range xsd:string ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:newClassRef a rdf:Property ; + rdfs:label "Reference for a new class" ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:newPropertyRef a rdf:Property ; + rdfs:label "Reference for a new property" ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:objectRef a rdf:Property ; + rdfs:label "Object Reference" ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:targetOntologyURI a rdf:Property ; + rdfs:label "URI of classes in target ontology" ; + rdfs:domain cprm:Frame ; + rdfs:range xsd:string ; + rdfs:subPropertyOf cprm:configParamProperty . + +<https://tenet.tetras-libre.fr/semantic-net> a owl:Ontology . + +net:Action_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:Action_Property_Net a owl:Class ; + rdfs:subClassOf net:Property_Net . + +net:Atom_Class_Net a owl:Class ; + rdfs:subClassOf net:Class_Net . + +net:Atom_Property_Net a owl:Class ; + rdfs:subClassOf net:Property_Net . + +net:Composite_Class_Net a owl:Class ; + rdfs:subClassOf net:Class_Net . + +net:Composite_Property_Net a owl:Class ; + rdfs:subClassOf net:Property_Net . + +net:Deprecated_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:Feature a owl:Class ; + rdfs:subClassOf net:Net_Structure . + +net:Individual_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:Modality_Phenomena_Net a owl:Class ; + rdfs:subClassOf net:Phenomena_Net . + +net:Relation a owl:Class ; + rdfs:subClassOf net:Net_Structure . + +net:Rule_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:Value_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:abstractionClass a owl:AnnotationProperty ; + rdfs:label "abstraction class" ; + rdfs:subPropertyOf net:objectValue . + +net:atomType a owl:AnnotationProperty ; + rdfs:label "atom type" ; + rdfs:subPropertyOf net:objectType . + +net:entityClass a owl:AnnotationProperty ; + rdfs:label "entity class" ; + rdfs:subPropertyOf net:objectValue . + +net:featureClass a owl:AnnotationProperty ; + rdfs:label "feature class" ; + rdfs:subPropertyOf net:objectValue . + +net:has_atom a owl:AnnotationProperty ; + rdfs:label "has atom" ; + rdfs:subPropertyOf net:has_object . + +net:has_class a owl:AnnotationProperty ; + rdfs:label "is class" ; + rdfs:subPropertyOf net:objectValue . + +net:has_class_name a owl:AnnotationProperty ; + rdfs:subPropertyOf net:has_value . + +net:has_class_uri a owl:AnnotationProperty ; + rdfs:label "class uri" ; + rdfs:subPropertyOf net:objectValue . + +net:has_concept a owl:AnnotationProperty ; + rdfs:label "concept "@fr ; + rdfs:subPropertyOf net:objectValue . + +net:has_entity a owl:AnnotationProperty ; + rdfs:label "has entity" ; + rdfs:subPropertyOf net:has_object . + +net:has_feature a owl:AnnotationProperty ; + rdfs:label "has feature" ; + rdfs:subPropertyOf net:has_object . + +net:has_instance a owl:AnnotationProperty ; + rdfs:label "entity instance" ; + rdfs:subPropertyOf net:objectValue . + +net:has_instance_uri a owl:AnnotationProperty ; + rdfs:label "instance uri" ; + rdfs:subPropertyOf net:objectValue . + +net:has_item a owl:AnnotationProperty ; + rdfs:label "has item" ; + rdfs:subPropertyOf net:has_object . + +net:has_mother_class a owl:AnnotationProperty ; + rdfs:label "has mother class" ; + rdfs:subPropertyOf net:objectValue . + +net:has_mother_class_uri a owl:AnnotationProperty ; + rdfs:label "parent class uri" ; + rdfs:subPropertyOf net:objectValue . + +net:has_node a owl:AnnotationProperty ; + rdfs:label "UNL Node" ; + rdfs:subPropertyOf net:netProperty . + +net:has_parent a owl:AnnotationProperty ; + rdfs:label "has parent" ; + rdfs:subPropertyOf net:has_object . + +net:has_parent_class a owl:AnnotationProperty ; + rdfs:label "parent class" ; + rdfs:subPropertyOf net:objectValue . + +net:has_parent_class_uri a owl:AnnotationProperty ; + rdfs:label "parent class uri" ; + rdfs:subPropertyOf net:objectValue . + +net:has_possible_domain a owl:AnnotationProperty ; + rdfs:label "has possible domain" ; + rdfs:subPropertyOf net:has_object . + +net:has_possible_range a owl:AnnotationProperty ; + rdfs:label "has possible range" ; + rdfs:subPropertyOf net:has_object . + +net:has_relation a owl:AnnotationProperty ; + rdfs:label "has relation" ; + rdfs:subPropertyOf net:has_relation_value . + +net:has_source a owl:AnnotationProperty ; + rdfs:label "has source" ; + rdfs:subPropertyOf net:has_relation_value . + +net:has_structure a owl:AnnotationProperty ; + rdfs:label "Linguistic Structure (in UNL Document)" ; + rdfs:subPropertyOf net:netProperty . + +net:has_target a owl:AnnotationProperty ; + rdfs:label "has target" ; + rdfs:subPropertyOf net:has_relation_value . + +net:inverse_direction a owl:NamedIndividual . + +net:listGuiding a owl:AnnotationProperty ; + rdfs:label "Guiding connector of a list (or, and)" ; + rdfs:subPropertyOf net:objectValue . + +net:modCat1 a owl:AnnotationProperty ; + rdfs:label "Modality Category (level 1)" ; + rdfs:subPropertyOf net:objectValue . + +net:modCat2 a owl:AnnotationProperty ; + rdfs:label "Modality Category (level 2)" ; + rdfs:subPropertyOf net:objectValue . + +net:normal_direction a owl:NamedIndividual . + +net:type a owl:AnnotationProperty ; + rdfs:label "type "@fr ; + rdfs:subPropertyOf net:netProperty . + +net:verbClass a owl:AnnotationProperty ; + rdfs:label "verb class" ; + rdfs:subPropertyOf net:objectValue . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a3> a ns11:author-01 ; + ns11:author-01.ARG0 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#p> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#root01> a ns21:AMR ; + ns21:has-id "asail_odrl_sentences-16" ; + ns21:has-sentence "You must keep intact all copyright notices for the Work and give the Original Author credit." ; + ns21:root <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o> . + +<http://amr.isi.edu/amr_data/test-1#s> ns3:domain <http://amr.isi.edu/amr_data/test-1#s2> . + +<http://amr.isi.edu/amr_data/test-2#p> rdfs:label "Earth" . + +ns21:AMR a owl:Class ; + rdfs:subClassOf :AMR_Linked_Data . + +ns21:NamedEntity a ns21:Concept, + owl:Class, + owl:NamedIndividual ; + rdfs:label "AMR-EntityType", + "AMR-Term" ; + rdfs:subClassOf :AMR_Linked_Data . + +:AMR_Value a owl:Class ; + rdfs:subClassOf :AMR_Element . + +:concept_all rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns21:all ; + :label "all" . + +:concept_and rdfs:subClassOf :AMR_Relation_Concept ; + :fromAmrLk ns21:and ; + :hasPhenomenaLink :phenomena_conjunction_and ; + :label "and" . + +:concept_author-01 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:author-01 ; + :label "author-01" . + +:concept_copyright-01 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:copyright-01 ; + :label "copyright-01" . + +:concept_credit-01 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:credit-01 ; + :label "credit-01" . + +:concept_intact rdfs:subClassOf :AMR_Term_Concept ; + :fromAmrLk ns3:intact ; + :label "intact" . + +:concept_keep-01 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:keep-01 ; + :label "keep-01" . + +:concept_notice-03 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:notice-03 ; + :label "notice-03" . + +:concept_obligate-01 rdfs:subClassOf :AMR_Relation_Concept ; + :fromAmrLk ns11:obligate-01 ; + :hasPhenomenaLink :phenomena_modality_obligation ; + :label "obligate-01" . + +:concept_original rdfs:subClassOf :AMR_Term_Concept ; + :fromAmrLk ns3:original ; + :label "original" . + +:concept_person rdfs:subClassOf :AMR_Term_Concept ; + :fromAmrLk <http://amr.isi.edu/entity-types#person> ; + :label "person" . + +:concept_work-01 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:work-01 ; + :label "work-01" . + +:concept_you rdfs:subClassOf :AMR_Term_Concept ; + :fromAmrLk ns3:you ; + :label "you" . + +:leaf_all_a2 a :AMR_Leaf ; + :hasConcept :concept_all ; + :hasVariable :variable_a2 . + +:leaf_and_a a :AMR_Leaf ; + :edge_a_c2 :leaf_credit-01_c2 ; + :edge_a_k :leaf_keep-01_k ; + :hasConcept :concept_and ; + :hasVariable :variable_a . + +:leaf_copyright-01_c a :AMR_Leaf ; + :edge_c_w :leaf_work-01_w ; + :hasConcept :concept_copyright-01 ; + :hasVariable :variable_c . + +:leaf_credit-01_c2 a :AMR_Leaf ; + :edge_c2_p :leaf_person_p ; + :edge_c2_y :leaf_you_y ; + :hasConcept :concept_credit-01 ; + :hasVariable :variable_c2 . + +:leaf_intact_ii a :AMR_Leaf ; + :hasConcept :concept_intact ; + :hasVariable :variable_ii . + +:leaf_keep-01_k a :AMR_Leaf ; + :edge_k_n :leaf_notice-03_n ; + :edge_k_y :leaf_you_y ; + :hasConcept :concept_keep-01 ; + :hasVariable :variable_k . + +:leaf_notice-03_n a :AMR_Leaf ; + :edge_n_a2 :leaf_all_a2 ; + :edge_n_c :leaf_copyright-01_c ; + :edge_n_ii :leaf_intact_ii ; + :hasConcept :concept_notice-03 ; + :hasVariable :variable_n . + +:leaf_obligate-01_o a :AMR_Leaf ; + :edge_o_a :leaf_and_a ; + :edge_o_y :leaf_you_y ; + :hasConcept :concept_obligate-01 ; + :hasVariable :variable_o . + +:leaf_original_o2 a :AMR_Leaf ; + :hasConcept :concept_original ; + :hasVariable :variable_o2 . + +:leaf_work-01_w a :AMR_Leaf ; + :hasConcept :concept_work-01 ; + :hasVariable :variable_w . + +:phenomena_conjunction_and a owl:Class ; + rdfs:subClassOf :phenomena_conjunction ; + :hasConceptLink "and" ; + :label "conjunction-AND" . + +:phenomena_modality_obligation a owl:Class ; + rdfs:subClassOf :phenomena_modality ; + :hasConceptLink "obligate-01" ; + :label "obligation-modality" . + +:role_ARG2 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG2" . + +:role_op1 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op1" . + +:role_op2 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op2" . + +:variable_a a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a> ; + :label "a" . + +:variable_a2 a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a2> ; + :label "a2" . + +:variable_a3 a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a3> ; + :label "a3" . + +:variable_c a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c> ; + :label "c" . + +:variable_c2 a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c2> ; + :label "c2" . + +:variable_ii a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#ii> ; + :label "ii" . + +:variable_k a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#k> ; + :label "k" . + +:variable_n a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#n> ; + :label "n" . + +:variable_o a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o> ; + :label "o" . + +:variable_o2 a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o2> ; + :label "o2" . + +:variable_p a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#p> ; + :label "p" . + +:variable_w a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#w> ; + :label "w" . + +:variable_y a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> ; + :label "y" . + +sys:Degree a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:Entity a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:Feature a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:Out_AnnotationProperty a owl:AnnotationProperty . + +net:Phenomena_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:has_value a owl:AnnotationProperty ; + rdfs:subPropertyOf net:netProperty . + +net:objectType a owl:AnnotationProperty ; + rdfs:label "object type" ; + rdfs:subPropertyOf net:objectProperty . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a> a ns21:and ; + ns3:op1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#k> ; + ns3:op2 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c2> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a2> a ns21:all ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c> a ns11:copyright-01 ; + ns11:copyright-01.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#w> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c2> a ns11:credit-01 ; + ns11:credit-01.ARG0 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> ; + ns11:credit-01.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#p> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#ii> a ns3:intact ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#k> a ns11:keep-01 ; + ns11:keep-01.ARG0 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> ; + ns11:keep-01.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#n> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#n> a ns11:notice-03 ; + ns11:notice-03.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c> ; + ns3:mod <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a2>, + <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#ii> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o> a ns11:obligate-01 ; + ns11:obligate-01.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> ; + ns11:obligate-01.ARG2 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o2> a ns3:original ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#w> a ns11:work-01 ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/entity-types#person> a ns21:NamedEntity ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:author-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:copyright-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:credit-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:keep-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:notice-03 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:obligate-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:work-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns3:intact a ns21:Concept ; + rdfs:subClassOf :AMR_Linked_Data . + +ns3:original a ns21:Concept ; + rdfs:subClassOf :AMR_Linked_Data . + +ns3:you a ns21:Concept ; + rdfs:subClassOf :AMR_Linked_Data . + +ns21:all a ns21:Concept ; + rdfs:subClassOf :AMR_Linked_Data . + +ns21:and a ns21:Concept ; + rdfs:subClassOf :AMR_Linked_Data . + +:AMR_Relation_Concept a owl:Class ; + rdfs:subClassOf :AMR_Concept . + +:hasLink a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:leaf_person_p a :AMR_Leaf ; + :edge_p_o2 :leaf_original_o2 ; + :hasConcept :concept_person ; + :hasVariable :variable_p . + +:phenomena_conjunction a owl:Class ; + rdfs:subClassOf :AMR_Phenomena ; + :hasConceptLink "contrast-01", + "either", + "neither" ; + :label "conjunction" . + +sys:Out_ObjectProperty a owl:ObjectProperty . + +net:Class_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:objectProperty a owl:AnnotationProperty ; + rdfs:label "object attribute" . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#p> a <http://amr.isi.edu/entity-types#person> ; + ns3:mod <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o2> ; + rdfs:subClassOf :AMR_Linked_Data . + +:AMR_Concept a owl:Class ; + rdfs:subClassOf :AMR_Element . + +:AMR_Phenomena a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +:AMR_Specific_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +:fromAmrLk a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:getProperty a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasReificationDefinition a owl:AnnotationProperty ; + rdfs:range rdfs:Literal ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:leaf_you_y a :AMR_Leaf ; + :hasConcept :concept_you ; + :hasVariable :variable_y . + +:phenomena_modality a owl:Class ; + rdfs:subClassOf :AMR_Phenomena . + +:role_ARG0 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG0" . + +:role_mod a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :getDirectPropertyName "hasFeature"^^xsd:string ; + :getPropertyType rdfs:subClassOf, + owl:ObjectProperty ; + :label "mod" ; + :toReifyAsConcept "mod" ; + :toReifyWithBaseEdge "ARG0" ; + :toReifyWithHeadEdge "ARG1" . + +:toReify a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +net:Net_Structure a owl:Class ; + rdfs:label "Semantic Net Structure" ; + rdfs:comment "A semantic net captures a set of nodes, and associates this set with type(s) and value(s)." . + +net:Property_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:has_relation_value a owl:AnnotationProperty ; + rdfs:label "has relation value" ; + rdfs:subPropertyOf net:has_object . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> a ns3:you ; + rdfs:subClassOf :AMR_Linked_Data . + +:AMR_Element a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +:AMR_Term_Concept a owl:Class ; + rdfs:subClassOf :AMR_Concept . + +:AMR_NonCore_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +:AMR_Role a owl:Class ; + rdfs:subClassOf :AMR_Element . + +:role_ARG1 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG1" . + +sys:Out_Structure a owl:Class ; + rdfs:label "Output Ontology Structure" . + +net:netProperty a owl:AnnotationProperty ; + rdfs:label "netProperty" . + +:AMR_ObjectProperty a owl:ObjectProperty ; + rdfs:subPropertyOf owl:topObjectProperty . + +:AMR_Structure a owl:Class . + +cprm:configParamProperty a rdf:Property ; + rdfs:label "Config Parameter Property" . + +ns21:Frame a ns21:Concept, + owl:Class, + owl:NamedIndividual ; + rdfs:label "AMR-PropBank-Frame" ; + rdfs:subClassOf :AMR_Linked_Data . + +rdf:Property a owl:Class . + +:AMR_Predicat_Concept a owl:Class ; + rdfs:subClassOf :AMR_Concept . + +:AMR_Relation a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +net:Net a owl:Class ; + rdfs:subClassOf net:Net_Structure . + +net:has_object a owl:AnnotationProperty ; + rdfs:label "relation" ; + rdfs:subPropertyOf net:netProperty . + +ns11:FrameRole a ns21:Role, + owl:Class, + owl:NamedIndividual ; + rdfs:label "AMR-PropBank-Role" ; + rdfs:subClassOf :AMR_Linked_Data . + +:AMR_Op_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +:AMR_AnnotationProperty a owl:AnnotationProperty . + +:AMR_Core_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +:AMR_Variable a owl:Class ; + rdfs:subClassOf :AMR_Element . + +:AMR_Leaf a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +net:objectValue a owl:AnnotationProperty ; + rdfs:label "valuations"@fr ; + rdfs:subPropertyOf net:objectProperty . + +:AMR_Edge a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +:AMR_Linked_Data a owl:Class . + +[] a owl:AllDisjointClasses ; + owl:members ( sys:Degree sys:Entity sys:Feature ) . + diff --git a/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_factoid.ttl b/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_factoid.ttl new file mode 100644 index 00000000..4249e136 --- /dev/null +++ b/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_factoid.ttl @@ -0,0 +1,11 @@ +@base <http://https://tenet.tetras-libre.fr/demo/clara/16//factoid> . +@prefix ns1: <http://www.w3.org/ns/odrl/2/> . + +<https://tenet.tetras-libre.fr/extract-result#policy_unknown> ns1:obligation """[ + odrl:target <http://example.com/asset:any.unknown> ; + odrl:assignee <http://example.com/asset:any.you> ; + odrl:action rdf:credit ]""", + """[ + odrl:assignee <http://example.com/asset:any.you> ; + odrl:action cc:Notice ]""" . + diff --git a/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_generation.ttl b/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_generation.ttl new file mode 100644 index 00000000..a2c97914 --- /dev/null +++ b/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_generation.ttl @@ -0,0 +1,1466 @@ +@base <http://https://tenet.tetras-libre.fr/demo/clara/16//generation> . +@prefix : <https://amr.tetras-libre.fr/rdf/schema#> . +@prefix cprm: <https://tenet.tetras-libre.fr/config/parameters#> . +@prefix net: <https://tenet.tetras-libre.fr/semantic-net#> . +@prefix ns1: <http://www.w3.org/ns/odrl/2/> . +@prefix ns11: <http://amr.isi.edu/frames/ld/v1.2.2/> . +@prefix ns21: <http://amr.isi.edu/rdf/core-amr#> . +@prefix ns3: <http://amr.isi.edu/rdf/amr-terms#> . +@prefix owl: <http://www.w3.org/2002/07/owl#> . +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix sys: <https://tenet.tetras-libre.fr/base-ontology#> . +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . + +ns21:Concept a rdfs:Class, + owl:Class ; + rdfs:label "AMR-Concept" ; + rdfs:subClassOf :AMR_Linked_Data . + +ns21:Role a rdfs:Class, + owl:Class ; + rdfs:label "AMR-Role" ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/test-1#root01> ns21:hasID "test-1" ; + ns21:hasSentence "The sun is a star." ; + ns21:root <http://amr.isi.edu/amr_data/test-1#s> . + +<http://amr.isi.edu/amr_data/test-2#root01> ns21:hasID "test-2" ; + ns21:hasSentence "Earth is a planet." ; + ns21:root <http://amr.isi.edu/amr_data/test-2#p> . + +ns11:author-01.ARG0 a ns11:FrameRole . + +ns11:copyright-01.ARG1 a ns11:FrameRole . + +ns11:credit-01.ARG0 a ns11:FrameRole . + +ns11:credit-01.ARG1 a ns11:FrameRole . + +ns11:keep-01.ARG0 a ns11:FrameRole . + +ns11:keep-01.ARG1 a ns11:FrameRole . + +ns11:notice-03.ARG1 a ns11:FrameRole . + +ns11:obligate-01.ARG1 a ns11:FrameRole . + +ns11:obligate-01.ARG2 a ns11:FrameRole . + +ns3:domain a ns21:Role, + owl:AnnotationProperty, + owl:NamedIndividual . + +ns3:mod a ns21:Role . + +ns3:op1 a ns21:Role . + +ns3:op2 a ns21:Role . + +ns21:hasID a owl:AnnotationProperty . + +ns21:hasSentence a owl:AnnotationProperty . + +ns21:root a owl:AnnotationProperty . + +<https://amr.tetras-libre.fr/rdf/schema> a owl:Ontology ; + owl:versionIRI :0.1 . + +:AMR_DataProperty a owl:DatatypeProperty . + +:AMR_Prep_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +:AMR_Root a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +:edge_a3_p a :AMR_Edge ; + :hasAmrRole :role_ARG0 ; + :hasRoleID "ARG0" . + +:edge_a_c2 a :AMR_Edge ; + :hasAmrRole :role_op2 ; + :hasRoleID "op2" . + +:edge_a_k a :AMR_Edge ; + :hasAmrRole :role_op1 ; + :hasRoleID "op1" . + +:edge_c2_p a :AMR_Edge ; + :hasAmrRole :role_ARG1 ; + :hasRoleID "ARG1" . + +:edge_c2_y a :AMR_Edge ; + :hasAmrRole :role_ARG0 ; + :hasRoleID "ARG0" . + +:edge_c_w a :AMR_Edge ; + :hasAmrRole :role_ARG1 ; + :hasRoleID "ARG1" . + +:edge_k_n a :AMR_Edge ; + :hasAmrRole :role_ARG1 ; + :hasRoleID "ARG1" . + +:edge_k_y a :AMR_Edge ; + :hasAmrRole :role_ARG0 ; + :hasRoleID "ARG0" . + +:edge_n_a2 a :AMR_Edge ; + :hasAmrRole :role_mod ; + :hasRoleID "mod" . + +:edge_n_c a :AMR_Edge ; + :hasAmrRole :role_ARG1 ; + :hasRoleID "ARG1" . + +:edge_n_ii a :AMR_Edge ; + :hasAmrRole :role_mod ; + :hasRoleID "mod" . + +:edge_o_a a :AMR_Edge ; + :hasAmrRole :role_ARG2 ; + :hasRoleID "ARG2" . + +:edge_o_y a :AMR_Edge ; + :hasAmrRole :role_ARG1 ; + :hasRoleID "ARG1" . + +:edge_p_o2 a :AMR_Edge ; + :hasAmrRole :role_mod ; + :hasRoleID "mod" . + +:fromAmrLkFramerole a owl:AnnotationProperty ; + rdfs:subPropertyOf :fromAmrLk . + +:fromAmrLkRole a owl:AnnotationProperty ; + rdfs:subPropertyOf :fromAmrLk . + +:fromAmrLkRoot a owl:AnnotationProperty ; + rdfs:subPropertyOf :fromAmrLk . + +:getDirectPropertyName a owl:AnnotationProperty ; + rdfs:subPropertyOf :getProperty . + +:getInversePropertyName a owl:AnnotationProperty ; + rdfs:subPropertyOf :getProperty . + +:getPropertyType a owl:AnnotationProperty ; + rdfs:subPropertyOf :getProperty . + +:hasConcept a owl:ObjectProperty ; + rdfs:domain :AMR_Leaf ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasConceptLink a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasLink . + +:hasEdgeLink a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasLink . + +:hasReification a owl:AnnotationProperty ; + rdfs:range xsd:boolean ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasReificationConcept a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasReificationDefinition . + +:hasReificationDomain a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasReificationDefinition . + +:hasReificationRange a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasReificationDefinition . + +:hasRelationName a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasRoleID a owl:ObjectProperty ; + rdfs:domain :AMR_Edge ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasRoleTag a owl:ObjectProperty ; + rdfs:domain :AMR_Edge ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasRolesetID a owl:ObjectProperty ; + rdfs:domain :AMR_Edge ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasRootLeaf a owl:ObjectProperty ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasSentenceID a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasSentenceStatement a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasVariable a owl:ObjectProperty ; + rdfs:domain :AMR_Leaf ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:label a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:phenomena_conjunction_or a owl:Class ; + rdfs:subClassOf :phenomena_conjunction ; + :hasConceptLink "or" ; + :label "conjunction-OR" . + +:phenomena_degree a owl:Class ; + rdfs:subClassOf :AMR_Phenomena ; + :hasConceptLink "have-degree-91" ; + :label "degree" . + +:phenomena_modality_possible a owl:Class ; + rdfs:subClassOf :phenomena_modality ; + :hasConceptLink "allow-01", + "grant-01", + "likely-01", + "permit-01", + "possible-01" ; + :label "possible-modality" . + +:phenomena_modality_prohibition a owl:Class ; + rdfs:subClassOf :phenomena_modality ; + :hasConceptLink "prohibit-01" ; + :label "prohibition-modality" . + +:relation_domain a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "domain" . + +:relation_manner a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification true ; + :hasReificationConcept "hasManner" ; + :hasReificationDomain "ARG1" ; + :hasReificationRange "ARG2" ; + :hasRelationName "manner" . + +:relation_mod a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "mod" . + +:relation_name a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "name" . + +:relation_part a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification true ; + :hasReificationConcept "hasPart" ; + :hasReificationDomain "ARG1" ; + :hasReificationRange "ARG2" ; + :hasRelationName "part" . + +:relation_polarity a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "polarity" . + +:relation_quant a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "quant" . + +:role_ARG3 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG3" . + +:role_ARG4 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG4" . + +:role_ARG5 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG5" . + +:role_ARG6 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG6" . + +:role_ARG7 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG7" . + +:role_ARG8 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG8" . + +:role_ARG9 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG9" . + +:role_domain a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :hasRelationName "domain" ; + :label "domain" ; + :toReifyAsConcept "domain" ; + :toReifyWithBaseEdge "ARG0" ; + :toReifyWithHeadEdge "ARG1" . + +:role_have-degree-91 a owl:Class ; + rdfs:subClassOf :AMR_Specific_Role ; + :getPropertyType <net:specificProperty> . + +:role_manner a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :getDirectPropertyName "manner" ; + :getPropertyType owl:DataProperty ; + :label "manner" ; + :toReifyAsConcept "manner" ; + :toReifyWithBaseEdge "ARG0" ; + :toReifyWithHeadEdge "ARG1" . + +:role_name a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :label "name" . + +:role_op3 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op3" . + +:role_op4 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op4" . + +:role_op5 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op5" . + +:role_op6 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op6" . + +:role_op7 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op7" . + +:role_op8 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op8" . + +:role_op9 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op9" . + +:role_part a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :getDirectPropertyName "hasPart"^^xsd:string ; + :getInversePropertyName "partOf"^^xsd:string ; + :getPropertyType owl:ObjectProperty ; + :toReifyAsConcept "part" ; + :toReifyWithBaseEdge "ARG0" ; + :toReifyWithHeadEdge "ARG1" . + +:role_polarity a owl:Class ; + rdfs:subClassOf :AMR_Specific_Role ; + :label "polarity" . + +:role_quant a owl:Class ; + rdfs:subClassOf :AMR_Specific_Role ; + :label "quant" . + +:root_asail_odrl_sentences-16 a :AMR_Value ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#root01> ; + :hasRootLeaf :leaf_obligate-01_o ; + :hasSentenceID "asail_odrl_sentences-16" ; + :hasSentenceStatement "You must keep intact all copyright notices for the Work and give the Original Author credit." . + +:toReifyAsConcept a owl:AnnotationProperty ; + rdfs:subPropertyOf :toReify . + +:toReifyWithBaseEdge a owl:AnnotationProperty ; + rdfs:subPropertyOf :toReify . + +:toReifyWithHeadEdge a owl:AnnotationProperty ; + rdfs:subPropertyOf :toReify . + +<https://tenet.tetras-libre.fr/base-ontology> a owl:Ontology . + +sys:Event a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:Undetermined_Thing a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:fromStructure a owl:AnnotationProperty ; + rdfs:subPropertyOf sys:Out_AnnotationProperty . + +sys:hasDegree a owl:ObjectProperty ; + rdfs:subPropertyOf sys:Out_ObjectProperty . + +sys:hasFeature a owl:ObjectProperty ; + rdfs:subPropertyOf sys:Out_ObjectProperty . + +<https://tenet.tetras-libre.fr/config/parameters> a owl:Ontology . + +cprm:Config_Parameters a owl:Class ; + cprm:baseURI "https://tenet.tetras-libre.fr/" ; + cprm:netURI "https://tenet.tetras-libre.fr/semantic-net#" ; + cprm:newClassRef "new-class#" ; + cprm:newPropertyRef "new-relation#" ; + cprm:objectRef "object_" ; + cprm:targetOntologyURI "https://tenet.tetras-libre.fr/base-ontology/" . + +cprm:baseURI a rdf:Property ; + rdfs:label "Base URI" ; + rdfs:domain cprm:Frame ; + rdfs:range xsd:string ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:netURI a rdf:Property ; + rdfs:label "Net URI" ; + rdfs:domain cprm:Frame ; + rdfs:range xsd:string ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:newClassRef a rdf:Property ; + rdfs:label "Reference for a new class" ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:newPropertyRef a rdf:Property ; + rdfs:label "Reference for a new property" ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:objectRef a rdf:Property ; + rdfs:label "Object Reference" ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:targetOntologyURI a rdf:Property ; + rdfs:label "URI of classes in target ontology" ; + rdfs:domain cprm:Frame ; + rdfs:range xsd:string ; + rdfs:subPropertyOf cprm:configParamProperty . + +<https://tenet.tetras-libre.fr/extract-result#policy_unknown> ns1:obligation """[ + odrl:target <http://example.com/asset:any.unknown> ; + odrl:assignee <http://example.com/asset:any.you> ; + odrl:action rdf:credit ]""", + """[ + odrl:assignee <http://example.com/asset:any.you> ; + odrl:action cc:Notice ]""" . + +<https://tenet.tetras-libre.fr/semantic-net> a owl:Ontology . + +net:Composite_Property_Net a owl:Class ; + rdfs:subClassOf net:Property_Net . + +net:Feature a owl:Class ; + rdfs:subClassOf net:Net_Structure . + +net:Value_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:abstractionClass a owl:AnnotationProperty ; + rdfs:label "abstraction class" ; + rdfs:subPropertyOf net:objectValue . + +net:atomProperty_author_a3 a net:Atom_Property_Net ; + :role_ARG0 net:atomClass_person_p, + net:compositeClass_original-person_p ; + net:coverBaseNode :leaf_author-01_a3 ; + net:coverNode :leaf_author-01_a3 ; + net:hasNaming "author" ; + net:hasPropertyName "author" ; + net:hasPropertyName01 "authoring" ; + net:hasPropertyName10 "author-by" ; + net:hasPropertyName12 "author-of" ; + net:hasPropertyType owl:ObjectProperty ; + net:hasStructure "unknown" ; + net:isCoreRoleLinked "true" ; + net:targetArgumentNode :leaf_person_p . + +net:atomType a owl:AnnotationProperty ; + rdfs:label "atom type" ; + rdfs:subPropertyOf net:objectType . + +net:entityClass a owl:AnnotationProperty ; + rdfs:label "entity class" ; + rdfs:subPropertyOf net:objectValue . + +net:featureClass a owl:AnnotationProperty ; + rdfs:label "feature class" ; + rdfs:subPropertyOf net:objectValue . + +net:has_atom a owl:AnnotationProperty ; + rdfs:label "has atom" ; + rdfs:subPropertyOf net:has_object . + +net:has_class a owl:AnnotationProperty ; + rdfs:label "is class" ; + rdfs:subPropertyOf net:objectValue . + +net:has_class_name a owl:AnnotationProperty ; + rdfs:subPropertyOf net:has_value . + +net:has_class_uri a owl:AnnotationProperty ; + rdfs:label "class uri" ; + rdfs:subPropertyOf net:objectValue . + +net:has_concept a owl:AnnotationProperty ; + rdfs:label "concept "@fr ; + rdfs:subPropertyOf net:objectValue . + +net:has_entity a owl:AnnotationProperty ; + rdfs:label "has entity" ; + rdfs:subPropertyOf net:has_object . + +net:has_feature a owl:AnnotationProperty ; + rdfs:label "has feature" ; + rdfs:subPropertyOf net:has_object . + +net:has_instance a owl:AnnotationProperty ; + rdfs:label "entity instance" ; + rdfs:subPropertyOf net:objectValue . + +net:has_instance_uri a owl:AnnotationProperty ; + rdfs:label "instance uri" ; + rdfs:subPropertyOf net:objectValue . + +net:has_item a owl:AnnotationProperty ; + rdfs:label "has item" ; + rdfs:subPropertyOf net:has_object . + +net:has_mother_class a owl:AnnotationProperty ; + rdfs:label "has mother class" ; + rdfs:subPropertyOf net:objectValue . + +net:has_mother_class_uri a owl:AnnotationProperty ; + rdfs:label "parent class uri" ; + rdfs:subPropertyOf net:objectValue . + +net:has_node a owl:AnnotationProperty ; + rdfs:label "UNL Node" ; + rdfs:subPropertyOf net:netProperty . + +net:has_parent a owl:AnnotationProperty ; + rdfs:label "has parent" ; + rdfs:subPropertyOf net:has_object . + +net:has_parent_class a owl:AnnotationProperty ; + rdfs:label "parent class" ; + rdfs:subPropertyOf net:objectValue . + +net:has_parent_class_uri a owl:AnnotationProperty ; + rdfs:label "parent class uri" ; + rdfs:subPropertyOf net:objectValue . + +net:has_possible_domain a owl:AnnotationProperty ; + rdfs:label "has possible domain" ; + rdfs:subPropertyOf net:has_object . + +net:has_possible_range a owl:AnnotationProperty ; + rdfs:label "has possible range" ; + rdfs:subPropertyOf net:has_object . + +net:has_relation a owl:AnnotationProperty ; + rdfs:label "has relation" ; + rdfs:subPropertyOf net:has_relation_value . + +net:has_source a owl:AnnotationProperty ; + rdfs:label "has source" ; + rdfs:subPropertyOf net:has_relation_value . + +net:has_structure a owl:AnnotationProperty ; + rdfs:label "Linguistic Structure (in UNL Document)" ; + rdfs:subPropertyOf net:netProperty . + +net:has_target a owl:AnnotationProperty ; + rdfs:label "has target" ; + rdfs:subPropertyOf net:has_relation_value . + +net:individual_intact_ii a net:Individual_Net ; + net:composeFrom net:atomClass_intact_ii ; + net:coverBaseNode :leaf_intact_ii ; + net:coverNode :leaf_intact_ii ; + net:hasBaseClassName "Feature" ; + net:hasIndividualLabel "intact" ; + net:hasMotherClassNet net:atomClass_intact_ii ; + net:hasNaming "intact" ; + net:hasStructure "unknown" . + +net:individual_original_o2 a net:Individual_Net ; + net:composeFrom net:atomClass_original_o2 ; + net:coverBaseNode :leaf_original_o2 ; + net:coverNode :leaf_original_o2 ; + net:hasBaseClassName "Feature" ; + net:hasIndividualLabel "original" ; + net:hasMotherClassNet net:atomClass_original_o2 ; + net:hasNaming "original" ; + net:hasStructure "unknown" . + +net:inverse_direction a owl:NamedIndividual . + +net:listGuiding a owl:AnnotationProperty ; + rdfs:label "Guiding connector of a list (or, and)" ; + rdfs:subPropertyOf net:objectValue . + +net:modCat1 a owl:AnnotationProperty ; + rdfs:label "Modality Category (level 1)" ; + rdfs:subPropertyOf net:objectValue . + +net:modCat2 a owl:AnnotationProperty ; + rdfs:label "Modality Category (level 2)" ; + rdfs:subPropertyOf net:objectValue . + +net:normal_direction a owl:NamedIndividual . + +net:rule_obligation_o a net:Rule_Net ; + net:composeFrom net:action_credit_c2, + net:action_notice_k, + net:phenomena_obligation-modality_o ; + net:coverBaseNode :leaf_obligate-01_o ; + net:coverNode :leaf_credit-01_c2, + :leaf_intact_ii, + :leaf_keep-01_k, + :leaf_notice-03_n, + :leaf_obligate-01_o, + :leaf_original_o2, + :leaf_person_p, + :leaf_you_y ; + net:hasNaming "obligation" ; + net:hasRuleActionURI net:action_credit_c2, + net:action_notice_k ; + net:hasRuleRelationName "obligation" ; + net:hasStructure "unknown" . + +net:type a owl:AnnotationProperty ; + rdfs:label "type "@fr ; + rdfs:subPropertyOf net:netProperty . + +net:verbClass a owl:AnnotationProperty ; + rdfs:label "verb class" ; + rdfs:subPropertyOf net:objectValue . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a3> a ns11:author-01 ; + ns11:author-01.ARG0 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#p> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#root01> a ns21:AMR ; + ns21:has-id "asail_odrl_sentences-16" ; + ns21:has-sentence "You must keep intact all copyright notices for the Work and give the Original Author credit." ; + ns21:root <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o> . + +<http://amr.isi.edu/amr_data/test-1#s> ns3:domain <http://amr.isi.edu/amr_data/test-1#s2> . + +<http://amr.isi.edu/amr_data/test-2#p> rdfs:label "Earth" . + +ns21:AMR a owl:Class ; + rdfs:subClassOf :AMR_Linked_Data . + +ns21:NamedEntity a ns21:Concept, + owl:Class, + owl:NamedIndividual ; + rdfs:label "AMR-EntityType", + "AMR-Term" ; + rdfs:subClassOf :AMR_Linked_Data . + +:AMR_Value a owl:Class ; + rdfs:subClassOf :AMR_Element . + +:concept_all rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns21:all ; + :label "all" . + +:concept_and rdfs:subClassOf :AMR_Relation_Concept ; + :fromAmrLk ns21:and ; + :hasPhenomenaLink :phenomena_conjunction_and ; + :label "and" . + +:concept_author-01 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:author-01 ; + :label "author-01" . + +:concept_copyright-01 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:copyright-01 ; + :label "copyright-01" . + +:concept_credit-01 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:credit-01 ; + :label "credit-01" . + +:concept_intact rdfs:subClassOf :AMR_Term_Concept ; + :fromAmrLk ns3:intact ; + :label "intact" . + +:concept_keep-01 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:keep-01 ; + :label "keep-01" . + +:concept_notice-03 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:notice-03 ; + :label "notice-03" . + +:concept_obligate-01 rdfs:subClassOf :AMR_Relation_Concept ; + :fromAmrLk ns11:obligate-01 ; + :hasPhenomenaLink :phenomena_modality_obligation ; + :label "obligate-01" . + +:concept_original rdfs:subClassOf :AMR_Term_Concept ; + :fromAmrLk ns3:original ; + :label "original" . + +:concept_person rdfs:subClassOf :AMR_Term_Concept ; + :fromAmrLk <http://amr.isi.edu/entity-types#person> ; + :label "person" . + +:concept_work-01 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:work-01 ; + :label "work-01" . + +:concept_you rdfs:subClassOf :AMR_Term_Concept ; + :fromAmrLk ns3:you ; + :label "you" . + +:role_ARG2 a owl:Class, + net:Relation ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG2" . + +:role_op1 a owl:Class, + net:Relation ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op1" . + +:role_op2 a owl:Class, + net:Relation ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op2" . + +:variable_a a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a> ; + :label "a" . + +:variable_a2 a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a2> ; + :label "a2" . + +:variable_a3 a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a3> ; + :label "a3" . + +:variable_c a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c> ; + :label "c" . + +:variable_c2 a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c2> ; + :label "c2" . + +:variable_ii a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#ii> ; + :label "ii" . + +:variable_k a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#k> ; + :label "k" . + +:variable_n a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#n> ; + :label "n" . + +:variable_o a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o> ; + :label "o" . + +:variable_o2 a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o2> ; + :label "o2" . + +:variable_p a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#p> ; + :label "p" . + +:variable_w a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#w> ; + :label "w" . + +:variable_y a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> ; + :label "y" . + +sys:Degree a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:Entity a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:Feature a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:Out_AnnotationProperty a owl:AnnotationProperty . + +net:Modality_Phenomena_Net a owl:Class ; + rdfs:subClassOf net:Phenomena_Net . + +net:Rule_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:atomClass_copyright_c a net:Atom_Class_Net ; + :role_ARG1 net:atomProperty_work_w ; + net:composeFrom net:atomProperty_copyright_c ; + net:coverBaseNode :leaf_copyright-01_c ; + net:coverNode :leaf_copyright-01_c ; + net:hasClassName "copyright" ; + net:hasNaming "copyright" ; + net:hasStructure "unknown" . + +net:atomClass_work_w a net:Atom_Class_Net ; + net:composeFrom net:atomProperty_work_w ; + net:coverBaseNode :leaf_work-01_w ; + net:coverNode :leaf_work-01_w ; + net:hasClassName "work" ; + net:hasNaming "work" ; + net:hasStructure "unknown" . + +net:has_value a owl:AnnotationProperty ; + rdfs:subPropertyOf net:netProperty . + +net:objectType a owl:AnnotationProperty ; + rdfs:label "object type" ; + rdfs:subPropertyOf net:objectProperty . + +net:phenomena_conjunction-AND_a a net:Phenomena_Net ; + :role_op1 net:actionProperty_keep_k, + net:actionProperty_notice_k, + net:action_notice_k, + net:atomProperty_keep_k ; + :role_op2 net:actionProperty_credit_c2, + net:action_credit_c2, + net:atomProperty_credit_c2 ; + net:coverBaseNode :leaf_and_a ; + net:coverNode :leaf_and_a ; + net:hasNaming "conjunction-AND" ; + net:hasPhenomenaRef "and" ; + net:hasPhenomenaType :phenomena_conjunction_and ; + net:hasStructure "unknown" . + +net:phenomena_obligation-modality_o a net:Modality_Phenomena_Net, + net:Phenomena_Net ; + :role_ARG1 net:atomClass_you_y ; + :role_ARG2 net:actionProperty_credit_c2, + net:actionProperty_keep_k, + net:actionProperty_notice_k, + net:action_credit_c2, + net:action_notice_k, + net:atomProperty_credit_c2, + net:atomProperty_keep_k, + net:phenomena_conjunction-AND_a ; + net:coverBaseNode :leaf_obligate-01_o ; + net:coverNode :leaf_obligate-01_o ; + net:hasNaming "obligation-modality" ; + net:hasPhenomenaRef "obligate-01" ; + net:hasPhenomenaType :phenomena_modality_obligation ; + net:hasStructure "unknown" . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a> a ns21:and ; + ns3:op1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#k> ; + ns3:op2 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c2> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a2> a ns21:all ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c> a ns11:copyright-01 ; + ns11:copyright-01.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#w> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c2> a ns11:credit-01 ; + ns11:credit-01.ARG0 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> ; + ns11:credit-01.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#p> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#ii> a ns3:intact ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#k> a ns11:keep-01 ; + ns11:keep-01.ARG0 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> ; + ns11:keep-01.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#n> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#n> a ns11:notice-03 ; + ns11:notice-03.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c> ; + ns3:mod <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a2>, + <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#ii> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o> a ns11:obligate-01 ; + ns11:obligate-01.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> ; + ns11:obligate-01.ARG2 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o2> a ns3:original ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#w> a ns11:work-01 ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/entity-types#person> a ns21:NamedEntity ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:author-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:copyright-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:credit-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:keep-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:notice-03 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:obligate-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:work-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns3:intact a ns21:Concept ; + rdfs:subClassOf :AMR_Linked_Data . + +ns3:original a ns21:Concept ; + rdfs:subClassOf :AMR_Linked_Data . + +ns3:you a ns21:Concept ; + rdfs:subClassOf :AMR_Linked_Data . + +ns21:all a ns21:Concept ; + rdfs:subClassOf :AMR_Linked_Data . + +ns21:and a ns21:Concept ; + rdfs:subClassOf :AMR_Linked_Data . + +:AMR_Relation_Concept a owl:Class ; + rdfs:subClassOf :AMR_Concept . + +:hasLink a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:leaf_author-01_a3 a :AMR_Leaf ; + :edge_a3_p :leaf_person_p ; + :hasConcept :concept_author-01 ; + :hasVariable :variable_a3 . + +:phenomena_conjunction a owl:Class ; + rdfs:subClassOf :AMR_Phenomena ; + :hasConceptLink "contrast-01", + "either", + "neither" ; + :label "conjunction" . + +:phenomena_conjunction_and a owl:Class ; + rdfs:subClassOf :phenomena_conjunction ; + :hasConceptLink "and" ; + :label "conjunction-AND" . + +:phenomena_modality_obligation a owl:Class ; + rdfs:subClassOf :phenomena_modality ; + :hasConceptLink "obligate-01" ; + :label "obligation-modality" . + +sys:Out_ObjectProperty a owl:ObjectProperty . + +net:Action_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:Class_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:Composite_Class_Net a owl:Class ; + rdfs:subClassOf net:Class_Net . + +net:Individual_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:objectProperty a owl:AnnotationProperty ; + rdfs:label "object attribute" . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#p> a <http://amr.isi.edu/entity-types#person> ; + ns3:mod <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o2> ; + rdfs:subClassOf :AMR_Linked_Data . + +:AMR_Concept a owl:Class ; + rdfs:subClassOf :AMR_Element . + +:AMR_Phenomena a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +:AMR_Specific_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +:fromAmrLk a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:getProperty a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasReificationDefinition a owl:AnnotationProperty ; + rdfs:range rdfs:Literal ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:leaf_and_a a :AMR_Leaf ; + :edge_a_c2 :leaf_credit-01_c2 ; + :edge_a_k :leaf_keep-01_k ; + :hasConcept :concept_and ; + :hasVariable :variable_a . + +:phenomena_modality a owl:Class ; + rdfs:subClassOf :AMR_Phenomena . + +:role_ARG0 a owl:Class, + net:Relation ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG0" . + +:role_mod a owl:Class, + net:Relation ; + rdfs:subClassOf :AMR_NonCore_Role ; + :getDirectPropertyName "hasFeature"^^xsd:string ; + :getPropertyType rdfs:subClassOf, + owl:ObjectProperty ; + :label "mod" ; + :toReifyAsConcept "mod" ; + :toReifyWithBaseEdge "ARG0" ; + :toReifyWithHeadEdge "ARG1" . + +:toReify a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +net:Action_Property_Net a owl:Class ; + rdfs:subClassOf net:Property_Net . + +net:Net_Structure a owl:Class ; + rdfs:label "Semantic Net Structure" ; + rdfs:comment "A semantic net captures a set of nodes, and associates this set with type(s) and value(s)." . + +net:Phenomena_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:Property_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:actionProperty_credit_c2 a net:Action_Property_Net ; + :role_ARG0 net:atomClass_you_y ; + :role_ARG1 net:atomClass_person_p, + net:compositeClass_original-person_p ; + net:composeFrom net:atomProperty_credit_c2 ; + net:coverBaseNode :leaf_credit-01_c2 ; + net:coverNode :leaf_credit-01_c2 ; + net:hasNaming "credit" ; + net:hasPropertyName "credit" ; + net:hasPropertyName01 "crediting" ; + net:hasPropertyName10 "credit-by" ; + net:hasPropertyName12 "credit-of" ; + net:hasPropertyType owl:ObjectProperty ; + net:hasStructure "unknown" ; + net:isCoreRoleLinked "true" ; + net:targetArgumentNode :leaf_person_p, + :leaf_you_y . + +net:actionProperty_keep_k a net:Action_Property_Net, + net:Deprecated_Net ; + :role_ARG0 net:atomClass_you_y ; + :role_ARG1 net:atomClass_notice_n, + net:atomProperty_notice_n, + net:compositeClass_intact-notice_n ; + net:composeFrom net:atomProperty_keep_k ; + net:coverBaseNode :leaf_keep-01_k ; + net:coverNode :leaf_keep-01_k ; + net:hasNaming "keep" ; + net:hasPropertyName "keep" ; + net:hasPropertyName01 "keeping" ; + net:hasPropertyName10 "keep-by" ; + net:hasPropertyName12 "keep-of" ; + net:hasPropertyType owl:ObjectProperty ; + net:hasStructure "unknown" ; + net:isCoreRoleLinked "true" ; + net:targetArgumentNode :leaf_notice-03_n, + :leaf_you_y . + +net:atomProperty_credit_c2 a net:Atom_Property_Net, + net:Deprecated_Net ; + :role_ARG0 net:atomClass_you_y ; + :role_ARG1 net:atomClass_person_p, + net:compositeClass_original-person_p ; + net:coverBaseNode :leaf_credit-01_c2 ; + net:coverNode :leaf_credit-01_c2 ; + net:hasNaming "credit" ; + net:hasPropertyName "credit" ; + net:hasPropertyName01 "crediting" ; + net:hasPropertyName10 "credit-by" ; + net:hasPropertyName12 "credit-of" ; + net:hasPropertyType owl:ObjectProperty ; + net:hasStructure "unknown" ; + net:isCoreRoleLinked "true" ; + net:targetArgumentNode :leaf_person_p, + :leaf_you_y . + +net:atomProperty_keep_k a net:Atom_Property_Net, + net:Deprecated_Net ; + :role_ARG0 net:atomClass_you_y ; + :role_ARG1 net:actionProperty_notice_k, + net:action_notice_k, + net:atomClass_notice_n, + net:atomProperty_notice_n, + net:compositeClass_intact-notice_n ; + net:coverBaseNode :leaf_keep-01_k ; + net:coverNode :leaf_keep-01_k ; + net:hasNaming "keep" ; + net:hasPropertyName "keep" ; + net:hasPropertyName01 "keeping" ; + net:hasPropertyName10 "keep-by" ; + net:hasPropertyName12 "keep-of" ; + net:hasPropertyType owl:ObjectProperty ; + net:hasStructure "unknown" ; + net:isCoreRoleLinked "true" ; + net:targetArgumentNode :leaf_notice-03_n, + :leaf_you_y . + +net:atomProperty_work_w a net:Atom_Property_Net, + net:Deprecated_Net ; + net:coverBaseNode :leaf_work-01_w ; + net:coverNode :leaf_work-01_w ; + net:hasNaming "work" ; + net:hasPropertyName "work" ; + net:hasPropertyName01 "working" ; + net:hasPropertyName10 "work-by" ; + net:hasPropertyName12 "work-of" ; + net:hasPropertyType owl:ObjectProperty ; + net:hasStructure "unknown" ; + net:isCoreRoleLinked "true" . + +net:compositeClass_intact-notice_n a net:Composite_Class_Net, + net:Deprecated_Net ; + :role_ARG1 net:atomProperty_copyright_c ; + :role_mod net:atomClass_intact_ii, + net:atomProperty_all_a2 ; + net:composeFrom net:atomClass_intact_ii, + net:atomClass_notice_n ; + net:coverBaseNode :leaf_notice-03_n ; + net:coverNode :leaf_intact_ii, + :leaf_notice-03_n ; + net:hasMotherClassNet net:atomClass_notice_n ; + net:hasNaming "intact-notice" ; + net:hasStructure "unknown" . + +net:has_relation_value a owl:AnnotationProperty ; + rdfs:label "has relation value" ; + rdfs:subPropertyOf net:has_object . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> a ns3:you ; + rdfs:subClassOf :AMR_Linked_Data . + +:AMR_Element a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +:AMR_Term_Concept a owl:Class ; + rdfs:subClassOf :AMR_Concept . + +:leaf_all_a2 a :AMR_Leaf ; + :hasConcept :concept_all ; + :hasVariable :variable_a2 . + +net:actionProperty_notice_k a net:Action_Property_Net ; + :role_ARG0 net:atomClass_you_y ; + :role_ARG1 net:atomClass_notice_n, + net:atomProperty_copyright_c, + net:atomProperty_notice_n ; + :role_mod net:atomClass_intact_ii, + net:atomProperty_all_a2 ; + net:composeFrom net:actionProperty_keep_k, + net:compositeClass_intact-notice_n ; + net:coverBaseNode :leaf_keep-01_k ; + net:coverNode :leaf_intact_ii, + :leaf_keep-01_k, + :leaf_notice-03_n ; + net:hasNaming "notice" ; + net:hasPropertyName "notice" ; + net:hasPropertyName01 "notice" ; + net:hasPropertyName10 "notice" ; + net:hasPropertyName12 "notice" ; + net:hasPropertyType owl:ObjectProperty ; + net:hasStructure "unknown" ; + net:isCoreRoleLinked "true" ; + net:targetArgumentNode :leaf_notice-03_n, + :leaf_you_y . + +net:action_credit_c2 a net:Action_Net ; + net:composeFrom net:actionProperty_credit_c2, + net:atomClass_you_y, + net:compositeClass_original-person_p ; + net:coverBaseNode :leaf_credit-01_c2 ; + net:coverNode :leaf_credit-01_c2, + :leaf_original_o2, + :leaf_person_p, + :leaf_you_y ; + net:hasActionName "credit" ; + net:hasAssigneeClassNet net:atomClass_you_y ; + net:hasNaming "credit" ; + net:hasStructure "unknown" ; + net:hasTargetClassNet net:compositeClass_original-person_p . + +net:atomProperty_all_a2 a net:Atom_Property_Net ; + net:coverBaseNode :leaf_all_a2 ; + net:coverNode :leaf_all_a2 ; + net:hasNaming "all" ; + net:hasPropertyName "all" ; + net:hasPropertyName01 "alling" ; + net:hasPropertyName10 "all-by" ; + net:hasPropertyName12 "all-of" ; + net:hasPropertyType owl:ObjectProperty ; + net:hasStructure "unknown" ; + net:isCoreRoleLinked "true" . + +net:atomProperty_notice_n a net:Atom_Property_Net, + net:Deprecated_Net ; + :role_ARG1 net:atomClass_copyright_c, + net:atomProperty_copyright_c ; + :role_mod net:atomClass_intact_ii, + net:atomProperty_all_a2 ; + net:coverBaseNode :leaf_notice-03_n ; + net:coverNode :leaf_notice-03_n ; + net:hasNaming "notice" ; + net:hasPropertyName "notice" ; + net:hasPropertyName01 "noticeing" ; + net:hasPropertyName10 "notice-by" ; + net:hasPropertyName12 "notice-of" ; + net:hasPropertyType owl:ObjectProperty ; + net:hasStructure "unknown" ; + net:isCoreRoleLinked "true" ; + net:targetArgumentNode :leaf_all_a2, + :leaf_copyright-01_c, + :leaf_intact_ii . + +:AMR_NonCore_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +:AMR_Role a owl:Class ; + rdfs:subClassOf :AMR_Element . + +:leaf_obligate-01_o a :AMR_Leaf ; + :edge_o_a :leaf_and_a ; + :edge_o_y :leaf_you_y ; + :hasConcept :concept_obligate-01 ; + :hasVariable :variable_o . + +:role_ARG1 a owl:Class, + net:Relation ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG1" . + +sys:Out_Structure a owl:Class ; + rdfs:label "Output Ontology Structure" . + +net:action_notice_k a net:Action_Net ; + net:composeFrom net:actionProperty_notice_k, + net:atomClass_you_y ; + net:coverBaseNode :leaf_keep-01_k ; + net:coverNode :leaf_intact_ii, + :leaf_keep-01_k, + :leaf_notice-03_n, + :leaf_you_y ; + net:hasActionName "notice" ; + net:hasAssigneeClassNet net:atomClass_you_y ; + net:hasNaming "notice" ; + net:hasStructure "unknown" . + +net:atomClass_notice_n a net:Atom_Class_Net, + net:Deprecated_Net ; + :role_ARG1 net:atomProperty_copyright_c ; + :role_mod net:atomClass_intact_ii, + net:atomProperty_all_a2 ; + net:composeFrom net:atomProperty_notice_n ; + net:coverBaseNode :leaf_notice-03_n ; + net:coverNode :leaf_notice-03_n ; + net:hasClassName "notice" ; + net:hasNaming "notice" ; + net:hasStructure "unknown" . + +net:atomClass_original_o2 a net:Atom_Class_Net ; + net:coverBaseNode :leaf_original_o2 ; + net:coverNode :leaf_original_o2 ; + net:hasClassName "original" ; + net:hasNaming "original" ; + net:hasStructure "unknown" . + +net:atomClass_person_p a net:Atom_Class_Net, + net:Deprecated_Net ; + :role_mod net:atomClass_original_o2 ; + net:coverBaseNode :leaf_person_p ; + net:coverNode :leaf_person_p ; + net:hasClassName "person" ; + net:hasNaming "person" ; + net:hasStructure "unknown" . + +net:atomProperty_copyright_c a net:Atom_Property_Net, + net:Deprecated_Net ; + :role_ARG1 net:atomClass_work_w, + net:atomProperty_work_w ; + net:coverBaseNode :leaf_copyright-01_c ; + net:coverNode :leaf_copyright-01_c ; + net:hasNaming "copyright" ; + net:hasPropertyName "copyright" ; + net:hasPropertyName01 "copyrighting" ; + net:hasPropertyName10 "copyright-by" ; + net:hasPropertyName12 "copyright-of" ; + net:hasPropertyType owl:ObjectProperty ; + net:hasStructure "unknown" ; + net:isCoreRoleLinked "true" ; + net:targetArgumentNode :leaf_work-01_w . + +net:compositeClass_original-person_p a net:Composite_Class_Net ; + :role_mod net:atomClass_original_o2 ; + net:composeFrom net:atomClass_original_o2, + net:atomClass_person_p ; + net:coverBaseNode :leaf_person_p ; + net:coverNode :leaf_original_o2, + :leaf_person_p ; + net:hasMotherClassNet net:atomClass_person_p ; + net:hasNaming "original-person" ; + net:hasStructure "unknown" . + +net:netProperty a owl:AnnotationProperty ; + rdfs:label "netProperty" . + +:AMR_ObjectProperty a owl:ObjectProperty ; + rdfs:subPropertyOf owl:topObjectProperty . + +:AMR_Structure a owl:Class . + +:leaf_copyright-01_c a :AMR_Leaf ; + :edge_c_w :leaf_work-01_w ; + :hasConcept :concept_copyright-01 ; + :hasVariable :variable_c . + +:leaf_work-01_w a :AMR_Leaf ; + :hasConcept :concept_work-01 ; + :hasVariable :variable_w . + +cprm:configParamProperty a rdf:Property ; + rdfs:label "Config Parameter Property" . + +net:Relation a owl:Class ; + rdfs:subClassOf net:Net_Structure . + +ns21:Frame a ns21:Concept, + owl:Class, + owl:NamedIndividual ; + rdfs:label "AMR-PropBank-Frame" ; + rdfs:subClassOf :AMR_Linked_Data . + +rdf:Property a owl:Class . + +:AMR_Predicat_Concept a owl:Class ; + rdfs:subClassOf :AMR_Concept . + +:AMR_Relation a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +net:Atom_Class_Net a owl:Class ; + rdfs:subClassOf net:Class_Net . + +net:Atom_Property_Net a owl:Class ; + rdfs:subClassOf net:Property_Net . + +net:atomClass_intact_ii a net:Atom_Class_Net ; + net:coverBaseNode :leaf_intact_ii ; + net:coverNode :leaf_intact_ii ; + net:hasClassName "intact" ; + net:hasNaming "intact" ; + net:hasStructure "unknown" . + +:leaf_credit-01_c2 a :AMR_Leaf ; + :edge_c2_p :leaf_person_p ; + :edge_c2_y :leaf_you_y ; + :hasConcept :concept_credit-01 ; + :hasVariable :variable_c2 . + +:leaf_original_o2 a :AMR_Leaf ; + :hasConcept :concept_original ; + :hasVariable :variable_o2 . + +net:Net a owl:Class ; + rdfs:subClassOf net:Net_Structure . + +net:has_object a owl:AnnotationProperty ; + rdfs:label "relation" ; + rdfs:subPropertyOf net:netProperty . + +ns11:FrameRole a ns21:Role, + owl:Class, + owl:NamedIndividual ; + rdfs:label "AMR-PropBank-Role" ; + rdfs:subClassOf :AMR_Linked_Data . + +:AMR_Op_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +net:Deprecated_Net a owl:Class ; + rdfs:subClassOf net:Net . + +:AMR_AnnotationProperty a owl:AnnotationProperty . + +:AMR_Core_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +:leaf_intact_ii a :AMR_Leaf ; + :hasConcept :concept_intact ; + :hasVariable :variable_ii . + +:leaf_keep-01_k a :AMR_Leaf ; + :edge_k_n :leaf_notice-03_n ; + :edge_k_y :leaf_you_y ; + :hasConcept :concept_keep-01 ; + :hasVariable :variable_k . + +net:atomClass_you_y a net:Atom_Class_Net ; + net:coverBaseNode :leaf_you_y ; + net:coverNode :leaf_you_y ; + net:hasClassName "you" ; + net:hasNaming "you" ; + net:hasStructure "unknown" . + +:leaf_person_p a :AMR_Leaf ; + :edge_p_o2 :leaf_original_o2 ; + :hasConcept :concept_person ; + :hasVariable :variable_p . + +:AMR_Variable a owl:Class ; + rdfs:subClassOf :AMR_Element . + +:leaf_notice-03_n a :AMR_Leaf ; + :edge_n_a2 :leaf_all_a2 ; + :edge_n_c :leaf_copyright-01_c ; + :edge_n_ii :leaf_intact_ii ; + :hasConcept :concept_notice-03 ; + :hasVariable :variable_n . + +:leaf_you_y a :AMR_Leaf ; + :hasConcept :concept_you ; + :hasVariable :variable_y . + +:AMR_Leaf a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +net:objectValue a owl:AnnotationProperty ; + rdfs:label "valuations"@fr ; + rdfs:subPropertyOf net:objectProperty . + +:AMR_Edge a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +:AMR_Linked_Data a owl:Class . + +[] a owl:AllDisjointClasses ; + owl:members ( sys:Degree sys:Entity sys:Feature ) . + diff --git a/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_preprocessing.ttl b/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_preprocessing.ttl new file mode 100644 index 00000000..982016c5 --- /dev/null +++ b/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_preprocessing.ttl @@ -0,0 +1,1090 @@ +@base <http://https://tenet.tetras-libre.fr/demo/clara/16//preprocessing> . +@prefix : <https://amr.tetras-libre.fr/rdf/schema#> . +@prefix cprm: <https://tenet.tetras-libre.fr/config/parameters#> . +@prefix net: <https://tenet.tetras-libre.fr/semantic-net#> . +@prefix ns11: <http://amr.isi.edu/frames/ld/v1.2.2/> . +@prefix ns21: <http://amr.isi.edu/rdf/core-amr#> . +@prefix ns3: <http://amr.isi.edu/rdf/amr-terms#> . +@prefix owl: <http://www.w3.org/2002/07/owl#> . +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix sys: <https://tenet.tetras-libre.fr/base-ontology#> . +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . + +ns21:Concept a rdfs:Class, + owl:Class ; + rdfs:label "AMR-Concept" ; + rdfs:subClassOf :AMR_Linked_Data . + +ns21:Role a rdfs:Class, + owl:Class ; + rdfs:label "AMR-Role" ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/test-1#root01> ns21:hasID "test-1" ; + ns21:hasSentence "The sun is a star." ; + ns21:root <http://amr.isi.edu/amr_data/test-1#s> . + +<http://amr.isi.edu/amr_data/test-2#root01> ns21:hasID "test-2" ; + ns21:hasSentence "Earth is a planet." ; + ns21:root <http://amr.isi.edu/amr_data/test-2#p> . + +ns11:author-01.ARG0 a ns11:FrameRole . + +ns11:copyright-01.ARG1 a ns11:FrameRole . + +ns11:credit-01.ARG0 a ns11:FrameRole . + +ns11:credit-01.ARG1 a ns11:FrameRole . + +ns11:keep-01.ARG0 a ns11:FrameRole . + +ns11:keep-01.ARG1 a ns11:FrameRole . + +ns11:notice-03.ARG1 a ns11:FrameRole . + +ns11:obligate-01.ARG1 a ns11:FrameRole . + +ns11:obligate-01.ARG2 a ns11:FrameRole . + +ns3:domain a ns21:Role, + owl:AnnotationProperty, + owl:NamedIndividual . + +ns3:mod a ns21:Role . + +ns3:op1 a ns21:Role . + +ns3:op2 a ns21:Role . + +ns21:hasID a owl:AnnotationProperty . + +ns21:hasSentence a owl:AnnotationProperty . + +ns21:root a owl:AnnotationProperty . + +<https://amr.tetras-libre.fr/rdf/schema> a owl:Ontology ; + owl:versionIRI :0.1 . + +:AMR_DataProperty a owl:DatatypeProperty . + +:AMR_Prep_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +:AMR_Value a owl:Class ; + rdfs:subClassOf :AMR_Element . + +:edge_a3_ARG0_p a :AMR_Edge ; + :hasAmrRole :role_ARG0 ; + :hasRoleID "ARG0" . + +:edge_a_op1_k a :AMR_Edge ; + :hasAmrRole :role_op1 ; + :hasRoleID "op1" . + +:edge_a_op2_c2 a :AMR_Edge ; + :hasAmrRole :role_op2 ; + :hasRoleID "op2" . + +:edge_c2_ARG0_y a :AMR_Edge ; + :hasAmrRole :role_ARG0 ; + :hasRoleID "ARG0" . + +:edge_c2_ARG1_p a :AMR_Edge ; + :hasAmrRole :role_ARG1 ; + :hasRoleID "ARG1" . + +:edge_c_ARG1_w a :AMR_Edge ; + :hasAmrRole :role_ARG1 ; + :hasRoleID "ARG1" . + +:edge_k_ARG0_y a :AMR_Edge ; + :hasAmrRole :role_ARG0 ; + :hasRoleID "ARG0" . + +:edge_k_ARG1_n a :AMR_Edge ; + :hasAmrRole :role_ARG1 ; + :hasRoleID "ARG1" . + +:edge_n_ARG1_c a :AMR_Edge ; + :hasAmrRole :role_ARG1 ; + :hasRoleID "ARG1" . + +:edge_n_mod_a2 a :AMR_Edge ; + :hasAmrRole :role_mod ; + :hasRoleID "mod" . + +:edge_n_mod_ii a :AMR_Edge ; + :hasAmrRole :role_mod ; + :hasRoleID "mod" . + +:edge_o_ARG1_y a :AMR_Edge ; + :hasAmrRole :role_ARG1 ; + :hasRoleID "ARG1" . + +:edge_o_ARG2_a a :AMR_Edge ; + :hasAmrRole :role_ARG2 ; + :hasRoleID "ARG2" . + +:edge_p_mod_o2 a :AMR_Edge ; + :hasAmrRole :role_mod ; + :hasRoleID "mod" . + +:fromAmrLkFramerole a owl:AnnotationProperty ; + rdfs:subPropertyOf :fromAmrLk . + +:fromAmrLkRole a owl:AnnotationProperty ; + rdfs:subPropertyOf :fromAmrLk . + +:fromAmrLkRoot a owl:AnnotationProperty ; + rdfs:subPropertyOf :fromAmrLk . + +:getDirectPropertyName a owl:AnnotationProperty ; + rdfs:subPropertyOf :getProperty . + +:getInversePropertyName a owl:AnnotationProperty ; + rdfs:subPropertyOf :getProperty . + +:getPropertyType a owl:AnnotationProperty ; + rdfs:subPropertyOf :getProperty . + +:hasConcept a owl:ObjectProperty ; + rdfs:domain :AMR_Leaf ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasConceptLink a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasLink . + +:hasEdgeLink a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasLink . + +:hasReification a owl:AnnotationProperty ; + rdfs:range xsd:boolean ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasReificationConcept a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasReificationDefinition . + +:hasReificationDomain a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasReificationDefinition . + +:hasReificationRange a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasReificationDefinition . + +:hasRelationName a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasRoleID a owl:ObjectProperty ; + rdfs:domain :AMR_Edge ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasRoleTag a owl:ObjectProperty ; + rdfs:domain :AMR_Edge ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasRolesetID a owl:ObjectProperty ; + rdfs:domain :AMR_Edge ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasRootLeaf a owl:ObjectProperty ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasSentenceID a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasSentenceStatement a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasVariable a owl:ObjectProperty ; + rdfs:domain :AMR_Leaf ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:label a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:leaf_author-01_a3 a :AMR_Leaf ; + :edge_a3_ARG0_p :leaf_person_p ; + :hasConcept :concept_author-01 ; + :hasVariable :variable_a3 . + +:phenomena_conjunction_or a owl:Class ; + rdfs:subClassOf :phenomena_conjunction ; + :hasConceptLink "or" ; + :label "conjunction-OR" . + +:phenomena_degree a owl:Class ; + rdfs:subClassOf :AMR_Phenomena ; + :hasConceptLink "have-degree-91" ; + :label "degree" . + +:phenomena_modality_possible a owl:Class ; + rdfs:subClassOf :phenomena_modality ; + :hasConceptLink "allow-01", + "grant-01", + "likely-01", + "permit-01", + "possible-01" ; + :label "possible-modality" . + +:phenomena_modality_prohibition a owl:Class ; + rdfs:subClassOf :phenomena_modality ; + :hasConceptLink "prohibit-01" ; + :label "prohibition-modality" . + +:relation_domain a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "domain" . + +:relation_manner a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification true ; + :hasReificationConcept "hasManner" ; + :hasReificationDomain "ARG1" ; + :hasReificationRange "ARG2" ; + :hasRelationName "manner" . + +:relation_mod a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "mod" . + +:relation_name a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "name" . + +:relation_part a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification true ; + :hasReificationConcept "hasPart" ; + :hasReificationDomain "ARG1" ; + :hasReificationRange "ARG2" ; + :hasRelationName "part" . + +:relation_polarity a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "polarity" . + +:relation_quant a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "quant" . + +:role_ARG3 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG3" . + +:role_ARG4 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG4" . + +:role_ARG5 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG5" . + +:role_ARG6 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG6" . + +:role_ARG7 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG7" . + +:role_ARG8 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG8" . + +:role_ARG9 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG9" . + +:role_domain a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :hasRelationName "domain" ; + :label "domain" ; + :toReifyAsConcept "domain" ; + :toReifyWithBaseEdge "ARG0" ; + :toReifyWithHeadEdge "ARG1" . + +:role_have-degree-91 a owl:Class ; + rdfs:subClassOf :AMR_Specific_Role ; + :getPropertyType <net:specificProperty> . + +:role_manner a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :getDirectPropertyName "manner" ; + :getPropertyType owl:DataProperty ; + :label "manner" ; + :toReifyAsConcept "manner" ; + :toReifyWithBaseEdge "ARG0" ; + :toReifyWithHeadEdge "ARG1" . + +:role_name a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :label "name" . + +:role_op3 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op3" . + +:role_op4 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op4" . + +:role_op5 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op5" . + +:role_op6 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op6" . + +:role_op7 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op7" . + +:role_op8 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op8" . + +:role_op9 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op9" . + +:role_part a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :getDirectPropertyName "hasPart"^^xsd:string ; + :getInversePropertyName "partOf"^^xsd:string ; + :getPropertyType owl:ObjectProperty ; + :toReifyAsConcept "part" ; + :toReifyWithBaseEdge "ARG0" ; + :toReifyWithHeadEdge "ARG1" . + +:role_polarity a owl:Class ; + rdfs:subClassOf :AMR_Specific_Role ; + :label "polarity" . + +:role_quant a owl:Class ; + rdfs:subClassOf :AMR_Specific_Role ; + :label "quant" . + +:root_asail_odrl_sentences-16 a :AMR_Root ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#root01> ; + :hasRootLeaf :leaf_obligate-01_o ; + :hasSentenceID "asail_odrl_sentences-16" ; + :hasSentenceStatement "You must keep intact all copyright notices for the Work and give the Original Author credit." . + +:toReifyAsConcept a owl:AnnotationProperty ; + rdfs:subPropertyOf :toReify . + +:toReifyWithBaseEdge a owl:AnnotationProperty ; + rdfs:subPropertyOf :toReify . + +:toReifyWithHeadEdge a owl:AnnotationProperty ; + rdfs:subPropertyOf :toReify . + +<https://tenet.tetras-libre.fr/base-ontology> a owl:Ontology . + +sys:Event a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:Undetermined_Thing a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:fromStructure a owl:AnnotationProperty ; + rdfs:subPropertyOf sys:Out_AnnotationProperty . + +sys:hasDegree a owl:ObjectProperty ; + rdfs:subPropertyOf sys:Out_ObjectProperty . + +sys:hasFeature a owl:ObjectProperty ; + rdfs:subPropertyOf sys:Out_ObjectProperty . + +<https://tenet.tetras-libre.fr/config/parameters> a owl:Ontology . + +cprm:Config_Parameters a owl:Class ; + cprm:baseURI "https://tenet.tetras-libre.fr/" ; + cprm:netURI "https://tenet.tetras-libre.fr/semantic-net#" ; + cprm:newClassRef "new-class#" ; + cprm:newPropertyRef "new-relation#" ; + cprm:objectRef "object_" ; + cprm:targetOntologyURI "https://tenet.tetras-libre.fr/base-ontology/" . + +cprm:baseURI a rdf:Property ; + rdfs:label "Base URI" ; + rdfs:domain cprm:Frame ; + rdfs:range xsd:string ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:netURI a rdf:Property ; + rdfs:label "Net URI" ; + rdfs:domain cprm:Frame ; + rdfs:range xsd:string ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:newClassRef a rdf:Property ; + rdfs:label "Reference for a new class" ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:newPropertyRef a rdf:Property ; + rdfs:label "Reference for a new property" ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:objectRef a rdf:Property ; + rdfs:label "Object Reference" ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:targetOntologyURI a rdf:Property ; + rdfs:label "URI of classes in target ontology" ; + rdfs:domain cprm:Frame ; + rdfs:range xsd:string ; + rdfs:subPropertyOf cprm:configParamProperty . + +<https://tenet.tetras-libre.fr/semantic-net> a owl:Ontology . + +net:Action_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:Action_Property_Net a owl:Class ; + rdfs:subClassOf net:Property_Net . + +net:Atom_Class_Net a owl:Class ; + rdfs:subClassOf net:Class_Net . + +net:Atom_Property_Net a owl:Class ; + rdfs:subClassOf net:Property_Net . + +net:Composite_Class_Net a owl:Class ; + rdfs:subClassOf net:Class_Net . + +net:Composite_Property_Net a owl:Class ; + rdfs:subClassOf net:Property_Net . + +net:Deprecated_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:Feature a owl:Class ; + rdfs:subClassOf net:Net_Structure . + +net:Individual_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:Modality_Phenomena_Net a owl:Class ; + rdfs:subClassOf net:Phenomena_Net . + +net:Relation a owl:Class ; + rdfs:subClassOf net:Net_Structure . + +net:Rule_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:Value_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:abstractionClass a owl:AnnotationProperty ; + rdfs:label "abstraction class" ; + rdfs:subPropertyOf net:objectValue . + +net:atomType a owl:AnnotationProperty ; + rdfs:label "atom type" ; + rdfs:subPropertyOf net:objectType . + +net:entityClass a owl:AnnotationProperty ; + rdfs:label "entity class" ; + rdfs:subPropertyOf net:objectValue . + +net:featureClass a owl:AnnotationProperty ; + rdfs:label "feature class" ; + rdfs:subPropertyOf net:objectValue . + +net:has_atom a owl:AnnotationProperty ; + rdfs:label "has atom" ; + rdfs:subPropertyOf net:has_object . + +net:has_class a owl:AnnotationProperty ; + rdfs:label "is class" ; + rdfs:subPropertyOf net:objectValue . + +net:has_class_name a owl:AnnotationProperty ; + rdfs:subPropertyOf net:has_value . + +net:has_class_uri a owl:AnnotationProperty ; + rdfs:label "class uri" ; + rdfs:subPropertyOf net:objectValue . + +net:has_concept a owl:AnnotationProperty ; + rdfs:label "concept "@fr ; + rdfs:subPropertyOf net:objectValue . + +net:has_entity a owl:AnnotationProperty ; + rdfs:label "has entity" ; + rdfs:subPropertyOf net:has_object . + +net:has_feature a owl:AnnotationProperty ; + rdfs:label "has feature" ; + rdfs:subPropertyOf net:has_object . + +net:has_instance a owl:AnnotationProperty ; + rdfs:label "entity instance" ; + rdfs:subPropertyOf net:objectValue . + +net:has_instance_uri a owl:AnnotationProperty ; + rdfs:label "instance uri" ; + rdfs:subPropertyOf net:objectValue . + +net:has_item a owl:AnnotationProperty ; + rdfs:label "has item" ; + rdfs:subPropertyOf net:has_object . + +net:has_mother_class a owl:AnnotationProperty ; + rdfs:label "has mother class" ; + rdfs:subPropertyOf net:objectValue . + +net:has_mother_class_uri a owl:AnnotationProperty ; + rdfs:label "parent class uri" ; + rdfs:subPropertyOf net:objectValue . + +net:has_node a owl:AnnotationProperty ; + rdfs:label "UNL Node" ; + rdfs:subPropertyOf net:netProperty . + +net:has_parent a owl:AnnotationProperty ; + rdfs:label "has parent" ; + rdfs:subPropertyOf net:has_object . + +net:has_parent_class a owl:AnnotationProperty ; + rdfs:label "parent class" ; + rdfs:subPropertyOf net:objectValue . + +net:has_parent_class_uri a owl:AnnotationProperty ; + rdfs:label "parent class uri" ; + rdfs:subPropertyOf net:objectValue . + +net:has_possible_domain a owl:AnnotationProperty ; + rdfs:label "has possible domain" ; + rdfs:subPropertyOf net:has_object . + +net:has_possible_range a owl:AnnotationProperty ; + rdfs:label "has possible range" ; + rdfs:subPropertyOf net:has_object . + +net:has_relation a owl:AnnotationProperty ; + rdfs:label "has relation" ; + rdfs:subPropertyOf net:has_relation_value . + +net:has_source a owl:AnnotationProperty ; + rdfs:label "has source" ; + rdfs:subPropertyOf net:has_relation_value . + +net:has_structure a owl:AnnotationProperty ; + rdfs:label "Linguistic Structure (in UNL Document)" ; + rdfs:subPropertyOf net:netProperty . + +net:has_target a owl:AnnotationProperty ; + rdfs:label "has target" ; + rdfs:subPropertyOf net:has_relation_value . + +net:inverse_direction a owl:NamedIndividual . + +net:listGuiding a owl:AnnotationProperty ; + rdfs:label "Guiding connector of a list (or, and)" ; + rdfs:subPropertyOf net:objectValue . + +net:modCat1 a owl:AnnotationProperty ; + rdfs:label "Modality Category (level 1)" ; + rdfs:subPropertyOf net:objectValue . + +net:modCat2 a owl:AnnotationProperty ; + rdfs:label "Modality Category (level 2)" ; + rdfs:subPropertyOf net:objectValue . + +net:normal_direction a owl:NamedIndividual . + +net:type a owl:AnnotationProperty ; + rdfs:label "type "@fr ; + rdfs:subPropertyOf net:netProperty . + +net:verbClass a owl:AnnotationProperty ; + rdfs:label "verb class" ; + rdfs:subPropertyOf net:objectValue . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a3> a ns11:author-01 ; + ns11:author-01.ARG0 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#p> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#root01> a ns21:AMR ; + ns21:has-id "asail_odrl_sentences-16" ; + ns21:has-sentence "You must keep intact all copyright notices for the Work and give the Original Author credit." ; + ns21:root <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o> . + +<http://amr.isi.edu/amr_data/test-1#s> ns3:domain <http://amr.isi.edu/amr_data/test-1#s2> . + +<http://amr.isi.edu/amr_data/test-2#p> rdfs:label "Earth" . + +ns21:AMR a owl:Class ; + rdfs:subClassOf :AMR_Linked_Data . + +ns21:NamedEntity a ns21:Concept, + owl:Class, + owl:NamedIndividual ; + rdfs:label "AMR-EntityType", + "AMR-Term" ; + rdfs:subClassOf :AMR_Linked_Data . + +:AMR_Root a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +:concept_all rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns21:all ; + :label "all" . + +:concept_and rdfs:subClassOf :AMR_Relation_Concept ; + :fromAmrLk ns21:and ; + :hasPhenomenaLink :phenomena_conjunction_and ; + :label "and" . + +:concept_author-01 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:author-01 ; + :label "author-01" . + +:concept_copyright-01 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:copyright-01 ; + :label "copyright-01" . + +:concept_credit-01 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:credit-01 ; + :label "credit-01" . + +:concept_intact rdfs:subClassOf :AMR_Term_Concept ; + :fromAmrLk ns3:intact ; + :label "intact" . + +:concept_keep-01 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:keep-01 ; + :label "keep-01" . + +:concept_notice-03 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:notice-03 ; + :label "notice-03" . + +:concept_obligate-01 rdfs:subClassOf :AMR_Relation_Concept ; + :fromAmrLk ns11:obligate-01 ; + :hasPhenomenaLink :phenomena_modality_obligation ; + :label "obligate-01" . + +:concept_original rdfs:subClassOf :AMR_Term_Concept ; + :fromAmrLk ns3:original ; + :label "original" . + +:concept_person rdfs:subClassOf :AMR_Term_Concept ; + :fromAmrLk <http://amr.isi.edu/entity-types#person> ; + :label "person" . + +:concept_work-01 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:work-01 ; + :label "work-01" . + +:concept_you rdfs:subClassOf :AMR_Term_Concept ; + :fromAmrLk ns3:you ; + :label "you" . + +:leaf_all_a2 a :AMR_Leaf ; + :hasConcept :concept_all ; + :hasVariable :variable_a2 . + +:leaf_and_a a :AMR_Leaf ; + :edge_a_op1_k :leaf_keep-01_k ; + :edge_a_op2_c2 :leaf_credit-01_c2 ; + :hasConcept :concept_and ; + :hasVariable :variable_a . + +:leaf_copyright-01_c a :AMR_Leaf ; + :edge_c_ARG1_w :leaf_work-01_w ; + :hasConcept :concept_copyright-01 ; + :hasVariable :variable_c . + +:leaf_credit-01_c2 a :AMR_Leaf ; + :edge_c2_ARG0_y :leaf_you_y ; + :edge_c2_ARG1_p :leaf_person_p ; + :hasConcept :concept_credit-01 ; + :hasVariable :variable_c2 . + +:leaf_intact_ii a :AMR_Leaf ; + :hasConcept :concept_intact ; + :hasVariable :variable_ii . + +:leaf_keep-01_k a :AMR_Leaf ; + :edge_k_ARG0_y :leaf_you_y ; + :edge_k_ARG1_n :leaf_notice-03_n ; + :hasConcept :concept_keep-01 ; + :hasVariable :variable_k . + +:leaf_notice-03_n a :AMR_Leaf ; + :edge_n_ARG1_c :leaf_copyright-01_c ; + :edge_n_mod_a2 :leaf_all_a2 ; + :edge_n_mod_ii :leaf_intact_ii ; + :hasConcept :concept_notice-03 ; + :hasVariable :variable_n . + +:leaf_obligate-01_o a :AMR_Leaf ; + :edge_o_ARG1_y :leaf_you_y ; + :edge_o_ARG2_a :leaf_and_a ; + :hasConcept :concept_obligate-01 ; + :hasVariable :variable_o . + +:leaf_original_o2 a :AMR_Leaf ; + :hasConcept :concept_original ; + :hasVariable :variable_o2 . + +:leaf_work-01_w a :AMR_Leaf ; + :hasConcept :concept_work-01 ; + :hasVariable :variable_w . + +:phenomena_conjunction_and a owl:Class ; + rdfs:subClassOf :phenomena_conjunction ; + :hasConceptLink "and" ; + :label "conjunction-AND" . + +:phenomena_modality_obligation a owl:Class ; + rdfs:subClassOf :phenomena_modality ; + :hasConceptLink "obligate-01" ; + :label "obligation-modality" . + +:role_ARG2 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG2" . + +:role_op1 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op1" . + +:role_op2 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op2" . + +:variable_a a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a> ; + :label "a" . + +:variable_a2 a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a2> ; + :label "a2" . + +:variable_a3 a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a3> ; + :label "a3" . + +:variable_c a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c> ; + :label "c" . + +:variable_c2 a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c2> ; + :label "c2" . + +:variable_ii a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#ii> ; + :label "ii" . + +:variable_k a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#k> ; + :label "k" . + +:variable_n a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#n> ; + :label "n" . + +:variable_o a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o> ; + :label "o" . + +:variable_o2 a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o2> ; + :label "o2" . + +:variable_p a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#p> ; + :label "p" . + +:variable_w a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#w> ; + :label "w" . + +:variable_y a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> ; + :label "y" . + +sys:Degree a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:Entity a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:Feature a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:Out_AnnotationProperty a owl:AnnotationProperty . + +net:Phenomena_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:has_value a owl:AnnotationProperty ; + rdfs:subPropertyOf net:netProperty . + +net:objectType a owl:AnnotationProperty ; + rdfs:label "object type" ; + rdfs:subPropertyOf net:objectProperty . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a> a ns21:and ; + ns3:op1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#k> ; + ns3:op2 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c2> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a2> a ns21:all ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c> a ns11:copyright-01 ; + ns11:copyright-01.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#w> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c2> a ns11:credit-01 ; + ns11:credit-01.ARG0 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> ; + ns11:credit-01.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#p> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#ii> a ns3:intact ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#k> a ns11:keep-01 ; + ns11:keep-01.ARG0 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> ; + ns11:keep-01.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#n> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#n> a ns11:notice-03 ; + ns11:notice-03.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c> ; + ns3:mod <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a2>, + <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#ii> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o> a ns11:obligate-01 ; + ns11:obligate-01.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> ; + ns11:obligate-01.ARG2 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o2> a ns3:original ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#w> a ns11:work-01 ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/entity-types#person> a ns21:NamedEntity ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:author-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:copyright-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:credit-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:keep-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:notice-03 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:obligate-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:work-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns3:intact a ns21:Concept ; + rdfs:subClassOf :AMR_Linked_Data . + +ns3:original a ns21:Concept ; + rdfs:subClassOf :AMR_Linked_Data . + +ns3:you a ns21:Concept ; + rdfs:subClassOf :AMR_Linked_Data . + +ns21:all a ns21:Concept ; + rdfs:subClassOf :AMR_Linked_Data . + +ns21:and a ns21:Concept ; + rdfs:subClassOf :AMR_Linked_Data . + +:AMR_Relation_Concept a owl:Class ; + rdfs:subClassOf :AMR_Concept . + +:hasLink a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:leaf_person_p a :AMR_Leaf ; + :edge_p_mod_o2 :leaf_original_o2 ; + :hasConcept :concept_person ; + :hasVariable :variable_p . + +:phenomena_conjunction a owl:Class ; + rdfs:subClassOf :AMR_Phenomena ; + :hasConceptLink "contrast-01", + "either", + "neither" ; + :label "conjunction" . + +sys:Out_ObjectProperty a owl:ObjectProperty . + +net:Class_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:objectProperty a owl:AnnotationProperty ; + rdfs:label "object attribute" . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#p> a <http://amr.isi.edu/entity-types#person> ; + ns3:mod <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o2> ; + rdfs:subClassOf :AMR_Linked_Data . + +:AMR_Concept a owl:Class ; + rdfs:subClassOf :AMR_Element . + +:AMR_Phenomena a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +:AMR_Specific_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +:fromAmrLk a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:getProperty a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasReificationDefinition a owl:AnnotationProperty ; + rdfs:range rdfs:Literal ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:leaf_you_y a :AMR_Leaf ; + :hasConcept :concept_you ; + :hasVariable :variable_y . + +:phenomena_modality a owl:Class ; + rdfs:subClassOf :AMR_Phenomena . + +:role_ARG0 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG0" . + +:role_mod a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :getDirectPropertyName "hasFeature"^^xsd:string ; + :getPropertyType rdfs:subClassOf, + owl:ObjectProperty ; + :label "mod" ; + :toReifyAsConcept "mod" ; + :toReifyWithBaseEdge "ARG0" ; + :toReifyWithHeadEdge "ARG1" . + +:toReify a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +net:Net_Structure a owl:Class ; + rdfs:label "Semantic Net Structure" ; + rdfs:comment "A semantic net captures a set of nodes, and associates this set with type(s) and value(s)." . + +net:Property_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:has_relation_value a owl:AnnotationProperty ; + rdfs:label "has relation value" ; + rdfs:subPropertyOf net:has_object . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> a ns3:you ; + rdfs:subClassOf :AMR_Linked_Data . + +:AMR_Element a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +:AMR_Term_Concept a owl:Class ; + rdfs:subClassOf :AMR_Concept . + +:AMR_NonCore_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +:AMR_Role a owl:Class ; + rdfs:subClassOf :AMR_Element . + +:role_ARG1 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG1" . + +sys:Out_Structure a owl:Class ; + rdfs:label "Output Ontology Structure" . + +net:netProperty a owl:AnnotationProperty ; + rdfs:label "netProperty" . + +:AMR_ObjectProperty a owl:ObjectProperty ; + rdfs:subPropertyOf owl:topObjectProperty . + +:AMR_Structure a owl:Class . + +cprm:configParamProperty a rdf:Property ; + rdfs:label "Config Parameter Property" . + +ns21:Frame a ns21:Concept, + owl:Class, + owl:NamedIndividual ; + rdfs:label "AMR-PropBank-Frame" ; + rdfs:subClassOf :AMR_Linked_Data . + +rdf:Property a owl:Class . + +:AMR_Predicat_Concept a owl:Class ; + rdfs:subClassOf :AMR_Concept . + +:AMR_Relation a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +net:Net a owl:Class ; + rdfs:subClassOf net:Net_Structure . + +net:has_object a owl:AnnotationProperty ; + rdfs:label "relation" ; + rdfs:subPropertyOf net:netProperty . + +ns11:FrameRole a ns21:Role, + owl:Class, + owl:NamedIndividual ; + rdfs:label "AMR-PropBank-Role" ; + rdfs:subClassOf :AMR_Linked_Data . + +:AMR_Op_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +:AMR_AnnotationProperty a owl:AnnotationProperty . + +:AMR_Core_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +:AMR_Variable a owl:Class ; + rdfs:subClassOf :AMR_Element . + +:AMR_Leaf a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +net:objectValue a owl:AnnotationProperty ; + rdfs:label "valuations"@fr ; + rdfs:subPropertyOf net:objectProperty . + +:AMR_Edge a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +:AMR_Linked_Data a owl:Class . + +[] a owl:AllDisjointClasses ; + owl:members ( sys:Degree sys:Entity sys:Feature ) . + diff --git a/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_transduction.ttl b/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_transduction.ttl new file mode 100644 index 00000000..b607e06f --- /dev/null +++ b/tests/main_tests/test_odrl_output/aos16-20230619/technical-data/tenet.tetras-libre.fr_demo_clara_16-0/tenet.tetras-libre.fr_demo_clara_16_transduction.ttl @@ -0,0 +1,1457 @@ +@base <http://https://tenet.tetras-libre.fr/demo/clara/16//transduction> . +@prefix : <https://amr.tetras-libre.fr/rdf/schema#> . +@prefix cprm: <https://tenet.tetras-libre.fr/config/parameters#> . +@prefix net: <https://tenet.tetras-libre.fr/semantic-net#> . +@prefix ns11: <http://amr.isi.edu/frames/ld/v1.2.2/> . +@prefix ns21: <http://amr.isi.edu/rdf/core-amr#> . +@prefix ns3: <http://amr.isi.edu/rdf/amr-terms#> . +@prefix owl: <http://www.w3.org/2002/07/owl#> . +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix sys: <https://tenet.tetras-libre.fr/base-ontology#> . +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . + +ns21:Concept a rdfs:Class, + owl:Class ; + rdfs:label "AMR-Concept" ; + rdfs:subClassOf :AMR_Linked_Data . + +ns21:Role a rdfs:Class, + owl:Class ; + rdfs:label "AMR-Role" ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/test-1#root01> ns21:hasID "test-1" ; + ns21:hasSentence "The sun is a star." ; + ns21:root <http://amr.isi.edu/amr_data/test-1#s> . + +<http://amr.isi.edu/amr_data/test-2#root01> ns21:hasID "test-2" ; + ns21:hasSentence "Earth is a planet." ; + ns21:root <http://amr.isi.edu/amr_data/test-2#p> . + +ns11:author-01.ARG0 a ns11:FrameRole . + +ns11:copyright-01.ARG1 a ns11:FrameRole . + +ns11:credit-01.ARG0 a ns11:FrameRole . + +ns11:credit-01.ARG1 a ns11:FrameRole . + +ns11:keep-01.ARG0 a ns11:FrameRole . + +ns11:keep-01.ARG1 a ns11:FrameRole . + +ns11:notice-03.ARG1 a ns11:FrameRole . + +ns11:obligate-01.ARG1 a ns11:FrameRole . + +ns11:obligate-01.ARG2 a ns11:FrameRole . + +ns3:domain a ns21:Role, + owl:AnnotationProperty, + owl:NamedIndividual . + +ns3:mod a ns21:Role . + +ns3:op1 a ns21:Role . + +ns3:op2 a ns21:Role . + +ns21:hasID a owl:AnnotationProperty . + +ns21:hasSentence a owl:AnnotationProperty . + +ns21:root a owl:AnnotationProperty . + +<https://amr.tetras-libre.fr/rdf/schema> a owl:Ontology ; + owl:versionIRI :0.1 . + +:AMR_DataProperty a owl:DatatypeProperty . + +:AMR_Prep_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +:AMR_Root a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +:edge_a3_p a :AMR_Edge ; + :hasAmrRole :role_ARG0 ; + :hasRoleID "ARG0" . + +:edge_a_c2 a :AMR_Edge ; + :hasAmrRole :role_op2 ; + :hasRoleID "op2" . + +:edge_a_k a :AMR_Edge ; + :hasAmrRole :role_op1 ; + :hasRoleID "op1" . + +:edge_c2_p a :AMR_Edge ; + :hasAmrRole :role_ARG1 ; + :hasRoleID "ARG1" . + +:edge_c2_y a :AMR_Edge ; + :hasAmrRole :role_ARG0 ; + :hasRoleID "ARG0" . + +:edge_c_w a :AMR_Edge ; + :hasAmrRole :role_ARG1 ; + :hasRoleID "ARG1" . + +:edge_k_n a :AMR_Edge ; + :hasAmrRole :role_ARG1 ; + :hasRoleID "ARG1" . + +:edge_k_y a :AMR_Edge ; + :hasAmrRole :role_ARG0 ; + :hasRoleID "ARG0" . + +:edge_n_a2 a :AMR_Edge ; + :hasAmrRole :role_mod ; + :hasRoleID "mod" . + +:edge_n_c a :AMR_Edge ; + :hasAmrRole :role_ARG1 ; + :hasRoleID "ARG1" . + +:edge_n_ii a :AMR_Edge ; + :hasAmrRole :role_mod ; + :hasRoleID "mod" . + +:edge_o_a a :AMR_Edge ; + :hasAmrRole :role_ARG2 ; + :hasRoleID "ARG2" . + +:edge_o_y a :AMR_Edge ; + :hasAmrRole :role_ARG1 ; + :hasRoleID "ARG1" . + +:edge_p_o2 a :AMR_Edge ; + :hasAmrRole :role_mod ; + :hasRoleID "mod" . + +:fromAmrLkFramerole a owl:AnnotationProperty ; + rdfs:subPropertyOf :fromAmrLk . + +:fromAmrLkRole a owl:AnnotationProperty ; + rdfs:subPropertyOf :fromAmrLk . + +:fromAmrLkRoot a owl:AnnotationProperty ; + rdfs:subPropertyOf :fromAmrLk . + +:getDirectPropertyName a owl:AnnotationProperty ; + rdfs:subPropertyOf :getProperty . + +:getInversePropertyName a owl:AnnotationProperty ; + rdfs:subPropertyOf :getProperty . + +:getPropertyType a owl:AnnotationProperty ; + rdfs:subPropertyOf :getProperty . + +:hasConcept a owl:ObjectProperty ; + rdfs:domain :AMR_Leaf ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasConceptLink a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasLink . + +:hasEdgeLink a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasLink . + +:hasReification a owl:AnnotationProperty ; + rdfs:range xsd:boolean ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasReificationConcept a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasReificationDefinition . + +:hasReificationDomain a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasReificationDefinition . + +:hasReificationRange a owl:AnnotationProperty ; + rdfs:subPropertyOf :hasReificationDefinition . + +:hasRelationName a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasRoleID a owl:ObjectProperty ; + rdfs:domain :AMR_Edge ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasRoleTag a owl:ObjectProperty ; + rdfs:domain :AMR_Edge ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasRolesetID a owl:ObjectProperty ; + rdfs:domain :AMR_Edge ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasRootLeaf a owl:ObjectProperty ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:hasSentenceID a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasSentenceStatement a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasVariable a owl:ObjectProperty ; + rdfs:domain :AMR_Leaf ; + rdfs:subPropertyOf :AMR_ObjectProperty . + +:label a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:phenomena_conjunction_or a owl:Class ; + rdfs:subClassOf :phenomena_conjunction ; + :hasConceptLink "or" ; + :label "conjunction-OR" . + +:phenomena_degree a owl:Class ; + rdfs:subClassOf :AMR_Phenomena ; + :hasConceptLink "have-degree-91" ; + :label "degree" . + +:phenomena_modality_possible a owl:Class ; + rdfs:subClassOf :phenomena_modality ; + :hasConceptLink "allow-01", + "grant-01", + "likely-01", + "permit-01", + "possible-01" ; + :label "possible-modality" . + +:phenomena_modality_prohibition a owl:Class ; + rdfs:subClassOf :phenomena_modality ; + :hasConceptLink "prohibit-01" ; + :label "prohibition-modality" . + +:relation_domain a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "domain" . + +:relation_manner a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification true ; + :hasReificationConcept "hasManner" ; + :hasReificationDomain "ARG1" ; + :hasReificationRange "ARG2" ; + :hasRelationName "manner" . + +:relation_mod a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "mod" . + +:relation_name a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "name" . + +:relation_part a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification true ; + :hasReificationConcept "hasPart" ; + :hasReificationDomain "ARG1" ; + :hasReificationRange "ARG2" ; + :hasRelationName "part" . + +:relation_polarity a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "polarity" . + +:relation_quant a owl:Class ; + rdfs:subClassOf :AMR_Relation ; + :hasReification false ; + :hasRelationName "quant" . + +:role_ARG3 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG3" . + +:role_ARG4 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG4" . + +:role_ARG5 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG5" . + +:role_ARG6 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG6" . + +:role_ARG7 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG7" . + +:role_ARG8 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG8" . + +:role_ARG9 a owl:Class ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG9" . + +:role_domain a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :hasRelationName "domain" ; + :label "domain" ; + :toReifyAsConcept "domain" ; + :toReifyWithBaseEdge "ARG0" ; + :toReifyWithHeadEdge "ARG1" . + +:role_have-degree-91 a owl:Class ; + rdfs:subClassOf :AMR_Specific_Role ; + :getPropertyType <net:specificProperty> . + +:role_manner a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :getDirectPropertyName "manner" ; + :getPropertyType owl:DataProperty ; + :label "manner" ; + :toReifyAsConcept "manner" ; + :toReifyWithBaseEdge "ARG0" ; + :toReifyWithHeadEdge "ARG1" . + +:role_name a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :label "name" . + +:role_op3 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op3" . + +:role_op4 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op4" . + +:role_op5 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op5" . + +:role_op6 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op6" . + +:role_op7 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op7" . + +:role_op8 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op8" . + +:role_op9 a owl:Class ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op9" . + +:role_part a owl:Class ; + rdfs:subClassOf :AMR_NonCore_Role ; + :getDirectPropertyName "hasPart"^^xsd:string ; + :getInversePropertyName "partOf"^^xsd:string ; + :getPropertyType owl:ObjectProperty ; + :toReifyAsConcept "part" ; + :toReifyWithBaseEdge "ARG0" ; + :toReifyWithHeadEdge "ARG1" . + +:role_polarity a owl:Class ; + rdfs:subClassOf :AMR_Specific_Role ; + :label "polarity" . + +:role_quant a owl:Class ; + rdfs:subClassOf :AMR_Specific_Role ; + :label "quant" . + +:root_asail_odrl_sentences-16 a :AMR_Value ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#root01> ; + :hasRootLeaf :leaf_obligate-01_o ; + :hasSentenceID "asail_odrl_sentences-16" ; + :hasSentenceStatement "You must keep intact all copyright notices for the Work and give the Original Author credit." . + +:toReifyAsConcept a owl:AnnotationProperty ; + rdfs:subPropertyOf :toReify . + +:toReifyWithBaseEdge a owl:AnnotationProperty ; + rdfs:subPropertyOf :toReify . + +:toReifyWithHeadEdge a owl:AnnotationProperty ; + rdfs:subPropertyOf :toReify . + +<https://tenet.tetras-libre.fr/base-ontology> a owl:Ontology . + +sys:Event a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:Undetermined_Thing a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:fromStructure a owl:AnnotationProperty ; + rdfs:subPropertyOf sys:Out_AnnotationProperty . + +sys:hasDegree a owl:ObjectProperty ; + rdfs:subPropertyOf sys:Out_ObjectProperty . + +sys:hasFeature a owl:ObjectProperty ; + rdfs:subPropertyOf sys:Out_ObjectProperty . + +<https://tenet.tetras-libre.fr/config/parameters> a owl:Ontology . + +cprm:Config_Parameters a owl:Class ; + cprm:baseURI "https://tenet.tetras-libre.fr/" ; + cprm:netURI "https://tenet.tetras-libre.fr/semantic-net#" ; + cprm:newClassRef "new-class#" ; + cprm:newPropertyRef "new-relation#" ; + cprm:objectRef "object_" ; + cprm:targetOntologyURI "https://tenet.tetras-libre.fr/base-ontology/" . + +cprm:baseURI a rdf:Property ; + rdfs:label "Base URI" ; + rdfs:domain cprm:Frame ; + rdfs:range xsd:string ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:netURI a rdf:Property ; + rdfs:label "Net URI" ; + rdfs:domain cprm:Frame ; + rdfs:range xsd:string ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:newClassRef a rdf:Property ; + rdfs:label "Reference for a new class" ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:newPropertyRef a rdf:Property ; + rdfs:label "Reference for a new property" ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:objectRef a rdf:Property ; + rdfs:label "Object Reference" ; + rdfs:subPropertyOf cprm:configParamProperty . + +cprm:targetOntologyURI a rdf:Property ; + rdfs:label "URI of classes in target ontology" ; + rdfs:domain cprm:Frame ; + rdfs:range xsd:string ; + rdfs:subPropertyOf cprm:configParamProperty . + +<https://tenet.tetras-libre.fr/semantic-net> a owl:Ontology . + +net:Composite_Property_Net a owl:Class ; + rdfs:subClassOf net:Property_Net . + +net:Feature a owl:Class ; + rdfs:subClassOf net:Net_Structure . + +net:Value_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:abstractionClass a owl:AnnotationProperty ; + rdfs:label "abstraction class" ; + rdfs:subPropertyOf net:objectValue . + +net:atomProperty_author_a3 a net:Atom_Property_Net ; + :role_ARG0 net:atomClass_person_p, + net:compositeClass_original-person_p ; + net:coverBaseNode :leaf_author-01_a3 ; + net:coverNode :leaf_author-01_a3 ; + net:hasNaming "author" ; + net:hasPropertyName "author" ; + net:hasPropertyName01 "authoring" ; + net:hasPropertyName10 "author-by" ; + net:hasPropertyName12 "author-of" ; + net:hasPropertyType owl:ObjectProperty ; + net:hasStructure "unknown" ; + net:isCoreRoleLinked "true" ; + net:targetArgumentNode :leaf_person_p . + +net:atomType a owl:AnnotationProperty ; + rdfs:label "atom type" ; + rdfs:subPropertyOf net:objectType . + +net:entityClass a owl:AnnotationProperty ; + rdfs:label "entity class" ; + rdfs:subPropertyOf net:objectValue . + +net:featureClass a owl:AnnotationProperty ; + rdfs:label "feature class" ; + rdfs:subPropertyOf net:objectValue . + +net:has_atom a owl:AnnotationProperty ; + rdfs:label "has atom" ; + rdfs:subPropertyOf net:has_object . + +net:has_class a owl:AnnotationProperty ; + rdfs:label "is class" ; + rdfs:subPropertyOf net:objectValue . + +net:has_class_name a owl:AnnotationProperty ; + rdfs:subPropertyOf net:has_value . + +net:has_class_uri a owl:AnnotationProperty ; + rdfs:label "class uri" ; + rdfs:subPropertyOf net:objectValue . + +net:has_concept a owl:AnnotationProperty ; + rdfs:label "concept "@fr ; + rdfs:subPropertyOf net:objectValue . + +net:has_entity a owl:AnnotationProperty ; + rdfs:label "has entity" ; + rdfs:subPropertyOf net:has_object . + +net:has_feature a owl:AnnotationProperty ; + rdfs:label "has feature" ; + rdfs:subPropertyOf net:has_object . + +net:has_instance a owl:AnnotationProperty ; + rdfs:label "entity instance" ; + rdfs:subPropertyOf net:objectValue . + +net:has_instance_uri a owl:AnnotationProperty ; + rdfs:label "instance uri" ; + rdfs:subPropertyOf net:objectValue . + +net:has_item a owl:AnnotationProperty ; + rdfs:label "has item" ; + rdfs:subPropertyOf net:has_object . + +net:has_mother_class a owl:AnnotationProperty ; + rdfs:label "has mother class" ; + rdfs:subPropertyOf net:objectValue . + +net:has_mother_class_uri a owl:AnnotationProperty ; + rdfs:label "parent class uri" ; + rdfs:subPropertyOf net:objectValue . + +net:has_node a owl:AnnotationProperty ; + rdfs:label "UNL Node" ; + rdfs:subPropertyOf net:netProperty . + +net:has_parent a owl:AnnotationProperty ; + rdfs:label "has parent" ; + rdfs:subPropertyOf net:has_object . + +net:has_parent_class a owl:AnnotationProperty ; + rdfs:label "parent class" ; + rdfs:subPropertyOf net:objectValue . + +net:has_parent_class_uri a owl:AnnotationProperty ; + rdfs:label "parent class uri" ; + rdfs:subPropertyOf net:objectValue . + +net:has_possible_domain a owl:AnnotationProperty ; + rdfs:label "has possible domain" ; + rdfs:subPropertyOf net:has_object . + +net:has_possible_range a owl:AnnotationProperty ; + rdfs:label "has possible range" ; + rdfs:subPropertyOf net:has_object . + +net:has_relation a owl:AnnotationProperty ; + rdfs:label "has relation" ; + rdfs:subPropertyOf net:has_relation_value . + +net:has_source a owl:AnnotationProperty ; + rdfs:label "has source" ; + rdfs:subPropertyOf net:has_relation_value . + +net:has_structure a owl:AnnotationProperty ; + rdfs:label "Linguistic Structure (in UNL Document)" ; + rdfs:subPropertyOf net:netProperty . + +net:has_target a owl:AnnotationProperty ; + rdfs:label "has target" ; + rdfs:subPropertyOf net:has_relation_value . + +net:individual_intact_ii a net:Individual_Net ; + net:composeFrom net:atomClass_intact_ii ; + net:coverBaseNode :leaf_intact_ii ; + net:coverNode :leaf_intact_ii ; + net:hasBaseClassName "Feature" ; + net:hasIndividualLabel "intact" ; + net:hasMotherClassNet net:atomClass_intact_ii ; + net:hasNaming "intact" ; + net:hasStructure "unknown" . + +net:individual_original_o2 a net:Individual_Net ; + net:composeFrom net:atomClass_original_o2 ; + net:coverBaseNode :leaf_original_o2 ; + net:coverNode :leaf_original_o2 ; + net:hasBaseClassName "Feature" ; + net:hasIndividualLabel "original" ; + net:hasMotherClassNet net:atomClass_original_o2 ; + net:hasNaming "original" ; + net:hasStructure "unknown" . + +net:inverse_direction a owl:NamedIndividual . + +net:listGuiding a owl:AnnotationProperty ; + rdfs:label "Guiding connector of a list (or, and)" ; + rdfs:subPropertyOf net:objectValue . + +net:modCat1 a owl:AnnotationProperty ; + rdfs:label "Modality Category (level 1)" ; + rdfs:subPropertyOf net:objectValue . + +net:modCat2 a owl:AnnotationProperty ; + rdfs:label "Modality Category (level 2)" ; + rdfs:subPropertyOf net:objectValue . + +net:normal_direction a owl:NamedIndividual . + +net:rule_obligation_o a net:Rule_Net ; + net:composeFrom net:action_credit_c2, + net:action_notice_k, + net:phenomena_obligation-modality_o ; + net:coverBaseNode :leaf_obligate-01_o ; + net:coverNode :leaf_credit-01_c2, + :leaf_intact_ii, + :leaf_keep-01_k, + :leaf_notice-03_n, + :leaf_obligate-01_o, + :leaf_original_o2, + :leaf_person_p, + :leaf_you_y ; + net:hasNaming "obligation" ; + net:hasRuleActionURI net:action_credit_c2, + net:action_notice_k ; + net:hasRuleRelationName "obligation" ; + net:hasStructure "unknown" . + +net:type a owl:AnnotationProperty ; + rdfs:label "type "@fr ; + rdfs:subPropertyOf net:netProperty . + +net:verbClass a owl:AnnotationProperty ; + rdfs:label "verb class" ; + rdfs:subPropertyOf net:objectValue . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a3> a ns11:author-01 ; + ns11:author-01.ARG0 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#p> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#root01> a ns21:AMR ; + ns21:has-id "asail_odrl_sentences-16" ; + ns21:has-sentence "You must keep intact all copyright notices for the Work and give the Original Author credit." ; + ns21:root <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o> . + +<http://amr.isi.edu/amr_data/test-1#s> ns3:domain <http://amr.isi.edu/amr_data/test-1#s2> . + +<http://amr.isi.edu/amr_data/test-2#p> rdfs:label "Earth" . + +ns21:AMR a owl:Class ; + rdfs:subClassOf :AMR_Linked_Data . + +ns21:NamedEntity a ns21:Concept, + owl:Class, + owl:NamedIndividual ; + rdfs:label "AMR-EntityType", + "AMR-Term" ; + rdfs:subClassOf :AMR_Linked_Data . + +:AMR_Value a owl:Class ; + rdfs:subClassOf :AMR_Element . + +:concept_all rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns21:all ; + :label "all" . + +:concept_and rdfs:subClassOf :AMR_Relation_Concept ; + :fromAmrLk ns21:and ; + :hasPhenomenaLink :phenomena_conjunction_and ; + :label "and" . + +:concept_author-01 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:author-01 ; + :label "author-01" . + +:concept_copyright-01 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:copyright-01 ; + :label "copyright-01" . + +:concept_credit-01 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:credit-01 ; + :label "credit-01" . + +:concept_intact rdfs:subClassOf :AMR_Term_Concept ; + :fromAmrLk ns3:intact ; + :label "intact" . + +:concept_keep-01 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:keep-01 ; + :label "keep-01" . + +:concept_notice-03 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:notice-03 ; + :label "notice-03" . + +:concept_obligate-01 rdfs:subClassOf :AMR_Relation_Concept ; + :fromAmrLk ns11:obligate-01 ; + :hasPhenomenaLink :phenomena_modality_obligation ; + :label "obligate-01" . + +:concept_original rdfs:subClassOf :AMR_Term_Concept ; + :fromAmrLk ns3:original ; + :label "original" . + +:concept_person rdfs:subClassOf :AMR_Term_Concept ; + :fromAmrLk <http://amr.isi.edu/entity-types#person> ; + :label "person" . + +:concept_work-01 rdfs:subClassOf :AMR_Predicat_Concept ; + :fromAmrLk ns11:work-01 ; + :label "work-01" . + +:concept_you rdfs:subClassOf :AMR_Term_Concept ; + :fromAmrLk ns3:you ; + :label "you" . + +:role_ARG2 a owl:Class, + net:Relation ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG2" . + +:role_op1 a owl:Class, + net:Relation ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op1" . + +:role_op2 a owl:Class, + net:Relation ; + rdfs:subClassOf :AMR_Op_Role ; + :label "op2" . + +:variable_a a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a> ; + :label "a" . + +:variable_a2 a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a2> ; + :label "a2" . + +:variable_a3 a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a3> ; + :label "a3" . + +:variable_c a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c> ; + :label "c" . + +:variable_c2 a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c2> ; + :label "c2" . + +:variable_ii a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#ii> ; + :label "ii" . + +:variable_k a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#k> ; + :label "k" . + +:variable_n a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#n> ; + :label "n" . + +:variable_o a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o> ; + :label "o" . + +:variable_o2 a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o2> ; + :label "o2" . + +:variable_p a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#p> ; + :label "p" . + +:variable_w a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#w> ; + :label "w" . + +:variable_y a :AMR_Variable ; + :fromAmrLk <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> ; + :label "y" . + +sys:Degree a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:Entity a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:Feature a owl:Class ; + rdfs:subClassOf sys:Out_Structure . + +sys:Out_AnnotationProperty a owl:AnnotationProperty . + +net:Modality_Phenomena_Net a owl:Class ; + rdfs:subClassOf net:Phenomena_Net . + +net:Rule_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:atomClass_copyright_c a net:Atom_Class_Net ; + :role_ARG1 net:atomProperty_work_w ; + net:composeFrom net:atomProperty_copyright_c ; + net:coverBaseNode :leaf_copyright-01_c ; + net:coverNode :leaf_copyright-01_c ; + net:hasClassName "copyright" ; + net:hasNaming "copyright" ; + net:hasStructure "unknown" . + +net:atomClass_work_w a net:Atom_Class_Net ; + net:composeFrom net:atomProperty_work_w ; + net:coverBaseNode :leaf_work-01_w ; + net:coverNode :leaf_work-01_w ; + net:hasClassName "work" ; + net:hasNaming "work" ; + net:hasStructure "unknown" . + +net:has_value a owl:AnnotationProperty ; + rdfs:subPropertyOf net:netProperty . + +net:objectType a owl:AnnotationProperty ; + rdfs:label "object type" ; + rdfs:subPropertyOf net:objectProperty . + +net:phenomena_conjunction-AND_a a net:Phenomena_Net ; + :role_op1 net:actionProperty_keep_k, + net:actionProperty_notice_k, + net:action_notice_k, + net:atomProperty_keep_k ; + :role_op2 net:actionProperty_credit_c2, + net:action_credit_c2, + net:atomProperty_credit_c2 ; + net:coverBaseNode :leaf_and_a ; + net:coverNode :leaf_and_a ; + net:hasNaming "conjunction-AND" ; + net:hasPhenomenaRef "and" ; + net:hasPhenomenaType :phenomena_conjunction_and ; + net:hasStructure "unknown" . + +net:phenomena_obligation-modality_o a net:Modality_Phenomena_Net, + net:Phenomena_Net ; + :role_ARG1 net:atomClass_you_y ; + :role_ARG2 net:actionProperty_credit_c2, + net:actionProperty_keep_k, + net:actionProperty_notice_k, + net:action_credit_c2, + net:action_notice_k, + net:atomProperty_credit_c2, + net:atomProperty_keep_k, + net:phenomena_conjunction-AND_a ; + net:coverBaseNode :leaf_obligate-01_o ; + net:coverNode :leaf_obligate-01_o ; + net:hasNaming "obligation-modality" ; + net:hasPhenomenaRef "obligate-01" ; + net:hasPhenomenaType :phenomena_modality_obligation ; + net:hasStructure "unknown" . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a> a ns21:and ; + ns3:op1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#k> ; + ns3:op2 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c2> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a2> a ns21:all ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c> a ns11:copyright-01 ; + ns11:copyright-01.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#w> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c2> a ns11:credit-01 ; + ns11:credit-01.ARG0 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> ; + ns11:credit-01.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#p> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#ii> a ns3:intact ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#k> a ns11:keep-01 ; + ns11:keep-01.ARG0 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> ; + ns11:keep-01.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#n> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#n> a ns11:notice-03 ; + ns11:notice-03.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#c> ; + ns3:mod <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a2>, + <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#ii> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o> a ns11:obligate-01 ; + ns11:obligate-01.ARG1 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> ; + ns11:obligate-01.ARG2 <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#a> ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o2> a ns3:original ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#w> a ns11:work-01 ; + rdfs:subClassOf :AMR_Linked_Data . + +<http://amr.isi.edu/entity-types#person> a ns21:NamedEntity ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:author-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:copyright-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:credit-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:keep-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:notice-03 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:obligate-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns11:work-01 a ns21:Frame ; + rdfs:subClassOf :AMR_Linked_Data . + +ns3:intact a ns21:Concept ; + rdfs:subClassOf :AMR_Linked_Data . + +ns3:original a ns21:Concept ; + rdfs:subClassOf :AMR_Linked_Data . + +ns3:you a ns21:Concept ; + rdfs:subClassOf :AMR_Linked_Data . + +ns21:all a ns21:Concept ; + rdfs:subClassOf :AMR_Linked_Data . + +ns21:and a ns21:Concept ; + rdfs:subClassOf :AMR_Linked_Data . + +:AMR_Relation_Concept a owl:Class ; + rdfs:subClassOf :AMR_Concept . + +:hasLink a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:leaf_author-01_a3 a :AMR_Leaf ; + :edge_a3_p :leaf_person_p ; + :hasConcept :concept_author-01 ; + :hasVariable :variable_a3 . + +:phenomena_conjunction a owl:Class ; + rdfs:subClassOf :AMR_Phenomena ; + :hasConceptLink "contrast-01", + "either", + "neither" ; + :label "conjunction" . + +:phenomena_conjunction_and a owl:Class ; + rdfs:subClassOf :phenomena_conjunction ; + :hasConceptLink "and" ; + :label "conjunction-AND" . + +:phenomena_modality_obligation a owl:Class ; + rdfs:subClassOf :phenomena_modality ; + :hasConceptLink "obligate-01" ; + :label "obligation-modality" . + +sys:Out_ObjectProperty a owl:ObjectProperty . + +net:Action_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:Class_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:Composite_Class_Net a owl:Class ; + rdfs:subClassOf net:Class_Net . + +net:Individual_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:objectProperty a owl:AnnotationProperty ; + rdfs:label "object attribute" . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#p> a <http://amr.isi.edu/entity-types#person> ; + ns3:mod <http://amr.isi.edu/amr_data/asail_odrl_sentences-16#o2> ; + rdfs:subClassOf :AMR_Linked_Data . + +:AMR_Concept a owl:Class ; + rdfs:subClassOf :AMR_Element . + +:AMR_Phenomena a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +:AMR_Specific_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +:fromAmrLk a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:getProperty a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:hasReificationDefinition a owl:AnnotationProperty ; + rdfs:range rdfs:Literal ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +:leaf_and_a a :AMR_Leaf ; + :edge_a_c2 :leaf_credit-01_c2 ; + :edge_a_k :leaf_keep-01_k ; + :hasConcept :concept_and ; + :hasVariable :variable_a . + +:phenomena_modality a owl:Class ; + rdfs:subClassOf :AMR_Phenomena . + +:role_ARG0 a owl:Class, + net:Relation ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG0" . + +:role_mod a owl:Class, + net:Relation ; + rdfs:subClassOf :AMR_NonCore_Role ; + :getDirectPropertyName "hasFeature"^^xsd:string ; + :getPropertyType rdfs:subClassOf, + owl:ObjectProperty ; + :label "mod" ; + :toReifyAsConcept "mod" ; + :toReifyWithBaseEdge "ARG0" ; + :toReifyWithHeadEdge "ARG1" . + +:toReify a owl:AnnotationProperty ; + rdfs:subPropertyOf :AMR_AnnotationProperty . + +net:Action_Property_Net a owl:Class ; + rdfs:subClassOf net:Property_Net . + +net:Net_Structure a owl:Class ; + rdfs:label "Semantic Net Structure" ; + rdfs:comment "A semantic net captures a set of nodes, and associates this set with type(s) and value(s)." . + +net:Phenomena_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:Property_Net a owl:Class ; + rdfs:subClassOf net:Net . + +net:actionProperty_credit_c2 a net:Action_Property_Net ; + :role_ARG0 net:atomClass_you_y ; + :role_ARG1 net:atomClass_person_p, + net:compositeClass_original-person_p ; + net:composeFrom net:atomProperty_credit_c2 ; + net:coverBaseNode :leaf_credit-01_c2 ; + net:coverNode :leaf_credit-01_c2 ; + net:hasNaming "credit" ; + net:hasPropertyName "credit" ; + net:hasPropertyName01 "crediting" ; + net:hasPropertyName10 "credit-by" ; + net:hasPropertyName12 "credit-of" ; + net:hasPropertyType owl:ObjectProperty ; + net:hasStructure "unknown" ; + net:isCoreRoleLinked "true" ; + net:targetArgumentNode :leaf_person_p, + :leaf_you_y . + +net:actionProperty_keep_k a net:Action_Property_Net, + net:Deprecated_Net ; + :role_ARG0 net:atomClass_you_y ; + :role_ARG1 net:atomClass_notice_n, + net:atomProperty_notice_n, + net:compositeClass_intact-notice_n ; + net:composeFrom net:atomProperty_keep_k ; + net:coverBaseNode :leaf_keep-01_k ; + net:coverNode :leaf_keep-01_k ; + net:hasNaming "keep" ; + net:hasPropertyName "keep" ; + net:hasPropertyName01 "keeping" ; + net:hasPropertyName10 "keep-by" ; + net:hasPropertyName12 "keep-of" ; + net:hasPropertyType owl:ObjectProperty ; + net:hasStructure "unknown" ; + net:isCoreRoleLinked "true" ; + net:targetArgumentNode :leaf_notice-03_n, + :leaf_you_y . + +net:atomProperty_credit_c2 a net:Atom_Property_Net, + net:Deprecated_Net ; + :role_ARG0 net:atomClass_you_y ; + :role_ARG1 net:atomClass_person_p, + net:compositeClass_original-person_p ; + net:coverBaseNode :leaf_credit-01_c2 ; + net:coverNode :leaf_credit-01_c2 ; + net:hasNaming "credit" ; + net:hasPropertyName "credit" ; + net:hasPropertyName01 "crediting" ; + net:hasPropertyName10 "credit-by" ; + net:hasPropertyName12 "credit-of" ; + net:hasPropertyType owl:ObjectProperty ; + net:hasStructure "unknown" ; + net:isCoreRoleLinked "true" ; + net:targetArgumentNode :leaf_person_p, + :leaf_you_y . + +net:atomProperty_keep_k a net:Atom_Property_Net, + net:Deprecated_Net ; + :role_ARG0 net:atomClass_you_y ; + :role_ARG1 net:actionProperty_notice_k, + net:action_notice_k, + net:atomClass_notice_n, + net:atomProperty_notice_n, + net:compositeClass_intact-notice_n ; + net:coverBaseNode :leaf_keep-01_k ; + net:coverNode :leaf_keep-01_k ; + net:hasNaming "keep" ; + net:hasPropertyName "keep" ; + net:hasPropertyName01 "keeping" ; + net:hasPropertyName10 "keep-by" ; + net:hasPropertyName12 "keep-of" ; + net:hasPropertyType owl:ObjectProperty ; + net:hasStructure "unknown" ; + net:isCoreRoleLinked "true" ; + net:targetArgumentNode :leaf_notice-03_n, + :leaf_you_y . + +net:atomProperty_work_w a net:Atom_Property_Net, + net:Deprecated_Net ; + net:coverBaseNode :leaf_work-01_w ; + net:coverNode :leaf_work-01_w ; + net:hasNaming "work" ; + net:hasPropertyName "work" ; + net:hasPropertyName01 "working" ; + net:hasPropertyName10 "work-by" ; + net:hasPropertyName12 "work-of" ; + net:hasPropertyType owl:ObjectProperty ; + net:hasStructure "unknown" ; + net:isCoreRoleLinked "true" . + +net:compositeClass_intact-notice_n a net:Composite_Class_Net, + net:Deprecated_Net ; + :role_ARG1 net:atomProperty_copyright_c ; + :role_mod net:atomClass_intact_ii, + net:atomProperty_all_a2 ; + net:composeFrom net:atomClass_intact_ii, + net:atomClass_notice_n ; + net:coverBaseNode :leaf_notice-03_n ; + net:coverNode :leaf_intact_ii, + :leaf_notice-03_n ; + net:hasMotherClassNet net:atomClass_notice_n ; + net:hasNaming "intact-notice" ; + net:hasStructure "unknown" . + +net:has_relation_value a owl:AnnotationProperty ; + rdfs:label "has relation value" ; + rdfs:subPropertyOf net:has_object . + +<http://amr.isi.edu/amr_data/asail_odrl_sentences-16#y> a ns3:you ; + rdfs:subClassOf :AMR_Linked_Data . + +:AMR_Element a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +:AMR_Term_Concept a owl:Class ; + rdfs:subClassOf :AMR_Concept . + +:leaf_all_a2 a :AMR_Leaf ; + :hasConcept :concept_all ; + :hasVariable :variable_a2 . + +net:actionProperty_notice_k a net:Action_Property_Net ; + :role_ARG0 net:atomClass_you_y ; + :role_ARG1 net:atomClass_notice_n, + net:atomProperty_copyright_c, + net:atomProperty_notice_n ; + :role_mod net:atomClass_intact_ii, + net:atomProperty_all_a2 ; + net:composeFrom net:actionProperty_keep_k, + net:compositeClass_intact-notice_n ; + net:coverBaseNode :leaf_keep-01_k ; + net:coverNode :leaf_intact_ii, + :leaf_keep-01_k, + :leaf_notice-03_n ; + net:hasNaming "notice" ; + net:hasPropertyName "notice" ; + net:hasPropertyName01 "notice" ; + net:hasPropertyName10 "notice" ; + net:hasPropertyName12 "notice" ; + net:hasPropertyType owl:ObjectProperty ; + net:hasStructure "unknown" ; + net:isCoreRoleLinked "true" ; + net:targetArgumentNode :leaf_notice-03_n, + :leaf_you_y . + +net:action_credit_c2 a net:Action_Net ; + net:composeFrom net:actionProperty_credit_c2, + net:atomClass_you_y, + net:compositeClass_original-person_p ; + net:coverBaseNode :leaf_credit-01_c2 ; + net:coverNode :leaf_credit-01_c2, + :leaf_original_o2, + :leaf_person_p, + :leaf_you_y ; + net:hasActionName "credit" ; + net:hasAssigneeClassNet net:atomClass_you_y ; + net:hasNaming "credit" ; + net:hasStructure "unknown" ; + net:hasTargetClassNet net:compositeClass_original-person_p . + +net:atomProperty_all_a2 a net:Atom_Property_Net ; + net:coverBaseNode :leaf_all_a2 ; + net:coverNode :leaf_all_a2 ; + net:hasNaming "all" ; + net:hasPropertyName "all" ; + net:hasPropertyName01 "alling" ; + net:hasPropertyName10 "all-by" ; + net:hasPropertyName12 "all-of" ; + net:hasPropertyType owl:ObjectProperty ; + net:hasStructure "unknown" ; + net:isCoreRoleLinked "true" . + +net:atomProperty_notice_n a net:Atom_Property_Net, + net:Deprecated_Net ; + :role_ARG1 net:atomClass_copyright_c, + net:atomProperty_copyright_c ; + :role_mod net:atomClass_intact_ii, + net:atomProperty_all_a2 ; + net:coverBaseNode :leaf_notice-03_n ; + net:coverNode :leaf_notice-03_n ; + net:hasNaming "notice" ; + net:hasPropertyName "notice" ; + net:hasPropertyName01 "noticeing" ; + net:hasPropertyName10 "notice-by" ; + net:hasPropertyName12 "notice-of" ; + net:hasPropertyType owl:ObjectProperty ; + net:hasStructure "unknown" ; + net:isCoreRoleLinked "true" ; + net:targetArgumentNode :leaf_all_a2, + :leaf_copyright-01_c, + :leaf_intact_ii . + +:AMR_NonCore_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +:AMR_Role a owl:Class ; + rdfs:subClassOf :AMR_Element . + +:leaf_obligate-01_o a :AMR_Leaf ; + :edge_o_a :leaf_and_a ; + :edge_o_y :leaf_you_y ; + :hasConcept :concept_obligate-01 ; + :hasVariable :variable_o . + +:role_ARG1 a owl:Class, + net:Relation ; + rdfs:subClassOf :AMR_Core_Role ; + :label "ARG1" . + +sys:Out_Structure a owl:Class ; + rdfs:label "Output Ontology Structure" . + +net:action_notice_k a net:Action_Net ; + net:composeFrom net:actionProperty_notice_k, + net:atomClass_you_y ; + net:coverBaseNode :leaf_keep-01_k ; + net:coverNode :leaf_intact_ii, + :leaf_keep-01_k, + :leaf_notice-03_n, + :leaf_you_y ; + net:hasActionName "notice" ; + net:hasAssigneeClassNet net:atomClass_you_y ; + net:hasNaming "notice" ; + net:hasStructure "unknown" . + +net:atomClass_notice_n a net:Atom_Class_Net, + net:Deprecated_Net ; + :role_ARG1 net:atomProperty_copyright_c ; + :role_mod net:atomClass_intact_ii, + net:atomProperty_all_a2 ; + net:composeFrom net:atomProperty_notice_n ; + net:coverBaseNode :leaf_notice-03_n ; + net:coverNode :leaf_notice-03_n ; + net:hasClassName "notice" ; + net:hasNaming "notice" ; + net:hasStructure "unknown" . + +net:atomClass_original_o2 a net:Atom_Class_Net ; + net:coverBaseNode :leaf_original_o2 ; + net:coverNode :leaf_original_o2 ; + net:hasClassName "original" ; + net:hasNaming "original" ; + net:hasStructure "unknown" . + +net:atomClass_person_p a net:Atom_Class_Net, + net:Deprecated_Net ; + :role_mod net:atomClass_original_o2 ; + net:coverBaseNode :leaf_person_p ; + net:coverNode :leaf_person_p ; + net:hasClassName "person" ; + net:hasNaming "person" ; + net:hasStructure "unknown" . + +net:atomProperty_copyright_c a net:Atom_Property_Net, + net:Deprecated_Net ; + :role_ARG1 net:atomClass_work_w, + net:atomProperty_work_w ; + net:coverBaseNode :leaf_copyright-01_c ; + net:coverNode :leaf_copyright-01_c ; + net:hasNaming "copyright" ; + net:hasPropertyName "copyright" ; + net:hasPropertyName01 "copyrighting" ; + net:hasPropertyName10 "copyright-by" ; + net:hasPropertyName12 "copyright-of" ; + net:hasPropertyType owl:ObjectProperty ; + net:hasStructure "unknown" ; + net:isCoreRoleLinked "true" ; + net:targetArgumentNode :leaf_work-01_w . + +net:compositeClass_original-person_p a net:Composite_Class_Net ; + :role_mod net:atomClass_original_o2 ; + net:composeFrom net:atomClass_original_o2, + net:atomClass_person_p ; + net:coverBaseNode :leaf_person_p ; + net:coverNode :leaf_original_o2, + :leaf_person_p ; + net:hasMotherClassNet net:atomClass_person_p ; + net:hasNaming "original-person" ; + net:hasStructure "unknown" . + +net:netProperty a owl:AnnotationProperty ; + rdfs:label "netProperty" . + +:AMR_ObjectProperty a owl:ObjectProperty ; + rdfs:subPropertyOf owl:topObjectProperty . + +:AMR_Structure a owl:Class . + +:leaf_copyright-01_c a :AMR_Leaf ; + :edge_c_w :leaf_work-01_w ; + :hasConcept :concept_copyright-01 ; + :hasVariable :variable_c . + +:leaf_work-01_w a :AMR_Leaf ; + :hasConcept :concept_work-01 ; + :hasVariable :variable_w . + +cprm:configParamProperty a rdf:Property ; + rdfs:label "Config Parameter Property" . + +net:Relation a owl:Class ; + rdfs:subClassOf net:Net_Structure . + +ns21:Frame a ns21:Concept, + owl:Class, + owl:NamedIndividual ; + rdfs:label "AMR-PropBank-Frame" ; + rdfs:subClassOf :AMR_Linked_Data . + +rdf:Property a owl:Class . + +:AMR_Predicat_Concept a owl:Class ; + rdfs:subClassOf :AMR_Concept . + +:AMR_Relation a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +net:Atom_Class_Net a owl:Class ; + rdfs:subClassOf net:Class_Net . + +net:Atom_Property_Net a owl:Class ; + rdfs:subClassOf net:Property_Net . + +net:atomClass_intact_ii a net:Atom_Class_Net ; + net:coverBaseNode :leaf_intact_ii ; + net:coverNode :leaf_intact_ii ; + net:hasClassName "intact" ; + net:hasNaming "intact" ; + net:hasStructure "unknown" . + +:leaf_credit-01_c2 a :AMR_Leaf ; + :edge_c2_p :leaf_person_p ; + :edge_c2_y :leaf_you_y ; + :hasConcept :concept_credit-01 ; + :hasVariable :variable_c2 . + +:leaf_original_o2 a :AMR_Leaf ; + :hasConcept :concept_original ; + :hasVariable :variable_o2 . + +net:Net a owl:Class ; + rdfs:subClassOf net:Net_Structure . + +net:has_object a owl:AnnotationProperty ; + rdfs:label "relation" ; + rdfs:subPropertyOf net:netProperty . + +ns11:FrameRole a ns21:Role, + owl:Class, + owl:NamedIndividual ; + rdfs:label "AMR-PropBank-Role" ; + rdfs:subClassOf :AMR_Linked_Data . + +:AMR_Op_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +net:Deprecated_Net a owl:Class ; + rdfs:subClassOf net:Net . + +:AMR_AnnotationProperty a owl:AnnotationProperty . + +:AMR_Core_Role a owl:Class ; + rdfs:subClassOf :AMR_Role . + +:leaf_intact_ii a :AMR_Leaf ; + :hasConcept :concept_intact ; + :hasVariable :variable_ii . + +:leaf_keep-01_k a :AMR_Leaf ; + :edge_k_n :leaf_notice-03_n ; + :edge_k_y :leaf_you_y ; + :hasConcept :concept_keep-01 ; + :hasVariable :variable_k . + +net:atomClass_you_y a net:Atom_Class_Net ; + net:coverBaseNode :leaf_you_y ; + net:coverNode :leaf_you_y ; + net:hasClassName "you" ; + net:hasNaming "you" ; + net:hasStructure "unknown" . + +:leaf_person_p a :AMR_Leaf ; + :edge_p_o2 :leaf_original_o2 ; + :hasConcept :concept_person ; + :hasVariable :variable_p . + +:AMR_Variable a owl:Class ; + rdfs:subClassOf :AMR_Element . + +:leaf_notice-03_n a :AMR_Leaf ; + :edge_n_a2 :leaf_all_a2 ; + :edge_n_c :leaf_copyright-01_c ; + :edge_n_ii :leaf_intact_ii ; + :hasConcept :concept_notice-03 ; + :hasVariable :variable_n . + +:leaf_you_y a :AMR_Leaf ; + :hasConcept :concept_you ; + :hasVariable :variable_y . + +:AMR_Leaf a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +net:objectValue a owl:AnnotationProperty ; + rdfs:label "valuations"@fr ; + rdfs:subPropertyOf net:objectProperty . + +:AMR_Edge a owl:Class ; + rdfs:subClassOf :AMR_Structure . + +:AMR_Linked_Data a owl:Class . + +[] a owl:AllDisjointClasses ; + owl:members ( sys:Degree sys:Entity sys:Feature ) . + diff --git a/tests/main_tests/test_owl_output/SolarSystemDev01-20230619/technical-data/tenet.log b/tests/main_tests/test_owl_output/SolarSystemDev01-20230619/technical-data/tenet.log index f37c38fa..1d63a117 100644 --- a/tests/main_tests/test_owl_output/SolarSystemDev01-20230619/technical-data/tenet.log +++ b/tests/main_tests/test_owl_output/SolarSystemDev01-20230619/technical-data/tenet.log @@ -74,25 +74,25 @@ - DEBUG - ----- Total rule number: 0 - INFO - -- Step 1: Preprocessing - INFO - --- Sequence: Bug fixing for some known anomalies of AMR-LD data -- INFO - ----- fix AMR bug (1): 5/5 new triples (603, 0:00:00.016348) +- INFO - ----- fix AMR bug (1): 5/5 new triples (603, 0:00:00.013727) - INFO - --- Sequence: AMR reification from AMR-Linked-Data to AMR (tenet) structure -- INFO - ----- reclassify AMR-LD concept (1): 10/10 new triples (613, 0:00:00.104394) -- DEBUG - ----- reclassify AMR-LD concept (2): 0/0 new triple (613, 0:00:00.041036) -- INFO - ----- reclassify AMR-LD concept (3): 12/12 new triples (625, 0:00:00.029579) -- INFO - ----- reclassify AMR-LD concept (4): 16/16 new triples (641, 0:00:00.037034) -- INFO - ----- reclassify AMR-LD concept (5): 2/4 new triples (643, 0:00:00.028661) -- INFO - ----- reify roles as concept: 10/10 new triples (653, 0:00:00.034817) -- INFO - ----- reclassify existing variable: 45/45 new triples (698, 0:00:00.021576) -- INFO - ----- add new variable for reified concept: 8/8 new triples (706, 0:00:00.051073) -- INFO - ----- add AMR leaf for reclassified concept: 33/33 new triples (739, 0:00:00.022098) -- INFO - ----- add AMR leaf for reified concept: 8/8 new triples (747, 0:00:00.010743) -- INFO - ----- add AMR edge for core relation: 27/27 new triples (774, 0:00:00.101181) -- INFO - ----- add AMR edge for reified concept: 12/12 new triples (786, 0:00:00.101048) -- INFO - ----- add AMR edge for name relation: 5/5 new triples (791, 0:00:00.017953) -- DEBUG - ----- add AMR edge for quant relation: 0/0 new triple (791, 0:00:00.018448) -- INFO - ----- add AMR edge for polarity relation: 5/5 new triples (796, 0:00:00.021828) -- INFO - ----- update AMR edge role 1: 15/15 new triples (811, 0:00:00.093312) -- INFO - ----- add AMR root: 5/5 new triples (816, 0:00:00.008598) +- INFO - ----- reclassify AMR-LD concept (1): 10/10 new triples (613, 0:00:00.102046) +- DEBUG - ----- reclassify AMR-LD concept (2): 0/0 new triple (613, 0:00:00.035638) +- INFO - ----- reclassify AMR-LD concept (3): 12/12 new triples (625, 0:00:00.024475) +- INFO - ----- reclassify AMR-LD concept (4): 16/16 new triples (641, 0:00:00.049183) +- INFO - ----- reclassify AMR-LD concept (5): 2/4 new triples (643, 0:00:00.024237) +- INFO - ----- reify roles as concept: 10/10 new triples (653, 0:00:00.037749) +- INFO - ----- reclassify existing variable: 45/45 new triples (698, 0:00:00.014843) +- INFO - ----- add new variable for reified concept: 8/8 new triples (706, 0:00:00.037556) +- INFO - ----- add AMR leaf for reclassified concept: 33/33 new triples (739, 0:00:00.020620) +- INFO - ----- add AMR leaf for reified concept: 8/8 new triples (747, 0:00:00.015252) +- INFO - ----- add AMR edge for core relation: 27/27 new triples (774, 0:00:00.096083) +- INFO - ----- add AMR edge for reified concept: 12/12 new triples (786, 0:00:00.100739) +- INFO - ----- add AMR edge for name relation: 5/5 new triples (791, 0:00:00.022779) +- DEBUG - ----- add AMR edge for quant relation: 0/0 new triple (791, 0:00:00.021598) +- INFO - ----- add AMR edge for polarity relation: 5/5 new triples (796, 0:00:00.027386) +- INFO - ----- update AMR edge role 1: 15/15 new triples (811, 0:00:00.087991) +- INFO - ----- add AMR root: 5/5 new triples (816, 0:00:00.013392) - DEBUG - --- Serializing graph to tenet.tetras-libre.fr_demo_01_Preprocessing - DEBUG - ----- step: Preprocessing - DEBUG - ----- id: https://tenet.tetras-libre.fr/demo/01/ @@ -101,38 +101,38 @@ - INFO - ----- 218 triples extracted during Preprocessing step - INFO - -- Step 2: Transduction - INFO - --- Sequence: atomic extraction sequence -- INFO - ----- extract atom classes: 30/30 new triples (846, 0:00:00.145863) -- INFO - ----- extract atom individuals: 8/8 new triples (854, 0:00:00.047902) -- INFO - ----- extract atomic properties: 75/75 new triples (929, 0:00:00.209895) -- INFO - ----- extract atom values: 10/10 new triples (939, 0:00:00.059677) -- INFO - ----- extract atom phenomena: 14/14 new triples (953, 0:00:00.179188) -- INFO - ----- propagate atom relations: 24/68 new triples (977, 0:00:00.946610) +- INFO - ----- extract atom classes: 30/30 new triples (846, 0:00:00.166598) +- INFO - ----- extract atom individuals: 8/8 new triples (854, 0:00:00.051466) +- INFO - ----- extract atomic properties: 75/75 new triples (929, 0:00:00.228471) +- INFO - ----- extract atom values: 10/10 new triples (939, 0:00:00.055753) +- INFO - ----- extract atom phenomena: 14/14 new triples (953, 0:00:00.064567) +- INFO - ----- propagate atom relations: 24/68 new triples (977, 0:00:01.186283) - INFO - --- Sequence: classification sequence (1) -- DEBUG - ----- classify modality phenomena: 0/0 new triple (977, 0:00:00.022617) -- INFO - ----- reclassify argument property to class: 11/14 new triples (988, 0:00:00.091572) +- DEBUG - ----- classify modality phenomena: 0/0 new triple (977, 0:00:00.022301) +- INFO - ----- reclassify argument property to class: 11/14 new triples (988, 0:00:00.064270) - INFO - --- Sequence: phenomena analyze sequence (1) -- INFO - ----- analyze "polarity" phenomena (1): 32/36 new triples (1020, 0:00:00.084741) -- DEBUG - ----- analyze "polarity" phenomena (2): 0/0 new triple (1020, 0:00:00.011784) -- DEBUG - ----- analyze "polarity" phenomena (3): 0/0 new triple (1020, 0:00:00.011639) -- DEBUG - ----- analyze "polarity" phenomena (4): 0/0 new triple (1020, 0:00:00.024011) -- DEBUG - ----- analyze "polarity" phenomena (5): 0/0 new triple (1020, 0:00:00.024839) -- DEBUG - ----- analyze modifier phenomena (mod): 0/0 new triple (1020, 0:00:00.011526) -- DEBUG - ----- classify modality phenomena: 0/0 new triple (1020, 0:00:00.017848) +- INFO - ----- analyze "polarity" phenomena (1): 32/36 new triples (1020, 0:00:00.079891) +- DEBUG - ----- analyze "polarity" phenomena (2): 0/0 new triple (1020, 0:00:00.016110) +- DEBUG - ----- analyze "polarity" phenomena (3): 0/0 new triple (1020, 0:00:00.010791) +- DEBUG - ----- analyze "polarity" phenomena (4): 0/0 new triple (1020, 0:00:00.026243) +- DEBUG - ----- analyze "polarity" phenomena (5): 0/0 new triple (1020, 0:00:00.028180) +- DEBUG - ----- analyze modifier phenomena (mod): 0/0 new triple (1020, 0:00:00.007024) +- DEBUG - ----- classify modality phenomena: 0/0 new triple (1020, 0:00:00.015446) - INFO - --- Sequence: phenomena analyze sequence (2) -- INFO - ----- analyze "or" phenomena (1): 1/1 new triple (1021, 0:00:00.055665) -- INFO - ----- analyze "or" phenomena (2): 55/82 new triples (1076, 0:00:00.215218) -- INFO - ----- analyze "and" phenomena (1): 2/14 new triples (1078, 0:00:00.139021) -- DEBUG - ----- analyze "and" phenomena (2): 0/0 new triple (1078, 0:00:00.009788) +- INFO - ----- analyze "or" phenomena (1): 1/1 new triple (1021, 0:00:00.062483) +- INFO - ----- analyze "or" phenomena (2): 55/82 new triples (1076, 0:00:00.259668) +- INFO - ----- analyze "and" phenomena (1): 2/14 new triples (1078, 0:00:00.133977) +- DEBUG - ----- analyze "and" phenomena (2): 0/0 new triple (1078, 0:00:00.011088) - INFO - --- Sequence: composite class extraction sequence -- INFO - ----- extract composite classes (1): 127/138 new triples (1205, 0:00:00.403559) -- DEBUG - ----- extract composite classes (2): 0/0 new triple (1205, 0:00:00.022075) +- INFO - ----- extract composite classes (1): 127/138 new triples (1205, 0:00:00.678866) +- DEBUG - ----- extract composite classes (2): 0/0 new triple (1205, 0:00:00.032421) - INFO - --- Sequence: classification sequence (2) -- INFO - ----- classify class net as entity from core arguments: 10/181 new triples (1215, 0:00:00.205380) -- DEBUG - ----- classify class net as entity from :part relation: 0/0 new triple (1215, 0:00:00.008522) -- DEBUG - ----- classify class net as entity from degree arguments: 0/0 new triple (1215, 0:00:00.018773) -- INFO - ----- Associate mother to class net from :domain relation: 5/34 new triples (1220, 0:00:00.069305) -- DEBUG - ----- Propagate individuals to net with same base node: 0/10 new triple (1220, 0:00:00.020806) -- INFO - ----- Propagate individuals to net with domain link: 3/60 new triples (1223, 0:00:00.090344) +- INFO - ----- classify class net as entity from core arguments: 10/181 new triples (1215, 0:00:00.315021) +- DEBUG - ----- classify class net as entity from :part relation: 0/0 new triple (1215, 0:00:00.006949) +- DEBUG - ----- classify class net as entity from degree arguments: 0/0 new triple (1215, 0:00:00.013678) +- INFO - ----- Associate mother to class net from :domain relation: 5/34 new triples (1220, 0:00:00.063377) +- DEBUG - ----- Propagate individuals to net with same base node: 0/10 new triple (1220, 0:00:00.037388) +- INFO - ----- Propagate individuals to net with domain link: 3/60 new triples (1223, 0:00:00.086824) - DEBUG - --- Serializing graph to tenet.tetras-libre.fr_demo_01_Transduction - DEBUG - ----- step: Transduction - DEBUG - ----- id: https://tenet.tetras-libre.fr/demo/01/ @@ -141,9 +141,9 @@ - INFO - ----- 407 triples extracted during Transduction step - INFO - -- Step 3: Generation - INFO - --- Sequence: OWL Generation Sequence -- INFO - ----- generate OWL class: 52/55 new triples (1275, 0:00:00.447039) -- INFO - ----- generate OWL property: 29/29 new triples (1304, 0:00:00.228817) -- INFO - ----- generate OWL individual: 6/7 new triples (1310, 0:00:00.057645) +- INFO - ----- generate OWL class: 52/55 new triples (1275, 0:00:00.580395) +- INFO - ----- generate OWL property: 29/29 new triples (1304, 0:00:00.336500) +- INFO - ----- generate OWL individual: 6/7 new triples (1310, 0:00:00.077354) - DEBUG - --- Serializing graph to tenet.tetras-libre.fr_demo_01_Generation - DEBUG - ----- step: Generation - DEBUG - ----- id: https://tenet.tetras-libre.fr/demo/01/ -- GitLab