diff --git a/.github/workflows/qc.yml b/.github/workflows/qc.yml index 3502f1c..268f5be 100644 --- a/.github/workflows/qc.yml +++ b/.github/workflows/qc.yml @@ -5,10 +5,10 @@ name: CI # Controls when the action will run. on: # Triggers the workflow on push or pull request events but only for the main branch - #push: - # branches: [ main ] - #pull_request: - # branches: [ main ] + # push: + # branches: [ main ] + # pull_request: + # branches: [ main ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -19,15 +19,15 @@ jobs: ontology_qc: # The type of runner that the job will run on runs-on: ubuntu-latest - container: obolibrary/odkfull:v1.3.0 + container: obolibrary/odkfull:v1.5 # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Run ontology QC checks env: DEFAULT_BRANCH: main - run: cd src/ontology && make ROBOT_ENV='ROBOT_JAVA_ARGS=-Xmx6G' test IMP=false PAT=false + run: cd src/ontology && make ROBOT_ENV='ROBOT_JAVA_ARGS=-Xmx6G' test IMP=false PAT=false MIR=false diff --git a/docs/odk-workflows/ManageDocumentation.md b/docs/odk-workflows/ManageDocumentation.md index 1dd2809..da52d77 100644 --- a/docs/odk-workflows/ManageDocumentation.md +++ b/docs/odk-workflows/ManageDocumentation.md @@ -44,3 +44,4 @@ The documentation is _not_ automatically updated from the Markdown, and needs to Just make sure you give GitHub 2-5 minutes to build the pages! + diff --git a/docs/odk-workflows/RepoManagement.md b/docs/odk-workflows/RepoManagement.md index 724badb..8f2eb1f 100644 --- a/docs/odk-workflows/RepoManagement.md +++ b/docs/odk-workflows/RepoManagement.md @@ -2,7 +2,7 @@ ## Updating your ODK repository -Your ODK repositories configuration is managed in `src/ontology/phenio-odk.yaml`. Once you have made your changes, you can run the following to apply your changes to the repository: +Your ODK repositories configuration is managed in `src/ontology/phenio-odk.yaml`. The [ODK Project Configuration Schema](https://github.com/INCATools/ontology-development-kit/blob/master/docs/project-schema.md) defines all possible parameters that can be used in this config YAML. Once you have made your changes, you can run the following to apply your changes to the repository: ``` diff --git a/docs/odk-workflows/RepositoryFileStructure.md b/docs/odk-workflows/RepositoryFileStructure.md index 6c9b6ef..137f938 100644 --- a/docs/odk-workflows/RepositoryFileStructure.md +++ b/docs/odk-workflows/RepositoryFileStructure.md @@ -46,6 +46,7 @@ These are the components in PHENIO | Filename | URL | | -------- | --- | | bfo.owl | http://purl.obolibrary.org/obo/bfo.owl | +| ddpheno.owl | http://purl.obolibrary.org/obo/ddpheno.owl | | emapa.owl | http://purl.obolibrary.org/obo/emapa.owl | | fbbt.owl | http://purl.obolibrary.org/obo/fbbt.owl | | go.owl | http://purl.obolibrary.org/obo/go.owl | diff --git a/src/ontology/Makefile b/src/ontology/Makefile index c310372..9fa8b42 100644 --- a/src/ontology/Makefile +++ b/src/ontology/Makefile @@ -1,7 +1,7 @@ # ---------------------------------------- # Makefile for phenio # Generated using ontology-development-kit -# ODK Version: v1.4.3 +# ODK Version: v1.5 # ---------------------------------------- # IMPORTANT: DO NOT EDIT THIS FILE. To override default make goals, use phenio.Makefile instead @@ -9,6 +9,9 @@ # ---------------------------------------- # More information: https://github.com/INCATools/ontology-development-kit/ +# Fingerprint of the configuration file when this Makefile was last generated +CONFIG_HASH= 1126eedd8e58276f7dc4423f54c5463ff19cc8d1c79755b1eb65763cea44fb0f + # ---------------------------------------- # Standard Constants @@ -43,14 +46,14 @@ REPORT_PROFILE_OPTS = OBO_FORMAT_OPTIONS = SPARQL_VALIDATION_CHECKS = owldef-self-reference iri-range label-with-iri multiple-replaced_by SPARQL_EXPORTS = basic-report class-count-by-prefix edges xrefs obsoletes synonyms -ODK_VERSION_MAKEFILE = v1.4.3 +ODK_VERSION_MAKEFILE = v1.5 TODAY ?= $(shell date +%Y-%m-%d) OBODATE ?= $(shell date +'%d:%m:%Y %H:%M') VERSION= $(TODAY) ANNOTATE_ONTOLOGY_VERSION = annotate -V $(ONTBASE)/releases/$(VERSION)/$@ --annotation owl:versionInfo $(VERSION) ANNOTATE_CONVERT_FILE = annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) convert -f ofn --output $@.tmp.owl && mv $@.tmp.owl $@ -OTHER_SRC = $(COMPONENTSDIR)/bfo.owl $(COMPONENTSDIR)/emapa.owl $(COMPONENTSDIR)/fbbt.owl $(COMPONENTSDIR)/go.owl $(COMPONENTSDIR)/hsapdv.owl $(COMPONENTSDIR)/mondo.owl $(COMPONENTSDIR)/mpath.owl $(COMPONENTSDIR)/nbo.owl $(COMPONENTSDIR)/ro.owl $(COMPONENTSDIR)/uberon.owl $(COMPONENTSDIR)/upheno.owl $(COMPONENTSDIR)/wbbt.owl $(COMPONENTSDIR)/zfa.owl +OTHER_SRC = $(COMPONENTSDIR)/bfo.owl $(COMPONENTSDIR)/ddpheno.owl $(COMPONENTSDIR)/emapa.owl $(COMPONENTSDIR)/fbbt.owl $(COMPONENTSDIR)/go.owl $(COMPONENTSDIR)/hsapdv.owl $(COMPONENTSDIR)/mondo.owl $(COMPONENTSDIR)/mpath.owl $(COMPONENTSDIR)/nbo.owl $(COMPONENTSDIR)/ro.owl $(COMPONENTSDIR)/uberon.owl $(COMPONENTSDIR)/upheno.owl $(COMPONENTSDIR)/wbbt.owl $(COMPONENTSDIR)/zfa.owl ONTOLOGYTERMS = $(TMPDIR)/ontologyterms.txt EDIT_PREPROCESSED = $(TMPDIR)/$(ONT)-preprocess.owl @@ -58,6 +61,11 @@ FORMATS = $(sort owl json owl) FORMATS_INCL_TSV = $(sort $(FORMATS) tsv) RELEASE_ARTEFACTS = $(sort $(ONT)-base $(ONT)-full ) +ifeq ($(ODK_DEBUG),yes) +ODK_DEBUG_FILE = debug.log +SHELL = $(SCRIPTSDIR)/run-command.sh +endif + # ---------------------------------------- # Top-level targets # ---------------------------------------- @@ -68,12 +76,16 @@ RELEASE_ARTEFACTS = $(sort $(ONT)-base $(ONT)-full ) all: all_odk .PHONY: all_odk -all_odk: odkversion test all_assets +all_odk: odkversion config_check test custom_reports all_assets .PHONY: test test: odkversion reason_test sparql_test robot_reports echo "Finished running all tests successfully." +.PHONY: test +test_fast: + $(MAKE_FAST) test + .PHONY: release_diff release_diff: $(REPORTDIR)/release-diff.md @@ -84,13 +96,52 @@ reason_test: $(EDIT_PREPROCESSED) .PHONY: odkversion odkversion: - echo "ODK Makefile version: $(ODK_VERSION_MAKEFILE) (this is the version of the ODK with which this Makefile was generated, \ - not the version of the ODK you are running)" &&\ - echo "ROBOT version (ODK): " && $(ROBOT) --version + @echo "ODK Makefile $(ODK_VERSION_MAKEFILE)" + @odk-info --tools +.PHONY: config_check +config_check: + @if [ "$$(sha256sum $(ONT)-odk.yaml | cut -c1-64)" = "$(CONFIG_HASH)" ]; then \ + echo "Repository is up-to-date." ; else \ + echo "Your ODK configuration has changed since this Makefile was generated. You may need to run 'make update_repo'." ; fi + $(TMPDIR) $(REPORTDIR) $(MIRRORDIR) $(IMPORTDIR) $(COMPONENTSDIR) $(SUBSETDIR): mkdir -p $@ +# ---------------------------------------- +# ODK-managed ROBOT plugins +# ---------------------------------------- + +# Make sure ROBOT knows where to find plugins +export ROBOT_PLUGINS_DIRECTORY=$(TMPDIR)/plugins + +# Override this rule in phenio.Makefile to install custom plugins +.PHONY: custom_robot_plugins +custom_robot_plugins: + + +.PHONY: extra_robot_plugins +extra_robot_plugins: + + +# Install all ROBOT plugins to the runtime plugins directory +.PHONY: all_robot_plugins +all_robot_plugins: $(foreach plugin,$(notdir $(wildcard /tools/robot-plugins/*.jar)),$(ROBOT_PLUGINS_DIRECTORY)/$(plugin)) \ + $(foreach plugin,$(notdir $(wildcard ../../plugins/*.jar)),$(ROBOT_PLUGINS_DIRECTORY)/$(plugin)) \ + custom_robot_plugins extra_robot_plugins \ + +# Default rule to install plugins +$(ROBOT_PLUGINS_DIRECTORY)/%.jar: + @mkdir -p $(ROBOT_PLUGINS_DIRECTORY) + @if [ -f ../../plugins/$*.jar ]; then \ + ln ../../plugins/$*.jar $@ ; \ + elif [ -f /tools/robot-plugins/$*.jar ]; then \ + cp /tools/robot-plugins/$*.jar $@ ; \ + fi + +# Specific rules for supplementary plugins defined in configuration + + # ---------------------------------------- # Release assets # ---------------------------------------- @@ -180,10 +231,10 @@ validate_profile_%: $(REPORTDIR)/validate_profile_owl2dl_%.txt SPARQL_VALIDATION_QUERIES = $(foreach V,$(SPARQL_VALIDATION_CHECKS),$(SPARQLDIR)/$(V)-violation.sparql) -sparql_test: $(EDIT_PREPROCESSED) catalog-v001.xml | $(REPORTDIR) +sparql_test: $(EDIT_PREPROCESSED) | $(REPORTDIR) ifneq ($(SPARQL_VALIDATION_QUERIES),) - $(ROBOT) verify --catalog catalog-v001.xml -i $(EDIT_PREPROCESSED) --queries $(SPARQL_VALIDATION_QUERIES) -O $(REPORTDIR) + $(ROBOT) verify -i $(EDIT_PREPROCESSED) --queries $(SPARQL_VALIDATION_QUERIES) -O $(REPORTDIR) endif # ---------------------------------------- @@ -196,6 +247,10 @@ $(REPORTDIR)/$(SRC)-obo-report.tsv: $(SRCMERGED) | $(REPORTDIR) $(REPORTDIR)/%-obo-report.tsv: % | $(REPORTDIR) $(ROBOT) report -i $< $(REPORT_LABEL) $(REPORT_PROFILE_OPTS) --fail-on $(REPORT_FAIL_ON) --print 5 -o $@ +check_for_robot_updates: + echo "You are not using a custom profile, so you are getting the joy of the latest ROBOT report!" + + # ---------------------------------------- # Release assets # ---------------------------------------- @@ -213,7 +268,7 @@ RELEASE_ASSETS = \ $(REPORT_FILES) .PHONY: all_assets -all_assets: $(ASSETS) +all_assets: $(ASSETS) check_rdfxml_assets .PHONY: show_assets show_assets: @@ -221,7 +276,7 @@ show_assets: du -sh $(ASSETS) check_rdfxml_%: % - @check-rdfxml $< + @check-rdfxml $< .PHONY: check_rdfxml_assets check_rdfxml_assets: $(foreach product,$(MAIN_PRODUCTS),check_rdfxml_$(product).owl) @@ -309,6 +364,7 @@ $(IMPORTDIR)/merged_import.owl: $(MIRRORDIR)/merged.owl $(IMPORTDIR)/merged_term if [ $(IMP) = true ]; then $(ROBOT) merge -i $< \ remove --select "" remove --select "" remove --select "" remove --select "" remove --select "" \ extract -T $(IMPORTDIR)/merged_terms_combined.txt --force true --copy-ontology-annotations true --individuals exclude --method BOT \ + remove $(patsubst %, --term %, $(ANNOTATION_PROPERTIES)) -T $(IMPORTDIR)/merged_terms_combined.txt --select complement --select annotation-properties \ query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \ $(ANNOTATE_CONVERT_FILE); fi @@ -378,9 +434,9 @@ recreate-%: no-mirror-recreate-%: $(MAKE) COMP=true IMP=false IMP_LARGE=false MIR=false PAT=true $(COMPONENTSDIR)/$*.owl -B -$(COMPONENTSDIR)/%: | $(COMPONENTSDIR) - touch $@ -.PRECIOUS: $(COMPONENTSDIR)/% +$(COMPONENTSDIR)/%.owl: | $(COMPONENTSDIR) + test -f $@ || touch $@ +.PRECIOUS: $(COMPONENTSDIR)/%.owl @@ -389,20 +445,41 @@ component-download-bfo.owl: | $(TMPDIR) if [ $(MIR) = true ] && [ $(COMP) = true ]; then $(ROBOT) merge -I http://purl.obolibrary.org/obo/bfo.owl \ annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $(TMPDIR)/$@.owl; fi -$(COMPONENTSDIR)/bfo.owl: component-download-bfo.owl - if [ $(COMP) = true ] ; then if cmp -s $(TMPDIR)/component-download-bfo.owl.owl $@ ; then echo "Component identical."; else echo "Component is different, updating." && cp $(TMPDIR)/component-download-bfo.owl.owl $@; fi; fi +$(COMPONENTSDIR)/bfo.owl: component-download-bfo.owl + if [ $(COMP) = true ]; then if cmp -s $(TMPDIR)/component-download-bfo.owl.owl $(TMPDIR)/component-download-bfo.owl.tmp.owl ; then echo "Component identical."; \ + else echo "Component is different, updating." &&\ + cp $(TMPDIR)/component-download-bfo.owl.owl $(TMPDIR)/component-download-bfo.owl.tmp.owl &&\ + $(ROBOT) annotate -i $(TMPDIR)/component-download-bfo.owl.owl --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $@; fi; fi .PRECIOUS: $(COMPONENTSDIR)/bfo.owl +.PHONY: component-download-ddpheno.owl +component-download-ddpheno.owl: | $(TMPDIR) + if [ $(MIR) = true ] && [ $(COMP) = true ]; then $(ROBOT) merge -I http://purl.obolibrary.org/obo/ddpheno.owl \ + remove --base-iri http://purl.obolibrary.org/obo/ddpheno# --base-iri http://purl.obolibrary.org/obo/DDPHENO_ --axioms external --preserve-structure false --trim false \ + annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $(TMPDIR)/$@.owl; fi + +$(COMPONENTSDIR)/ddpheno.owl: component-download-ddpheno.owl + if [ $(COMP) = true ]; then if cmp -s $(TMPDIR)/component-download-ddpheno.owl.owl $(TMPDIR)/component-download-ddpheno.owl.tmp.owl ; then echo "Component identical."; \ + else echo "Component is different, updating." &&\ + cp $(TMPDIR)/component-download-ddpheno.owl.owl $(TMPDIR)/component-download-ddpheno.owl.tmp.owl &&\ + $(ROBOT) annotate -i $(TMPDIR)/component-download-ddpheno.owl.owl --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $@; fi; fi + +.PRECIOUS: $(COMPONENTSDIR)/ddpheno.owl + + .PHONY: component-download-emapa.owl component-download-emapa.owl: | $(TMPDIR) if [ $(MIR) = true ] && [ $(COMP) = true ]; then $(ROBOT) merge -I http://purl.obolibrary.org/obo/emapa.owl \ remove --base-iri http://purl.obolibrary.org/obo/emapa# --base-iri http://purl.obolibrary.org/obo/EMAPA_ --axioms external --preserve-structure false --trim false \ annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $(TMPDIR)/$@.owl; fi -$(COMPONENTSDIR)/emapa.owl: component-download-emapa.owl - if [ $(COMP) = true ] ; then if cmp -s $(TMPDIR)/component-download-emapa.owl.owl $@ ; then echo "Component identical."; else echo "Component is different, updating." && cp $(TMPDIR)/component-download-emapa.owl.owl $@; fi; fi +$(COMPONENTSDIR)/emapa.owl: component-download-emapa.owl + if [ $(COMP) = true ]; then if cmp -s $(TMPDIR)/component-download-emapa.owl.owl $(TMPDIR)/component-download-emapa.owl.tmp.owl ; then echo "Component identical."; \ + else echo "Component is different, updating." &&\ + cp $(TMPDIR)/component-download-emapa.owl.owl $(TMPDIR)/component-download-emapa.owl.tmp.owl &&\ + $(ROBOT) annotate -i $(TMPDIR)/component-download-emapa.owl.owl --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $@; fi; fi .PRECIOUS: $(COMPONENTSDIR)/emapa.owl @@ -413,8 +490,11 @@ component-download-fbbt.owl: | $(TMPDIR) remove --base-iri http://purl.obolibrary.org/obo/fbbt# --base-iri http://purl.obolibrary.org/obo/FBbt_ --axioms external --preserve-structure false --trim false \ annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $(TMPDIR)/$@.owl; fi -$(COMPONENTSDIR)/fbbt.owl: component-download-fbbt.owl - if [ $(COMP) = true ] ; then if cmp -s $(TMPDIR)/component-download-fbbt.owl.owl $@ ; then echo "Component identical."; else echo "Component is different, updating." && cp $(TMPDIR)/component-download-fbbt.owl.owl $@; fi; fi +$(COMPONENTSDIR)/fbbt.owl: component-download-fbbt.owl + if [ $(COMP) = true ]; then if cmp -s $(TMPDIR)/component-download-fbbt.owl.owl $(TMPDIR)/component-download-fbbt.owl.tmp.owl ; then echo "Component identical."; \ + else echo "Component is different, updating." &&\ + cp $(TMPDIR)/component-download-fbbt.owl.owl $(TMPDIR)/component-download-fbbt.owl.tmp.owl &&\ + $(ROBOT) annotate -i $(TMPDIR)/component-download-fbbt.owl.owl --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $@; fi; fi .PRECIOUS: $(COMPONENTSDIR)/fbbt.owl @@ -425,8 +505,11 @@ component-download-go.owl: | $(TMPDIR) remove --base-iri http://purl.obolibrary.org/obo/go# --base-iri http://purl.obolibrary.org/obo/GO_ --axioms external --preserve-structure false --trim false \ annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $(TMPDIR)/$@.owl; fi -$(COMPONENTSDIR)/go.owl: component-download-go.owl - if [ $(COMP) = true ] ; then if cmp -s $(TMPDIR)/component-download-go.owl.owl $@ ; then echo "Component identical."; else echo "Component is different, updating." && cp $(TMPDIR)/component-download-go.owl.owl $@; fi; fi +$(COMPONENTSDIR)/go.owl: component-download-go.owl + if [ $(COMP) = true ]; then if cmp -s $(TMPDIR)/component-download-go.owl.owl $(TMPDIR)/component-download-go.owl.tmp.owl ; then echo "Component identical."; \ + else echo "Component is different, updating." &&\ + cp $(TMPDIR)/component-download-go.owl.owl $(TMPDIR)/component-download-go.owl.tmp.owl &&\ + $(ROBOT) annotate -i $(TMPDIR)/component-download-go.owl.owl --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $@; fi; fi .PRECIOUS: $(COMPONENTSDIR)/go.owl @@ -437,8 +520,11 @@ component-download-hsapdv.owl: | $(TMPDIR) remove --base-iri http://purl.obolibrary.org/obo/hsapdv# --base-iri http://purl.obolibrary.org/obo/HsapDv_ --axioms external --preserve-structure false --trim false \ annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $(TMPDIR)/$@.owl; fi -$(COMPONENTSDIR)/hsapdv.owl: component-download-hsapdv.owl - if [ $(COMP) = true ] ; then if cmp -s $(TMPDIR)/component-download-hsapdv.owl.owl $@ ; then echo "Component identical."; else echo "Component is different, updating." && cp $(TMPDIR)/component-download-hsapdv.owl.owl $@; fi; fi +$(COMPONENTSDIR)/hsapdv.owl: component-download-hsapdv.owl + if [ $(COMP) = true ]; then if cmp -s $(TMPDIR)/component-download-hsapdv.owl.owl $(TMPDIR)/component-download-hsapdv.owl.tmp.owl ; then echo "Component identical."; \ + else echo "Component is different, updating." &&\ + cp $(TMPDIR)/component-download-hsapdv.owl.owl $(TMPDIR)/component-download-hsapdv.owl.tmp.owl &&\ + $(ROBOT) annotate -i $(TMPDIR)/component-download-hsapdv.owl.owl --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $@; fi; fi .PRECIOUS: $(COMPONENTSDIR)/hsapdv.owl @@ -449,8 +535,11 @@ component-download-mondo.owl: | $(TMPDIR) remove --base-iri http://purl.obolibrary.org/obo/mondo# --base-iri http://purl.obolibrary.org/obo/MONDO_ --axioms external --preserve-structure false --trim false \ annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $(TMPDIR)/$@.owl; fi -$(COMPONENTSDIR)/mondo.owl: component-download-mondo.owl - if [ $(COMP) = true ] ; then if cmp -s $(TMPDIR)/component-download-mondo.owl.owl $@ ; then echo "Component identical."; else echo "Component is different, updating." && cp $(TMPDIR)/component-download-mondo.owl.owl $@; fi; fi +$(COMPONENTSDIR)/mondo.owl: component-download-mondo.owl + if [ $(COMP) = true ]; then if cmp -s $(TMPDIR)/component-download-mondo.owl.owl $(TMPDIR)/component-download-mondo.owl.tmp.owl ; then echo "Component identical."; \ + else echo "Component is different, updating." &&\ + cp $(TMPDIR)/component-download-mondo.owl.owl $(TMPDIR)/component-download-mondo.owl.tmp.owl &&\ + $(ROBOT) annotate -i $(TMPDIR)/component-download-mondo.owl.owl --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $@; fi; fi .PRECIOUS: $(COMPONENTSDIR)/mondo.owl @@ -461,8 +550,11 @@ component-download-mpath.owl: | $(TMPDIR) remove --base-iri http://purl.obolibrary.org/obo/mpath# --base-iri http://purl.obolibrary.org/obo/MPATH_ --axioms external --preserve-structure false --trim false \ annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $(TMPDIR)/$@.owl; fi -$(COMPONENTSDIR)/mpath.owl: component-download-mpath.owl - if [ $(COMP) = true ] ; then if cmp -s $(TMPDIR)/component-download-mpath.owl.owl $@ ; then echo "Component identical."; else echo "Component is different, updating." && cp $(TMPDIR)/component-download-mpath.owl.owl $@; fi; fi +$(COMPONENTSDIR)/mpath.owl: component-download-mpath.owl + if [ $(COMP) = true ]; then if cmp -s $(TMPDIR)/component-download-mpath.owl.owl $(TMPDIR)/component-download-mpath.owl.tmp.owl ; then echo "Component identical."; \ + else echo "Component is different, updating." &&\ + cp $(TMPDIR)/component-download-mpath.owl.owl $(TMPDIR)/component-download-mpath.owl.tmp.owl &&\ + $(ROBOT) annotate -i $(TMPDIR)/component-download-mpath.owl.owl --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $@; fi; fi .PRECIOUS: $(COMPONENTSDIR)/mpath.owl @@ -473,8 +565,11 @@ component-download-nbo.owl: | $(TMPDIR) remove --base-iri http://purl.obolibrary.org/obo/nbo.owl# --base-iri http://purl.obolibrary.org/obo/NBO_ --axioms external --preserve-structure false --trim false \ annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $(TMPDIR)/$@.owl; fi -$(COMPONENTSDIR)/nbo.owl: component-download-nbo.owl - if [ $(COMP) = true ] ; then if cmp -s $(TMPDIR)/component-download-nbo.owl.owl $@ ; then echo "Component identical."; else echo "Component is different, updating." && cp $(TMPDIR)/component-download-nbo.owl.owl $@; fi; fi +$(COMPONENTSDIR)/nbo.owl: component-download-nbo.owl + if [ $(COMP) = true ]; then if cmp -s $(TMPDIR)/component-download-nbo.owl.owl $(TMPDIR)/component-download-nbo.owl.tmp.owl ; then echo "Component identical."; \ + else echo "Component is different, updating." &&\ + cp $(TMPDIR)/component-download-nbo.owl.owl $(TMPDIR)/component-download-nbo.owl.tmp.owl &&\ + $(ROBOT) annotate -i $(TMPDIR)/component-download-nbo.owl.owl --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $@; fi; fi .PRECIOUS: $(COMPONENTSDIR)/nbo.owl @@ -484,8 +579,11 @@ component-download-ro.owl: | $(TMPDIR) if [ $(MIR) = true ] && [ $(COMP) = true ]; then $(ROBOT) merge -I http://purl.obolibrary.org/obo/ro.owl \ annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $(TMPDIR)/$@.owl; fi -$(COMPONENTSDIR)/ro.owl: component-download-ro.owl - if [ $(COMP) = true ] ; then if cmp -s $(TMPDIR)/component-download-ro.owl.owl $@ ; then echo "Component identical."; else echo "Component is different, updating." && cp $(TMPDIR)/component-download-ro.owl.owl $@; fi; fi +$(COMPONENTSDIR)/ro.owl: component-download-ro.owl + if [ $(COMP) = true ]; then if cmp -s $(TMPDIR)/component-download-ro.owl.owl $(TMPDIR)/component-download-ro.owl.tmp.owl ; then echo "Component identical."; \ + else echo "Component is different, updating." &&\ + cp $(TMPDIR)/component-download-ro.owl.owl $(TMPDIR)/component-download-ro.owl.tmp.owl &&\ + $(ROBOT) annotate -i $(TMPDIR)/component-download-ro.owl.owl --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $@; fi; fi .PRECIOUS: $(COMPONENTSDIR)/ro.owl @@ -496,8 +594,11 @@ component-download-uberon.owl: | $(TMPDIR) remove --base-iri http://purl.obolibrary.org/obo/UBERON_ --base-iri http://purl.obolibrary.org/obo/uberon/core# --base-iri http://purl.obolibrary.org/obo/UBPROP_ --axioms external --preserve-structure false --trim false \ annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $(TMPDIR)/$@.owl; fi -$(COMPONENTSDIR)/uberon.owl: component-download-uberon.owl - if [ $(COMP) = true ] ; then if cmp -s $(TMPDIR)/component-download-uberon.owl.owl $@ ; then echo "Component identical."; else echo "Component is different, updating." && cp $(TMPDIR)/component-download-uberon.owl.owl $@; fi; fi +$(COMPONENTSDIR)/uberon.owl: component-download-uberon.owl + if [ $(COMP) = true ]; then if cmp -s $(TMPDIR)/component-download-uberon.owl.owl $(TMPDIR)/component-download-uberon.owl.tmp.owl ; then echo "Component identical."; \ + else echo "Component is different, updating." &&\ + cp $(TMPDIR)/component-download-uberon.owl.owl $(TMPDIR)/component-download-uberon.owl.tmp.owl &&\ + $(ROBOT) annotate -i $(TMPDIR)/component-download-uberon.owl.owl --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $@; fi; fi .PRECIOUS: $(COMPONENTSDIR)/uberon.owl @@ -508,8 +609,11 @@ component-download-upheno.owl: | $(TMPDIR) remove --base-iri http://purl.obolibrary.org/obo/UPHENO_ --base-iri http://purl.obolibrary.org/obo/HP_ --base-iri http://purl.obolibrary.org/obo/MP_ --base-iri http://purl.obolibrary.org/obo/WBPhenotype_ --base-iri http://purl.obolibrary.org/obo/XPO_ --base-iri http://purl.obolibrary.org/obo/ZP_ --base-iri http://purl.obolibrary.org/obo/FYPO_ --axioms external --preserve-structure false --trim false \ annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $(TMPDIR)/$@.owl; fi -$(COMPONENTSDIR)/upheno.owl: component-download-upheno.owl - if [ $(COMP) = true ] ; then if cmp -s $(TMPDIR)/component-download-upheno.owl.owl $@ ; then echo "Component identical."; else echo "Component is different, updating." && cp $(TMPDIR)/component-download-upheno.owl.owl $@; fi; fi +$(COMPONENTSDIR)/upheno.owl: component-download-upheno.owl + if [ $(COMP) = true ]; then if cmp -s $(TMPDIR)/component-download-upheno.owl.owl $(TMPDIR)/component-download-upheno.owl.tmp.owl ; then echo "Component identical."; \ + else echo "Component is different, updating." &&\ + cp $(TMPDIR)/component-download-upheno.owl.owl $(TMPDIR)/component-download-upheno.owl.tmp.owl &&\ + $(ROBOT) annotate -i $(TMPDIR)/component-download-upheno.owl.owl --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $@; fi; fi .PRECIOUS: $(COMPONENTSDIR)/upheno.owl @@ -520,8 +624,11 @@ component-download-wbbt.owl: | $(TMPDIR) remove --base-iri http://purl.obolibrary.org/obo/wbbt# --base-iri http://purl.obolibrary.org/obo/WBbt_ --axioms external --preserve-structure false --trim false \ annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $(TMPDIR)/$@.owl; fi -$(COMPONENTSDIR)/wbbt.owl: component-download-wbbt.owl - if [ $(COMP) = true ] ; then if cmp -s $(TMPDIR)/component-download-wbbt.owl.owl $@ ; then echo "Component identical."; else echo "Component is different, updating." && cp $(TMPDIR)/component-download-wbbt.owl.owl $@; fi; fi +$(COMPONENTSDIR)/wbbt.owl: component-download-wbbt.owl + if [ $(COMP) = true ]; then if cmp -s $(TMPDIR)/component-download-wbbt.owl.owl $(TMPDIR)/component-download-wbbt.owl.tmp.owl ; then echo "Component identical."; \ + else echo "Component is different, updating." &&\ + cp $(TMPDIR)/component-download-wbbt.owl.owl $(TMPDIR)/component-download-wbbt.owl.tmp.owl &&\ + $(ROBOT) annotate -i $(TMPDIR)/component-download-wbbt.owl.owl --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $@; fi; fi .PRECIOUS: $(COMPONENTSDIR)/wbbt.owl @@ -532,8 +639,11 @@ component-download-zfa.owl: | $(TMPDIR) remove --base-iri http://purl.obolibrary.org/obo/zfa# --base-iri http://purl.obolibrary.org/obo/ZFA_ --axioms external --preserve-structure false --trim false \ annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $(TMPDIR)/$@.owl; fi -$(COMPONENTSDIR)/zfa.owl: component-download-zfa.owl - if [ $(COMP) = true ] ; then if cmp -s $(TMPDIR)/component-download-zfa.owl.owl $@ ; then echo "Component identical."; else echo "Component is different, updating." && cp $(TMPDIR)/component-download-zfa.owl.owl $@; fi; fi +$(COMPONENTSDIR)/zfa.owl: component-download-zfa.owl + if [ $(COMP) = true ]; then if cmp -s $(TMPDIR)/component-download-zfa.owl.owl $(TMPDIR)/component-download-zfa.owl.tmp.owl ; then echo "Component identical."; \ + else echo "Component is different, updating." &&\ + cp $(TMPDIR)/component-download-zfa.owl.owl $(TMPDIR)/component-download-zfa.owl.tmp.owl &&\ + $(ROBOT) annotate -i $(TMPDIR)/component-download-zfa.owl.owl --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $@; fi; fi .PRECIOUS: $(COMPONENTSDIR)/zfa.owl # ---------------------------------------- @@ -544,160 +654,154 @@ IMP=true # Global parameter to bypass import generation MIR=true # Global parameter to bypass mirror generation IMP_LARGE=true # Global parameter to bypass handling of large imports +ifeq ($(strip $(MIR)),true) ## ONTOLOGY: chebi .PHONY: mirror-chebi .PRECIOUS: $(MIRRORDIR)/chebi.owl +ifeq ($(strip $(IMP_LARGE)),true) mirror-chebi: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ] && [ $(IMP_LARGE) = true ]; then curl -L $(OBOBASE)/chebi.owl.gz --create-dirs -o $(MIRRORDIR)/chebi.owl.gz --retry 4 --max-time 400 &&\ - $(ROBOT) convert -i $(MIRRORDIR)/chebi.owl.gz -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + curl -L $(OBOBASE)/chebi.owl.gz --create-dirs -o $(MIRRORDIR)/chebi.owl.gz --retry 4 --max-time 400 && \ + $(ROBOT) convert -i $(MIRRORDIR)/chebi.owl.gz -o $(TMPDIR)/$@.owl +else +mirror-chebi: + @echo "Not refreshing chebi because refreshing large imports is disabled (IMP_LARGE=$(IMP_LARGE))." +endif ## ONTOLOGY: eco .PHONY: mirror-eco .PRECIOUS: $(MIRRORDIR)/eco.owl mirror-eco: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then curl -L $(OBOBASE)/eco.owl --create-dirs -o $(MIRRORDIR)/eco.owl --retry 4 --max-time 400 &&\ - $(ROBOT) convert -i $(MIRRORDIR)/eco.owl -o $@.tmp.owl && \ - $(ROBOT) remove -i $@.tmp.owl --base-iri $(URIBASE)/ECO --axioms external --preserve-structure false --trim false -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + curl -L $(OBOBASE)/eco.owl --create-dirs -o $(TMPDIR)/eco-download.owl --retry 4 --max-time 400 && \ + $(ROBOT) remove -i $(TMPDIR)/eco-download.owl --base-iri $(OBOBASE)/ECO --axioms external --preserve-structure false --trim false -o $(TMPDIR)/$@.owl ## ONTOLOGY: ncbitaxon-taxslim .PHONY: mirror-ncbitaxon-taxslim .PRECIOUS: $(MIRRORDIR)/ncbitaxon-taxslim.owl mirror-ncbitaxon-taxslim: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then $(ROBOT) convert -I http://purl.obolibrary.org/obo/ncbitaxon/subsets/taxslim.owl -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + $(ROBOT) convert -I http://purl.obolibrary.org/obo/ncbitaxon/subsets/taxslim.owl -o $(TMPDIR)/$@.owl ## ONTOLOGY: oba .PHONY: mirror-oba .PRECIOUS: $(MIRRORDIR)/oba.owl mirror-oba: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then curl -L $(OBOBASE)/oba.owl --create-dirs -o $(MIRRORDIR)/oba.owl --retry 4 --max-time 400 &&\ - $(ROBOT) convert -i $(MIRRORDIR)/oba.owl -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + curl -L $(OBOBASE)/oba.owl --create-dirs -o $(TMPDIR)/oba-download.owl --retry 4 --max-time 400 && \ + $(ROBOT) convert -i $(TMPDIR)/oba-download.owl -o $(TMPDIR)/$@.owl ## ONTOLOGY: pato .PHONY: mirror-pato .PRECIOUS: $(MIRRORDIR)/pato.owl mirror-pato: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then curl -L $(OBOBASE)/pato.owl --create-dirs -o $(MIRRORDIR)/pato.owl --retry 4 --max-time 400 &&\ - $(ROBOT) convert -i $(MIRRORDIR)/pato.owl -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + curl -L $(OBOBASE)/pato.owl --create-dirs -o $(TMPDIR)/pato-download.owl --retry 4 --max-time 400 && \ + $(ROBOT) convert -i $(TMPDIR)/pato-download.owl -o $(TMPDIR)/$@.owl ## ONTOLOGY: uberon-bridge-to-emapa .PHONY: mirror-uberon-bridge-to-emapa .PRECIOUS: $(MIRRORDIR)/uberon-bridge-to-emapa.owl mirror-uberon-bridge-to-emapa: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/uberon-bridge-to-emapa.owl -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/uberon-bridge-to-emapa.owl -o $(TMPDIR)/$@.owl ## ONTOLOGY: uberon-bridge-to-zfa .PHONY: mirror-uberon-bridge-to-zfa .PRECIOUS: $(MIRRORDIR)/uberon-bridge-to-zfa.owl mirror-uberon-bridge-to-zfa: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/uberon-bridge-to-zfa.owl -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/uberon-bridge-to-zfa.owl -o $(TMPDIR)/$@.owl ## ONTOLOGY: uberon-bridge-to-ma .PHONY: mirror-uberon-bridge-to-ma .PRECIOUS: $(MIRRORDIR)/uberon-bridge-to-ma.owl mirror-uberon-bridge-to-ma: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/uberon-bridge-to-ma.owl -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/uberon-bridge-to-ma.owl -o $(TMPDIR)/$@.owl ## ONTOLOGY: uberon-bridge-to-wbbt .PHONY: mirror-uberon-bridge-to-wbbt .PRECIOUS: $(MIRRORDIR)/uberon-bridge-to-wbbt.owl mirror-uberon-bridge-to-wbbt: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/uberon-bridge-to-wbbt.owl -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/uberon-bridge-to-wbbt.owl -o $(TMPDIR)/$@.owl ## ONTOLOGY: uberon-bridge-to-fbbt .PHONY: mirror-uberon-bridge-to-fbbt .PRECIOUS: $(MIRRORDIR)/uberon-bridge-to-fbbt.owl mirror-uberon-bridge-to-fbbt: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/uberon-bridge-to-fbbt.owl -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/uberon-bridge-to-fbbt.owl -o $(TMPDIR)/$@.owl ## ONTOLOGY: uberon-bridge-to-fma .PHONY: mirror-uberon-bridge-to-fma .PRECIOUS: $(MIRRORDIR)/uberon-bridge-to-fma.owl mirror-uberon-bridge-to-fma: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/uberon-bridge-to-fma.owl -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/uberon-bridge-to-fma.owl -o $(TMPDIR)/$@.owl ## ONTOLOGY: cl-bridge-to-emapa .PHONY: mirror-cl-bridge-to-emapa .PRECIOUS: $(MIRRORDIR)/cl-bridge-to-emapa.owl mirror-cl-bridge-to-emapa: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/cl-bridge-to-emapa.owl -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/cl-bridge-to-emapa.owl -o $(TMPDIR)/$@.owl ## ONTOLOGY: cl-bridge-to-ma .PHONY: mirror-cl-bridge-to-ma .PRECIOUS: $(MIRRORDIR)/cl-bridge-to-ma.owl mirror-cl-bridge-to-ma: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/cl-bridge-to-ma.owl -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/cl-bridge-to-ma.owl -o $(TMPDIR)/$@.owl ## ONTOLOGY: cl-bridge-to-fma .PHONY: mirror-cl-bridge-to-fma .PRECIOUS: $(MIRRORDIR)/cl-bridge-to-fma.owl mirror-cl-bridge-to-fma: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/cl-bridge-to-fma.owl -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/cl-bridge-to-fma.owl -o $(TMPDIR)/$@.owl ## ONTOLOGY: cl-bridge-to-wbbt .PHONY: mirror-cl-bridge-to-wbbt .PRECIOUS: $(MIRRORDIR)/cl-bridge-to-wbbt.owl mirror-cl-bridge-to-wbbt: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/cl-bridge-to-wbbt.owl -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/cl-bridge-to-wbbt.owl -o $(TMPDIR)/$@.owl ## ONTOLOGY: cl-bridge-to-fbbt .PHONY: mirror-cl-bridge-to-fbbt .PRECIOUS: $(MIRRORDIR)/cl-bridge-to-fbbt.owl mirror-cl-bridge-to-fbbt: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/cl-bridge-to-fbbt.owl -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/cl-bridge-to-fbbt.owl -o $(TMPDIR)/$@.owl ## ONTOLOGY: cl-bridge-to-zfa .PHONY: mirror-cl-bridge-to-zfa .PRECIOUS: $(MIRRORDIR)/cl-bridge-to-zfa.owl mirror-cl-bridge-to-zfa: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/cl-bridge-to-zfa.owl -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + $(ROBOT) convert -I http://purl.obolibrary.org/obo/uberon/bridge/cl-bridge-to-zfa.owl -o $(TMPDIR)/$@.owl ALL_MIRRORS = $(patsubst %, $(MIRRORDIR)/%.owl, $(IMPORTS)) MERGE_MIRRORS = true +ifeq ($(strip $(MERGE_MIRRORS)),true) $(MIRRORDIR)/merged.owl: $(ALL_MIRRORS) - if [ $(IMP) = true ] && [ $(MERGE_MIRRORS) = true ]; then $(ROBOT) merge $(patsubst %, -i %, $^) -o $@; fi + $(ROBOT) merge $(patsubst %, -i %, $^) -o $@ .PRECIOUS: $(MIRRORDIR)/merged.owl +endif $(MIRRORDIR)/%.owl: mirror-% | $(MIRRORDIR) - if [ $(IMP) = true ] && [ $(MIR) = true ] && [ -f $(TMPDIR)/mirror-$*.owl ]; then if cmp -s $(TMPDIR)/mirror-$*.owl $@ ; then echo "Mirror identical, ignoring."; else echo "Mirrors different, updating." &&\ + if [ -f $(TMPDIR)/mirror-$*.owl ]; then if cmp -s $(TMPDIR)/mirror-$*.owl $@ ; then echo "Mirror identical, ignoring."; else echo "Mirrors different, updating." &&\ cp $(TMPDIR)/mirror-$*.owl $@; fi; fi +else # MIR=false +$(MIRRORDIR)/%.owl: + @echo "Not refreshing $@ because the mirrorring pipeline is disabled (MIR=$(MIR))." +endif @@ -771,9 +875,13 @@ ROBOT_RELEASE_IMPORT_MODE=$(ROBOT) merge --input $< # ROBOT pipeline that removes imports, then merges components. This is for release artefacts that start from "base" ROBOT_RELEASE_IMPORT_MODE_BASE=$(ROBOT) remove --input $< --select imports --trim false merge $(patsubst %, -i %, $(OTHER_SRC)) -# base: All the axioms as they are editted by the editors, excluding reasoning -$(ONT)-base.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) - $(ROBOT_RELEASE_IMPORT_MODE_BASE) \ +# base: A version of the ontology that does not include any externally imported axioms. +$(ONT)-base.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(IMPORT_FILES) + $(ROBOT_RELEASE_IMPORT_MODE) \ + reason --reasoner ELK --equivalent-classes-allowed all --exclude-tautologies structural --annotate-inferred-axioms False \ + relax \ + reduce -r ELK \ + remove --base-iri $(URIBASE)/PHENIO --axioms external --preserve-structure false --trim false \ $(SHARED_ROBOT_COMMANDS) \ annotate --link-annotation http://purl.org/dc/elements/1.1/type http://purl.obolibrary.org/obo/IAO_8000001 \ --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \ @@ -840,13 +948,16 @@ update_repo: update_docs: mkdocs gh-deploy --config-file ../../mkdocs.yaml -# Note to future generations: prepending ./ is a safety measure to ensure that -# the environment does not malicously set `CLEANFILES` to `\`. +# Note to future generations: computing the real path relative to the +# current directory is a way to ensure we only clean up directories that +# are located below the current directory, regardless of the contents of +# the *DIR variables. .PHONY: clean clean: - [ -n "$(MIRRORDIR)" ] && [ $(MIRRORDIR) != "." ] && [ $(MIRRORDIR) != "/" ] && [ $(MIRRORDIR) != ".." ] && [ -d ./$(MIRRORDIR) ] && rm -rf ./$(MIRRORDIR)/* - [ -n "$(TMPDIR)" ] && [ $(TMPDIR) != "." ] && [ $(TMPDIR) != "/" ] && [ $(TMPDIR) != ".." ] && [ -d ./$(TMPDIR) ] && rm -rf ./$(TMPDIR)/* - [ -n "$(UPDATEREPODIR)" ] && [ $(UPDATEREPODIR) != "." ] && [ $(UPDATEREPODIR) != "/" ] && [ $(UPDATEREPODIR) != ".." ] && [ -d ./$(UPDATEREPODIR) ] && rm -rf ./$(UPDATEREPODIR)/* + for dir in $(MIRRORDIR) $(TMPDIR) $(UPDATEREPODIR) ; do \ + reldir=$$(realpath --relative-to=$$(pwd) $$dir) ; \ + case $$reldir in .*|"") ;; *) rm -rf $$reldir/* ;; esac \ + done rm -f $(CLEANFILES) .PHONY: help @@ -865,6 +976,7 @@ Core commands: * prepare_release_fast: Run the entire release pipeline without refreshing imports, recreating components or recompiling patterns. * update_repo: Update the ODK repository setup using the config file phenio-odk.yaml * test: Running all validation tests +* test_fast: Runs the test suite, but without updating imports or components * odkversion: Show the current version of the ODK Makefile and ROBOT. * clean: Delete all temporary files * help: Print ODK Usage information @@ -882,7 +994,7 @@ Imports management: Editor utilities: * validate_idranges: Make sure your ID ranges file is formatted correctly -* normalize_src: Load and safe your phenio-edit file after you to make sure its serialised correctly +* normalize_src: Load and save your phenio-edit file after you to make sure its serialised correctly * explain_unsat: If you have unsatisfiable classes, this command will create a markdown file (tmp/explain_unsat.md) which will explain all your unsatisfiable classes * validate-all-tsv: Check all your tsv files for possible problems in syntax. Use ALL_TSV_FILES variable to list files * validate-tsv: Check a tsv file for syntactic problems with tsvalid. Use TSV variable to pass filepath, e.g. make TSV=../my.tsv validate-tsv. diff --git a/src/ontology/catalog-v001.xml b/src/ontology/catalog-v001.xml index ad0e94a..2594850 100644 --- a/src/ontology/catalog-v001.xml +++ b/src/ontology/catalog-v001.xml @@ -61,6 +61,8 @@ + + diff --git a/src/ontology/phenio-edit.owl b/src/ontology/phenio-edit.owl index 3681815..9e3940d 100644 --- a/src/ontology/phenio-edit.owl +++ b/src/ontology/phenio-edit.owl @@ -12,6 +12,7 @@ Prefix(dcterms:=) Ontology( Import() +Import() Import() #Import() Import() diff --git a/src/ontology/phenio-odk.yaml b/src/ontology/phenio-odk.yaml index 5257ac4..159062f 100644 --- a/src/ontology/phenio-odk.yaml +++ b/src/ontology/phenio-odk.yaml @@ -72,6 +72,12 @@ components: # make_base: TRUE # base_iris: # - http://purl.obolibrary.org/obo/FAO_ + - filename: ddpheno.owl + source: http://purl.obolibrary.org/obo/ddpheno.owl + make_base: TRUE + base_iris: + - http://purl.obolibrary.org/obo/ddpheno# + - http://purl.obolibrary.org/obo/DDPHENO_ - filename: emapa.owl source: http://purl.obolibrary.org/obo/emapa.owl make_base: TRUE diff --git a/src/ontology/run.sh b/src/ontology/run.sh index 38545d1..fa98da3 100755 --- a/src/ontology/run.sh +++ b/src/ontology/run.sh @@ -14,6 +14,8 @@ # # See README-editors.md for more details. +set -e + if [ -f run.sh.conf ]; then . ./run.sh.conf fi @@ -29,6 +31,22 @@ elif [ -f "$HOME/Library/Application Support/ontology-development-kit/github/tok GH_TOKEN=$(cat "$HOME/Library/Application Support/ontology-development-kit/github/token") fi +# SSH agent socket +# On macOS, we cannot use $SSH_AUTH_SOCK directly, +# we need to use a "magic" socket instead. +case "$(uname)" in +Darwin) + ODK_SSH_AUTH_SOCKET=/run/host-services/ssh-auth.sock + ;; +*) + ODK_SSH_AUTH_SOCKET=$SSH_AUTH_SOCK + ;; +esac +ODK_SSH_BIND= +if [ -n "$ODK_SSH_AUTH_SOCKET" ]; then + ODK_SSH_BIND=",$ODK_SSH_AUTH_SOCKET:/run/host-services/ssh-auth.sock" +fi + ODK_IMAGE=${ODK_IMAGE:-odkfull} TAG_IN_IMAGE=$(echo $ODK_IMAGE | awk -F':' '{ print $2 }') if [ -n "$TAG_IN_IMAGE" ]; then @@ -40,16 +58,28 @@ ODK_TAG=${ODK_TAG:-latest} ODK_JAVA_OPTS=${ODK_JAVA_OPTS:--Xmx30G} ODK_DEBUG=${ODK_DEBUG:-no} +ODK_USER_ID=${ODK_USER_ID:-$(id -u)} +ODK_GROUP_ID=${ODK_GROUP_ID:-$(id -g)} + +# Convert OWLAPI_* environment variables to the OWLAPI as Java options +# See http://owlcs.github.io/owlapi/apidocs_4/org/semanticweb/owlapi/model/parameters/ConfigurationOptions.html +# for a list of allowed options +OWLAPI_OPTIONS_NAMESPACE=org.semanticweb.owlapi.model.parameters.ConfigurationOptions +for owlapi_var in $(env | sed -n s/^OWLAPI_//p) ; do + ODK_JAVA_OPTS="$ODK_JAVA_OPTS -D$OWLAPI_OPTIONS_NAMESPACE.${owlapi_var%=*}=${owlapi_var#*=}" +done + TIMECMD= if [ x$ODK_DEBUG = xyes ]; then # If you wish to change the format string, take care of using # non-breaking spaces (U+00A0) instead of normal spaces, to # prevent the shell from tokenizing the format string. - echo "Running ${IMAGE} with ${ODK_JAVA_OPTS} of memory for ROBOT and Java-based pipeline steps." + echo "Running obolibrary/${ODK_IMAGE}:${ODK_TAG} with '${ODK_JAVA_OPTS}' as options for ROBOT and other Java-based pipeline steps." TIMECMD="/usr/bin/time -f ### DEBUG STATS ###\nElapsed time: %E\nPeak memory: %M kb" fi +rm -f tmp/debug.log -VOLUME_BIND=$PWD/../../:/work +VOLUME_BIND=$PWD/../../:/work$ODK_SSH_BIND WORK_DIR=/work/src/ontology if [ -n "$ODK_BINDS" ]; then @@ -59,14 +89,14 @@ fi if [ -n "$USE_SINGULARITY" ]; then singularity exec --cleanenv $ODK_SINGULARITY_OPTIONS \ - --env "ROBOT_JAVA_ARGS=$ODK_JAVA_OPTS,JAVA_OPTS=$ODK_JAVA_OPTS" \ + --env "ROBOT_JAVA_ARGS=$ODK_JAVA_OPTS,JAVA_OPTS=$ODK_JAVA_OPTS,SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock,ODK_USER_ID=$ODK_USER_ID,ODK_GROUP_ID=$ODK_GROUP_ID,ODK_DEBUG=$ODK_DEBUG" \ --bind $VOLUME_BIND \ -W $WORK_DIR \ docker://obolibrary/$ODK_IMAGE:$ODK_TAG $TIMECMD "$@" else BIND_OPTIONS="-v $(echo $VOLUME_BIND | sed 's/,/ -v /')" docker run $ODK_DOCKER_OPTIONS $BIND_OPTIONS -w $WORK_DIR \ - -e ROBOT_JAVA_ARGS="$ODK_JAVA_OPTS" -e JAVA_OPTS="$ODK_JAVA_OPTS" \ + -e ROBOT_JAVA_ARGS="$ODK_JAVA_OPTS" -e JAVA_OPTS="$ODK_JAVA_OPTS" -e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock -e ODK_USER_ID=$ODK_USER_ID -e ODK_GROUP_ID=$ODK_GROUP_ID -e ODK_DEBUG=$ODK_DEBUG \ --rm -ti obolibrary/$ODK_IMAGE:$ODK_TAG $TIMECMD "$@" fi diff --git a/src/scripts/run-command.sh b/src/scripts/run-command.sh new file mode 100755 index 0000000..45d431d --- /dev/null +++ b/src/scripts/run-command.sh @@ -0,0 +1,4 @@ +#!/bin/sh +ODK_DEBUG_FILE=${ODK_DEBUG_FILE:-debug.log} +echo "Command: sh $@" >> $ODK_DEBUG_FILE +/usr/bin/time -a -o $ODK_DEBUG_FILE -f "Elapsed time: %E\nPeak memory: %M kb" /bin/sh "$@" diff --git a/src/scripts/update_repo.sh b/src/scripts/update_repo.sh index 7e93248..941b891 100644 --- a/src/scripts/update_repo.sh +++ b/src/scripts/update_repo.sh @@ -26,7 +26,8 @@ cp target/$OID/src/ontology/run.sh $SRCDIR/ontology/ cp -r target/$OID/src/sparql/* $SRCDIR/sparql/ mkdir -p $ROOTDIR/.github mkdir -p $ROOTDIR/.github/workflows -cp -n target/$OID/.github/workflows/qc.yml $ROOTDIR/.github/workflows/qc.yml +cp target/$OID/.github/workflows/qc.yml $ROOTDIR/.github/workflows/qc.yml + cp target/$OID/.github/workflows/docs.yml $ROOTDIR/.github/workflows/docs.yml @@ -35,5 +36,5 @@ cp target/$OID/.github/workflows/docs.yml $ROOTDIR/.github/workflows/docs.yml cp -n target/$OID/mkdocs.yaml $ROOTDIR/ echo "WARNING: These files should be manually migrated: mkdocs.yaml, .gitignore, src/ontology/catalog.xml (if you added a new import or component)" -echo "WARNING: Your QC workflows have not been updated automatically. Please update the ODK version number(s) in .github/workflows/qc.yml." + echo "Ontology repository update successfully completed." \ No newline at end of file diff --git a/src/sparql/dc-properties-violation.sparql b/src/sparql/dc-properties-violation.sparql new file mode 100644 index 0000000..e1cbfbb --- /dev/null +++ b/src/sparql/dc-properties-violation.sparql @@ -0,0 +1,11 @@ +# The purpose of this violation is to make sure people update +# from using the deprecated DC Elements 1.1 namespace (http://purl.org/dc/elements/1.1/) +# to using the recommended DC Terms namespace (http://purl.org/dc/terms/) +# See also discussion on https://github.com/oborel/obo-relations/pull/692 + +SELECT ?term ?predicate WHERE { + ?term ?predicate ?value . + FILTER(STRSTARTS(STR(?predicate), "http://purl.org/dc/elements/1.1/")) + FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/PHENIO_"))) +} + diff --git a/src/sparql/illegal-date-violation.sparql b/src/sparql/illegal-date-violation.sparql index 25ec660..9e05358 100644 --- a/src/sparql/illegal-date-violation.sparql +++ b/src/sparql/illegal-date-violation.sparql @@ -1,10 +1,12 @@ PREFIX dct: PREFIX xsd: +PREFIX oboInOwl: SELECT DISTINCT ?term ?property ?value WHERE { - VALUES ?property {dct:date dct:issued dct:created} + VALUES ?property {dct:date dct:issued dct:created oboInOwl:creation_date} ?term ?property ?value . FILTER (datatype(?value) != xsd:date || !regex(str(?value), '^\\d{4}-\\d\\d-\\d\\d$')) + FILTER (datatype(?value) != xsd:dateTime || !regex(str(?value), '^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z')) }