From f64f833525cc6ca60644d4b821a29b265a4278f3 Mon Sep 17 00:00:00 2001 From: cmungall Date: Tue, 23 Oct 2018 13:05:44 -0700 Subject: [PATCH 1/2] Added make targets for integration tests, see #272 --- src/ontology/Makefile | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/ontology/Makefile b/src/ontology/Makefile index ca2eaabe..e3f6ae85 100644 --- a/src/ontology/Makefile +++ b/src/ontology/Makefile @@ -116,6 +116,53 @@ subsets/ro-hom.owl: ro.owl subsets/ro-chado.obo: ro.obo owltools --use-catalog $< --merge-imports-closure --remove-tbox --remove-annotation-assertions -r -l -s -d --remove-dangling --set-ontology-id $(OBO)/ro/$@ -o -f obo $@.tmp && ../tools/translate-to-chado-obo.pl $@.tmp > $@ +# ======================================== +# INTEGRATION TESTS +# ======================================== +# See https://github.com/oborel/obo-relations/issues/272 + +# initial test list, this will be expanded +# Criteria: each ontology must provide a base +INTEGRATED_ONTS = uberon cl go + +# All integration tests +it_tests: individual_it_tests it-combined.txt it-diff.obodiff + +# Run integration tests on an ontology by ontology basis. +# Note: this will be less complete that running once on the combined +# set. However, this is useful for debugging. +individual_it_tests: $(patsubst %, it-base-%.txt, $(INTEGRATED_ONTS)) + +# perform integration test on an individual ontology +it-base-%.txt: ro-edit.owl + robot merge -i $< -i $(OBO)/$*/$*-base.owl reason -r elk && touch $@ + +INTEGRATED_ONTS_I := $(foreach ont,$(INTEGRATED_ONTS),-i $(OBO)/$(ont)/$(ont)-base.owl) + +# make a merger of bases of integrated ontologies, plus BFO. +# TODO: build this in advance and distribute it separately, to make +# this fast enough for running in travis. +mirror/ext-combined.owl: + robot merge $(INTEGRATED_ONTS_I) -i $(OBO)/bfo.owl -o $@ + +# run an integration test on integrated ontologies plus ro-edit +it-combined.txt: ext-combined.owl ro-edit.owl + robot merge -i ro-edit.owl -i $< reason -r elk && touch $@ + +# merge integrated onts plus ro-edit +it-inferences-current.obo: ext-combined.owl ro-edit.owl + robot merge -i ro-edit.owl -i $< reason -n true -r elk -o $@ + +# merge integrated onts plus last released RO +it-inferences-release.obo: ext-combined.owl + robot merge -i $(OBO)/ro.owl -i $< reason -n true -r elk -o $@ + +# How do changes in RO impact downstream ontologies? +# We do this as an obodiff for now for speed and readability; +# Will later switch to markdown diffs when integrated in robot +it-diff.obodiff: it-inferences-release.obo it-inferences-current.obo + diff -u $^ > $@ + # ======================================== # REPORTING (EXPERIMENTAL) # ======================================== From 56bb4edeb4d157bc346064a5f8671b0b5c0457af Mon Sep 17 00:00:00 2001 From: cmungall Date: Tue, 30 Oct 2018 07:59:35 -0700 Subject: [PATCH 2/2] fix --- src/ontology/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ontology/Makefile b/src/ontology/Makefile index e3f6ae85..0191407e 100644 --- a/src/ontology/Makefile +++ b/src/ontology/Makefile @@ -137,24 +137,24 @@ individual_it_tests: $(patsubst %, it-base-%.txt, $(INTEGRATED_ONTS)) it-base-%.txt: ro-edit.owl robot merge -i $< -i $(OBO)/$*/$*-base.owl reason -r elk && touch $@ -INTEGRATED_ONTS_I := $(foreach ont,$(INTEGRATED_ONTS),-i $(OBO)/$(ont)/$(ont)-base.owl) +INTEGRATED_ONTS_I := $(foreach ont,$(INTEGRATED_ONTS),-I $(OBO)/$(ont)/$(ont)-base.owl) # make a merger of bases of integrated ontologies, plus BFO. # TODO: build this in advance and distribute it separately, to make # this fast enough for running in travis. mirror/ext-combined.owl: - robot merge $(INTEGRATED_ONTS_I) -i $(OBO)/bfo.owl -o $@ + robot merge $(INTEGRATED_ONTS_I) -I $(OBO)/bfo.owl -o $@ # run an integration test on integrated ontologies plus ro-edit -it-combined.txt: ext-combined.owl ro-edit.owl +it-combined.txt: mirror/ext-combined.owl ro-edit.owl robot merge -i ro-edit.owl -i $< reason -r elk && touch $@ # merge integrated onts plus ro-edit -it-inferences-current.obo: ext-combined.owl ro-edit.owl +it-inferences-current.obo: mirror/ext-combined.owl ro-edit.owl robot merge -i ro-edit.owl -i $< reason -n true -r elk -o $@ # merge integrated onts plus last released RO -it-inferences-release.obo: ext-combined.owl +it-inferences-release.obo: mirror/ext-combined.owl robot merge -i $(OBO)/ro.owl -i $< reason -n true -r elk -o $@ # How do changes in RO impact downstream ontologies?