From cdf013d6a19a23091de1bdbde84dd666f61d4317 Mon Sep 17 00:00:00 2001 From: Anita Caron Date: Mon, 26 Jun 2023 15:32:53 +0100 Subject: [PATCH] add common-anatomy.owl artifact --- .gitignore | 1 + src/ontology/Makefile | 11 ++++++++++- src/ontology/uberon-odk.yaml | 1 + src/ontology/uberon.Makefile | 10 ++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index bd2f91d38d..05b083ca9e 100644 --- a/.gitignore +++ b/.gitignore @@ -204,6 +204,7 @@ uberon-base.obo uberon-basic.* uberon-full.* uberon-simple.* +common-anatomy.* patterns/definitions.owl patterns/pattern.owl subsets/*.json diff --git a/src/ontology/Makefile b/src/ontology/Makefile index 84a536a80a..4a755541d7 100644 --- a/src/ontology/Makefile +++ b/src/ontology/Makefile @@ -62,7 +62,7 @@ PATTERN_RELEASE_FILES= $(PATTERNDIR)/definitions.owl $(PATTERNDIR)/pattern. FORMATS = $(sort owl obo json owl) FORMATS_INCL_TSV = $(sort $(FORMATS) tsv) -RELEASE_ARTEFACTS = $(sort $(ONT)-base $(ONT)-full $(ONT)-simple $(ONT)-basic ext basic composite-metazoan composite-metazoan-basic composite-vertebrate composite-vertebrate-basic ) +RELEASE_ARTEFACTS = $(sort $(ONT)-base $(ONT)-full $(ONT)-simple $(ONT)-basic ext basic composite-metazoan composite-metazoan-basic composite-vertebrate composite-vertebrate-basic common-anatomy ) # ---------------------------------------- # Top-level targets @@ -703,6 +703,12 @@ composite-vertebrate-basic.json: composite-vertebrate-basic.owl $(ROBOT) annotate --input $< --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \ convert --check false -f json -o $@.tmp.json &&\ mv $@.tmp.json $@ +common-anatomy.obo: common-anatomy.owl + $(ROBOT) convert --input $< --check false -f obo $(OBO_FORMAT_OPTIONS) -o $@.tmp.obo && grep -v ^owl-axioms $@.tmp.obo > $@ && rm $@.tmp.obo +common-anatomy.json: common-anatomy.owl + $(ROBOT) annotate --input $< --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \ + convert --check false -f json -o $@.tmp.json &&\ + mv $@.tmp.json $@ # ---------------------------------------- # Release artefacts: main release artefacts # ---------------------------------------- @@ -791,6 +797,9 @@ composite-vertebrate.owl: composite-vertebrate-basic.owl: echo "ERROR: You have configured a custom release artefact ($@); this release artefact needs to be define in uberon.Makefile!" && false + +common-anatomy.owl: + echo "ERROR: You have configured a custom release artefact ($@); this release artefact needs to be define in uberon.Makefile!" && false # ---------------------------------------- # Debugging Tools # ---------------------------------------- diff --git a/src/ontology/uberon-odk.yaml b/src/ontology/uberon-odk.yaml index 823459f78b..3e399e3adb 100644 --- a/src/ontology/uberon-odk.yaml +++ b/src/ontology/uberon-odk.yaml @@ -26,6 +26,7 @@ release_artefacts: - custom-composite-metazoan-basic - custom-composite-vertebrate - custom-composite-vertebrate-basic + - custom-common-anatomy edit_format: obo import_group: use_base_merging: TRUE diff --git a/src/ontology/uberon.Makefile b/src/ontology/uberon.Makefile index 2f30bfb758..a338850582 100644 --- a/src/ontology/uberon.Makefile +++ b/src/ontology/uberon.Makefile @@ -254,6 +254,16 @@ subsets/cumbo.obo: subsets/cumbo.owl #supercheck.owl: $(TMPDIR)/unreasoned.owl # owltools $(UCAT) $< $(COMPONENTSDIR)/phenoscape-ext.owl --merge-support-ontologies --expand-macros --assert-inferred-subclass-axioms --useIsInferred -o -f functional $@ +# ---------------------------------------- +# STEP 6: Create common anatomy subset +# ---------------------------------------- + +common-anatomy.owl: $(ONT).owl + $(OWLTOOLS) $< --extract-ontology-subset --fill-gaps --subset common_anatomy -o $@.tmp.owl && mv $@.tmp.owl $@ &&\ + $(ROBOT) annotate --input $@ --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $@.tmp.owl && mv $@.tmp.owl $@ +.PRECIOUS: common-anatomy.owl + + # ---------------------------------------- # IMPORTS