From 0acc87e7b63c06a393410c55b5178ba971348d30 Mon Sep 17 00:00:00 2001 From: Nico Matentzoglu Date: Mon, 11 Nov 2024 11:46:53 +0200 Subject: [PATCH 1/3] Normalise docs/examples/uberon_axiom_annotation_merging.owl This is so the diff will be easier to read for the extended repair check I intend to add in the next commit. --- .../uberon_axiom_annotation_merging.owl | 76 ++++++++++--------- 1 file changed, 40 insertions(+), 36 deletions(-) diff --git a/docs/examples/uberon_axiom_annotation_merging.owl b/docs/examples/uberon_axiom_annotation_merging.owl index 57dfd7f26..8db483343 100644 --- a/docs/examples/uberon_axiom_annotation_merging.owl +++ b/docs/examples/uberon_axiom_annotation_merging.owl @@ -1,14 +1,14 @@ + xmlns:oboInOwl="http://www.geneontology.org/formats/oboInOwl#"> @@ -214,11 +214,11 @@ - BFO:0000050 - uberon - part_of - part_of - part_of + BFO:0000050 + uberon + part_of + part_of + part_of @@ -227,11 +227,11 @@ - BFO:0000051 - uberon - has_part - has_part - has_part + BFO:0000051 + uberon + has_part + has_part + has_part @@ -256,53 +256,57 @@ - Anatomical structure that performs a specific function or group of functions [WP]. + Anatomical structure that performs a specific function or group of functions [WP]. - WBbt:0003760 - anatomical unit - body organ - element - UBERON:0000062 - organ + WBbt:0003760 + anatomical unit + body organ + element + UBERON:0000062 + organ - - body organ - + + Anatomical structure that performs a specific function or group of functions [WP]. + - - body organ - + + Anatomical structure that performs a specific function or group of functions [WP]. + - body organ + body organ - - Anatomical structure that performs a specific function or group of functions [WP]. - + + body organ + - - Anatomical structure that performs a specific function or group of functions [WP]. - + + body organ + - + + + + + - + From c4e9708a1c1a7aefc5693fd20333878c1b1a1b9a Mon Sep 17 00:00:00 2001 From: Nico Matentzoglu Date: Mon, 11 Nov 2024 12:03:33 +0200 Subject: [PATCH 2/3] Remove restriction on ROBOT repair to work only on annotation axioms For some reason, ROBOT repair --merge-axiom-annotations not only was restricted to annotation axioms (which is wrong), it also drops logical axioms with annotations as they are (1) first added to the heap of axioms that need to be processed, (2) dropped from the ontology because they are in that heap and finally (3) because of the wrong conditional we are fixing here, not added back. Adding and example for axiom annotation merging on subclass axioms to our test case --- .../uberon_axiom_annotation_merged.owl | 16 +++++++++++++++- .../uberon_axiom_annotation_merging.owl | 19 +++++++++++++++++++ .../org/obolibrary/robot/RepairOperation.java | 6 ++---- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/docs/examples/uberon_axiom_annotation_merged.owl b/docs/examples/uberon_axiom_annotation_merged.owl index 9c663e17d..5e7cc9365 100644 --- a/docs/examples/uberon_axiom_annotation_merged.owl +++ b/docs/examples/uberon_axiom_annotation_merged.owl @@ -247,9 +247,16 @@ + + + + + + + @@ -268,6 +275,13 @@ UBERON:0000062 organ + + + + + Comment A + Comment B + @@ -293,5 +307,5 @@ - + diff --git a/docs/examples/uberon_axiom_annotation_merging.owl b/docs/examples/uberon_axiom_annotation_merging.owl index 8db483343..7b2bb6633 100644 --- a/docs/examples/uberon_axiom_annotation_merging.owl +++ b/docs/examples/uberon_axiom_annotation_merging.owl @@ -247,9 +247,16 @@ + + + + + + + @@ -268,6 +275,18 @@ UBERON:0000062 organ + + + + + Comment A + + + + + + Comment B + diff --git a/robot-core/src/main/java/org/obolibrary/robot/RepairOperation.java b/robot-core/src/main/java/org/obolibrary/robot/RepairOperation.java index c9e885d87..fc05a12c2 100644 --- a/robot-core/src/main/java/org/obolibrary/robot/RepairOperation.java +++ b/robot-core/src/main/java/org/obolibrary/robot/RepairOperation.java @@ -152,10 +152,8 @@ public static void mergeAxiomAnnotations(OWLOntology ontology) { Set newAxioms = new HashSet<>(); for (Map.Entry> mergedAxiom : mergedAxioms.entrySet()) { OWLAxiom axiom = mergedAxiom.getKey(); - if (axiom.isAnnotationAxiom()) { - OWLAxiom newAxiom = axiom.getAnnotatedAxiom(mergedAxiom.getValue()); - newAxioms.add(newAxiom); - } + OWLAxiom newAxiom = axiom.getAnnotatedAxiom(mergedAxiom.getValue()); + newAxioms.add(newAxiom); } manager.addAxioms(ontology, newAxioms); } From 1d3a6ba577441dd7df8f4267e285e163d9d52243 Mon Sep 17 00:00:00 2001 From: Nico Matentzoglu Date: Mon, 11 Nov 2024 12:05:50 +0200 Subject: [PATCH 3/3] Add repair axiom annotation merge bug to Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba03d1543..adfd17655 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Output inferred object property assertions using Whelk reasoner, by updating to Whelk 1.1.3. [#1121] +- Bug was fixed that caused logical axioms with axiom annotations not to be processed correctly when merging axiom annotations [#1223] ### Changed - Update Whelk to 1.2.1 [#1221]