From bdd7f4d4cadab8630640382bece5e0b94c10d370 Mon Sep 17 00:00:00 2001 From: Joe Flack Date: Sun, 12 Jan 2025 19:44:42 -0500 Subject: [PATCH 1/2] Bug fix: ICD11 MONDO:GENERATED synonyms - Temporarily disabled MONDO:GENERATED synonyms from being created, as there are currently some edge cases where we are creating synonyms that are not mutated as intended. --- src/ontology/mondo-ingest.Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ontology/mondo-ingest.Makefile b/src/ontology/mondo-ingest.Makefile index a02640205..71e0e7267 100644 --- a/src/ontology/mondo-ingest.Makefile +++ b/src/ontology/mondo-ingest.Makefile @@ -170,7 +170,6 @@ $(COMPONENTSDIR)/icd11foundation.owl: $(TMPDIR)/icd11foundation_relevant_signatu remove -T $(TMPDIR)/icd11foundation_relevant_signature.txt --select complement --select "classes individuals" \ remove -T $(TMPDIR)/icd11foundation_relevant_signature.txt --select individuals \ query \ - --update ../sparql/fix-labels-with-brackets.ru \ --update ../sparql/exact_syn_from_label.ru \ remove -T config/properties.txt --select complement --select properties --trim true \ annotate --ontology-iri $(URIBASE)/mondo/sources/icd11foundation.owl --version-iri $(URIBASE)/mondo/sources/$(TODAY)/icd11foundation.owl -o $@; fi From 03f7f273e4ac91abee55664de98b8370a119248a Mon Sep 17 00:00:00 2001 From: Trish Whetzel Date: Fri, 17 Jan 2025 14:32:04 -0800 Subject: [PATCH 2/2] Updated bugfix icd11 generated synonyms (#756) * icd11 specific synonym sparql query fix * add icd11 specific query to makefile for icd11 processing --- src/ontology/mondo-ingest.Makefile | 1 + src/sparql/fix_icd11_synonyms.ru | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 src/sparql/fix_icd11_synonyms.ru diff --git a/src/ontology/mondo-ingest.Makefile b/src/ontology/mondo-ingest.Makefile index 71e0e7267..b9caa8682 100644 --- a/src/ontology/mondo-ingest.Makefile +++ b/src/ontology/mondo-ingest.Makefile @@ -171,6 +171,7 @@ $(COMPONENTSDIR)/icd11foundation.owl: $(TMPDIR)/icd11foundation_relevant_signatu remove -T $(TMPDIR)/icd11foundation_relevant_signature.txt --select individuals \ query \ --update ../sparql/exact_syn_from_label.ru \ + --update ../sparql/fix_icd11_synonyms.ru \ remove -T config/properties.txt --select complement --select properties --trim true \ annotate --ontology-iri $(URIBASE)/mondo/sources/icd11foundation.owl --version-iri $(URIBASE)/mondo/sources/$(TODAY)/icd11foundation.owl -o $@; fi diff --git a/src/sparql/fix_icd11_synonyms.ru b/src/sparql/fix_icd11_synonyms.ru new file mode 100644 index 000000000..d70e75c67 --- /dev/null +++ b/src/sparql/fix_icd11_synonyms.ru @@ -0,0 +1,24 @@ +PREFIX oboInOwl: + +# Fix synonym formatting for ICD11 where (MIM ######) or (OMIM ######) is appended to the synonym + +DELETE { + ?class oboInOwl:hasExactSynonym ?exactSynonym . +} + +INSERT { + ?class oboInOwl:hasExactSynonym ?updatedSynonym . +} + +WHERE { + # Match exact synonyms containing "(MIM ######)" or "(OMIM ###)" + ?class oboInOwl:hasExactSynonym ?exactSynonym . + FILTER(regex(str(?exactSynonym), "\\((MIM \\d{6}|OMIM\\s+#\\d{6})\\)")) + + # Remove the "(MIM ######)" or "(OMIM ###)" part + BIND(REPLACE(STR(?exactSynonym), "\\s*\\((MIM \\d{6}|OMIM\\s+#\\d{6})\\)", "") AS ?updatedSynonym) + + # Ensure the updated synonym is different + FILTER(?exactSynonym != ?updatedSynonym) +} +