diff --git a/tenet/scheme/amr_master_rule/transduction/heuristic_deducer/refine_mother_relation_1.py b/tenet/scheme/amr_master_rule/transduction/heuristic_deducer/refine_mother_relation_1.py index c39e8b9e53c330016996ed621e80df1d4b4f6b82..25352e931f3935bb3bdaa08c1fa7ddfef6a5d774 100644 --- a/tenet/scheme/amr_master_rule/transduction/heuristic_deducer/refine_mother_relation_1.py +++ b/tenet/scheme/amr_master_rule/transduction/heuristic_deducer/refine_mother_relation_1.py @@ -90,9 +90,14 @@ def refine_mother_relation(graph): for row in parent_class_set: if pattern.target_class_net != row.parent_class_net: - # Associate mother relation between class nets + # Associate mother relation between target and found parent new_triples = __associate_mother_relation(graph, pattern.target_class_net, row.parent_class_net) rule_triple_list.extend(new_triples) + + if len(parent_class_set) == 0: # no parent found + # Associate mother relation between target and origin mother + new_triples = __associate_mother_relation(graph, pattern.target_class_net, pattern.mother_class_net) + rule_triple_list.extend(new_triples) return rule_label, rule_triple_list diff --git a/tests/main_tests/test_main_owl_extraction.py b/tests/main_tests/test_main_owl_extraction.py index 7ee428d0bf8dd44763aaeda6e0830d959f639988..a89785c4312a0625fb6f3ad8634bc37a66562a5b 100644 --- a/tests/main_tests/test_main_owl_extraction.py +++ b/tests/main_tests/test_main_owl_extraction.py @@ -56,7 +56,7 @@ test_data_dir = f'{INPUT_DIR_PATH}amrDocuments/' # onto_prefix = f'SimpleTest' # base_output_name = f'SimpleTest' -uuid_num = '01' +uuid_num = '02' amrld_dir_path = f'{test_data_dir}dev/solar-system-{uuid_num}/' amrld_file_path = f'{amrld_dir_path}SSC-{uuid_num}-01.stog.amr.ttl' base_output_name = f'SolarSystemDev{uuid_num}'