From a389e118be644291a1b3a195ca435de2bdfe26bd Mon Sep 17 00:00:00 2001 From: Nico Matentzoglu Date: Tue, 5 Mar 2024 17:39:56 +0200 Subject: [PATCH] Migrate to ODK 1.5 (#793) * Remove injected labels from COB * Update ODK 1.5 files * Remove annotations from COB import to avoid multiple label bug * Fix main branch ref * Add a few more BFO rels to list of base namespaces * Add fix towards for the base file in RO * Update ro.Makefile --- .github/workflows/qc.yml | 4 +- src/ontology/Makefile | 191 ++++++++++++------ src/ontology/imports/cob_import.owl | 34 +--- src/ontology/ro-odk.yaml | 7 + src/ontology/ro.Makefile | 25 +++ src/ontology/run.sh | 38 +++- src/scripts/run-command.sh | 4 + src/scripts/update_repo.sh | 5 +- src/sparql/iri-range-violation.sparql | 2 +- src/sparql/label-with-iri-violation.sparql | 2 +- .../owldef-self-reference-violation.sparql | 2 +- src/sparql/ro_terms.sparql | 2 +- 12 files changed, 213 insertions(+), 103 deletions(-) create mode 100755 src/scripts/run-command.sh diff --git a/.github/workflows/qc.yml b/.github/workflows/qc.yml index 07909b27..b4732692 100644 --- a/.github/workflows/qc.yml +++ b/.github/workflows/qc.yml @@ -19,12 +19,12 @@ jobs: ontology_qc: # The type of runner that the job will run on runs-on: ubuntu-latest - container: obolibrary/odkfull:v1.4 + 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: diff --git a/src/ontology/Makefile b/src/ontology/Makefile index 78c658e4..7b34e452 100644 --- a/src/ontology/Makefile +++ b/src/ontology/Makefile @@ -1,7 +1,7 @@ # ---------------------------------------- # Makefile for ro # Generated using ontology-development-kit -# ODK Version: v1.4.1 +# ODK Version: v1.5 # ---------------------------------------- # IMPORTANT: DO NOT EDIT THIS FILE. To override default make goals, use ro.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= 075dd4dff2b03ac15eb3fdc35033a80af4fec05442bc35f82dd3131f528c8209 + # ---------------------------------------- # Standard Constants @@ -44,7 +47,7 @@ REPORT_PROFILE_OPTS = --profile $(ROBOT_PROFILE) OBO_FORMAT_OPTIONS = SPARQL_VALIDATION_CHECKS = owldef-self-reference iri-range label-with-iri multiple-replaced_by term-editor-uri dce obsolete-relation SPARQL_EXPORTS = basic-report class-count-by-prefix edges xrefs obsoletes synonyms -ODK_VERSION_MAKEFILE = v1.4.1 +ODK_VERSION_MAKEFILE = v1.5 TODAY ?= $(shell date +%Y-%m-%d) OBODATE ?= $(shell date +'%d:%m:%Y %H:%M') @@ -59,6 +62,11 @@ FORMATS = $(sort owl obo json owl) FORMATS_INCL_TSV = $(sort $(FORMATS) tsv) RELEASE_ARTEFACTS = $(sort $(ONT)-base $(ONT)-full core ) +ifeq ($(ODK_DEBUG),yes) +ODK_DEBUG_FILE = debug.log +SHELL = $(SCRIPTSDIR)/run-command.sh +endif + # ---------------------------------------- # Top-level targets # ---------------------------------------- @@ -69,12 +77,16 @@ RELEASE_ARTEFACTS = $(sort $(ONT)-base $(ONT)-full core ) 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 $(REPORTDIR)/validate_profile_owl2dl_$(ONT).owl.txt echo "Finished running all tests successfully." +.PHONY: test +test_fast: + $(MAKE_FAST) test + .PHONY: release_diff release_diff: $(REPORTDIR)/release-diff.md @@ -85,13 +97,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 ro.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 # ---------------------------------------- @@ -181,10 +232,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 # ---------------------------------------- @@ -192,10 +243,18 @@ endif # ---------------------------------------- $(REPORTDIR)/$(SRC)-obo-report.tsv: $(SRCMERGED) | $(REPORTDIR) - $(ROBOT) report -i $< $(REPORT_LABEL) $(REPORT_PROFILE_OPTS) --fail-on $(REPORT_FAIL_ON) --base-iri http://purl.obolibrary.org/obo/RO_ --base-iri http://purl.obolibrary.org/obo/BFO_0000050 --base-iri http://purl.obolibrary.org/obo/BFO_0000051 --base-iri http://purl.obolibrary.org/obo/BFO_0000060 --print 5 -o $@ + $(ROBOT) report -i $< $(REPORT_LABEL) $(REPORT_PROFILE_OPTS) --fail-on $(REPORT_FAIL_ON) --base-iri http://purl.obolibrary.org/obo/RO_ --base-iri http://purl.obolibrary.org/obo/BFO_0000050 --base-iri http://purl.obolibrary.org/obo/BFO_0000051 --base-iri http://purl.obolibrary.org/obo/BFO_0000060 --base-iri http://purl.obolibrary.org/obo/BFO_0000062 --base-iri http://purl.obolibrary.org/obo/BFO_0000063 --base-iri http://purl.obolibrary.org/obo/BFO_0000066 --base-iri http://purl.obolibrary.org/obo/BFO_0000067 --base-iri http://purl.obolibrary.org/obo/BFO_0000054 --base-iri http://purl.obolibrary.org/obo/BFO_0000055 --print 5 -o $@ $(REPORTDIR)/%-obo-report.tsv: % | $(REPORTDIR) - $(ROBOT) report -i $< $(REPORT_LABEL) $(REPORT_PROFILE_OPTS) --fail-on $(REPORT_FAIL_ON) --base-iri http://purl.obolibrary.org/obo/RO_ --base-iri http://purl.obolibrary.org/obo/BFO_0000050 --base-iri http://purl.obolibrary.org/obo/BFO_0000051 --base-iri http://purl.obolibrary.org/obo/BFO_0000060 --print 5 -o $@ + $(ROBOT) report -i $< $(REPORT_LABEL) $(REPORT_PROFILE_OPTS) --fail-on $(REPORT_FAIL_ON) --base-iri http://purl.obolibrary.org/obo/RO_ --base-iri http://purl.obolibrary.org/obo/BFO_0000050 --base-iri http://purl.obolibrary.org/obo/BFO_0000051 --base-iri http://purl.obolibrary.org/obo/BFO_0000060 --base-iri http://purl.obolibrary.org/obo/BFO_0000062 --base-iri http://purl.obolibrary.org/obo/BFO_0000063 --base-iri http://purl.obolibrary.org/obo/BFO_0000066 --base-iri http://purl.obolibrary.org/obo/BFO_0000067 --base-iri http://purl.obolibrary.org/obo/BFO_0000054 --base-iri http://purl.obolibrary.org/obo/BFO_0000055 --print 5 -o $@ + +check_for_robot_updates: + @cut -f2 "/tools/robot_report_profile.txt" | sort > $(TMPDIR)/sorted_tsv2.txt + @cut -f2 "$(ROBOT_PROFILE)" | sort > $(TMPDIR)/sorted_tsv1.txt + @comm -23 $(TMPDIR)/sorted_tsv2.txt $(TMPDIR)/sorted_tsv1.txt > $(TMPDIR)/missing.txt + @echo "Missing tests:" + @cat $(TMPDIR)/missing.txt + @rm $(TMPDIR)/sorted_tsv1.txt $(TMPDIR)/sorted_tsv2.txt $(TMPDIR)/missing.txt $(TMPDIR)/report_profile_robot.txt # ---------------------------------------- # Release assets @@ -213,7 +272,7 @@ RELEASE_ASSETS = \ $(SUBSET_FILES) .PHONY: all_assets -all_assets: $(ASSETS) +all_assets: $(ASSETS) check_rdfxml_assets .PHONY: show_assets show_assets: @@ -221,7 +280,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) @@ -319,9 +378,9 @@ $(IMPORTDIR)/omo_import.owl: $(MIRRORDIR)/omo.owl $(IMPORTDIR)/pato_import.owl: $(MIRRORDIR)/pato.owl $(IMPORTDIR)/pato_terms_combined.txt if [ $(IMP) = true ]; then $(ROBOT) query -i $< --update ../sparql/preprocess-module.ru \ extract -T $(IMPORTDIR)/pato_terms_combined.txt --copy-ontology-annotations true --force true --method BOT \ - remove --base-iri $(URIBASE)/PATO --axioms external --preserve-structure false --trim false \ + remove --base-iri $(OBOBASE)/PATO --axioms external --preserve-structure false --trim false \ query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru \ - remove $(patsubst %, --term %, $(ANNOTATION_PROPERTIES)) -T $(IMPORTDIR)/pato_terms_combined.txt --select complement --select "classes individuals annotation-properties" \ + remove $(patsubst %, --term %, $(ANNOTATION_PROPERTIES)) --term rdfs:label --term IAO:0000115 -T $(IMPORTDIR)/pato_terms_combined.txt --select complement --select "classes individuals annotation-properties" \ $(ANNOTATE_CONVERT_FILE); fi ## Module for ontology: cl @@ -329,9 +388,9 @@ $(IMPORTDIR)/pato_import.owl: $(MIRRORDIR)/pato.owl $(IMPORTDIR)/pato_terms_comb $(IMPORTDIR)/cl_import.owl: $(MIRRORDIR)/cl.owl $(IMPORTDIR)/cl_terms_combined.txt if [ $(IMP) = true ]; then $(ROBOT) query -i $< --update ../sparql/preprocess-module.ru \ extract -T $(IMPORTDIR)/cl_terms_combined.txt --copy-ontology-annotations true --force true --method BOT \ - remove --base-iri $(URIBASE)/CL --axioms external --preserve-structure false --trim false \ + remove --base-iri $(OBOBASE)/CL --axioms external --preserve-structure false --trim false \ query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru \ - remove $(patsubst %, --term %, $(ANNOTATION_PROPERTIES)) -T $(IMPORTDIR)/cl_terms_combined.txt --select complement --select "classes individuals annotation-properties" \ + remove $(patsubst %, --term %, $(ANNOTATION_PROPERTIES)) --term rdfs:label --term IAO:0000115 -T $(IMPORTDIR)/cl_terms_combined.txt --select complement --select "classes individuals annotation-properties" \ $(ANNOTATE_CONVERT_FILE); fi ## Module for ontology: envo @@ -339,9 +398,9 @@ $(IMPORTDIR)/cl_import.owl: $(MIRRORDIR)/cl.owl $(IMPORTDIR)/cl_terms_combined.t $(IMPORTDIR)/envo_import.owl: $(MIRRORDIR)/envo.owl $(IMPORTDIR)/envo_terms_combined.txt if [ $(IMP) = true ]; then $(ROBOT) query -i $< --update ../sparql/preprocess-module.ru \ extract -T $(IMPORTDIR)/envo_terms_combined.txt --copy-ontology-annotations true --force true --method BOT \ - remove --base-iri $(URIBASE)/ENVO --axioms external --preserve-structure false --trim false \ + remove --base-iri $(OBOBASE)/ENVO --axioms external --preserve-structure false --trim false \ query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru \ - remove $(patsubst %, --term %, $(ANNOTATION_PROPERTIES)) -T $(IMPORTDIR)/envo_terms_combined.txt --select complement --select "classes individuals annotation-properties" \ + remove $(patsubst %, --term %, $(ANNOTATION_PROPERTIES)) --term rdfs:label --term IAO:0000115 -T $(IMPORTDIR)/envo_terms_combined.txt --select complement --select "classes individuals annotation-properties" \ $(ANNOTATE_CONVERT_FILE); fi ## Module for ontology: go @@ -349,9 +408,9 @@ $(IMPORTDIR)/envo_import.owl: $(MIRRORDIR)/envo.owl $(IMPORTDIR)/envo_terms_comb $(IMPORTDIR)/go_import.owl: $(MIRRORDIR)/go.owl $(IMPORTDIR)/go_terms_combined.txt if [ $(IMP) = true ]; then $(ROBOT) query -i $< --update ../sparql/preprocess-module.ru \ extract -T $(IMPORTDIR)/go_terms_combined.txt --copy-ontology-annotations true --force true --method BOT \ - remove --base-iri $(URIBASE)/GO --axioms external --preserve-structure false --trim false \ + remove --base-iri $(OBOBASE)/GO --axioms external --preserve-structure false --trim false \ query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru \ - remove $(patsubst %, --term %, $(ANNOTATION_PROPERTIES)) -T $(IMPORTDIR)/go_terms_combined.txt --select complement --select "classes individuals annotation-properties" \ + remove $(patsubst %, --term %, $(ANNOTATION_PROPERTIES)) --term rdfs:label --term IAO:0000115 -T $(IMPORTDIR)/go_terms_combined.txt --select complement --select "classes individuals annotation-properties" \ $(ANNOTATE_CONVERT_FILE); fi ## Module for ontology: other @@ -364,7 +423,7 @@ $(IMPORTDIR)/orcidio_import.owl: $(MIRRORDIR)/orcidio.owl $(IMPORTDIR)/orcidio_t if [ $(IMP) = true ]; then $(ROBOT) query -i $< --update ../sparql/preprocess-module.ru \ extract -T $(IMPORTDIR)/orcidio_terms_combined.txt --copy-ontology-annotations true --force true --method BOT \ remove --base-iri https://orcid.org/ --axioms external --preserve-structure false --trim false \ - remove $(patsubst %, --term %, $(ANNOTATION_PROPERTIES)) -T $(IMPORTDIR)/orcidio_terms_combined.txt --select complement \ + remove $(patsubst %, --term %, $(ANNOTATION_PROPERTIES)) --term rdfs:label --term IAO:0000115 -T $(IMPORTDIR)/orcidio_terms_combined.txt --select complement \ query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \ $(ANNOTATE_CONVERT_FILE); fi @@ -374,7 +433,7 @@ $(IMPORTDIR)/uberon_import.owl: $(MIRRORDIR)/uberon.owl $(IMPORTDIR)/uberon_term if [ $(IMP) = true ]; then $(ROBOT) query -i $< --update ../sparql/preprocess-module.ru \ extract -T $(IMPORTDIR)/uberon_terms_combined.txt --copy-ontology-annotations true --force true --method BOT \ remove --base-iri $(OBOBASE)/UBERON --axioms external --preserve-structure false --trim false \ - remove $(patsubst %, --term %, $(ANNOTATION_PROPERTIES)) -T $(IMPORTDIR)/uberon_terms_combined.txt --select complement \ + remove $(patsubst %, --term %, $(ANNOTATION_PROPERTIES)) --term rdfs:label --term IAO:0000115 -T $(IMPORTDIR)/uberon_terms_combined.txt --select complement \ query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \ $(ANNOTATE_CONVERT_FILE); fi @@ -384,7 +443,7 @@ $(IMPORTDIR)/obi_import.owl: $(MIRRORDIR)/obi.owl $(IMPORTDIR)/obi_terms_combine if [ $(IMP) = true ]; then $(ROBOT) query -i $< --update ../sparql/preprocess-module.ru \ extract -T $(IMPORTDIR)/obi_terms_combined.txt --copy-ontology-annotations true --force true --method BOT \ remove --base-iri $(OBOBASE)/OBI --axioms external --preserve-structure false --trim false \ - remove $(patsubst %, --term %, $(ANNOTATION_PROPERTIES)) -T $(IMPORTDIR)/obi_terms_combined.txt --select complement \ + remove $(patsubst %, --term %, $(ANNOTATION_PROPERTIES)) --term rdfs:label --term IAO:0000115 -T $(IMPORTDIR)/obi_terms_combined.txt --select complement \ query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \ $(ANNOTATE_CONVERT_FILE); fi @@ -440,9 +499,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 @@ -459,55 +518,47 @@ 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: omo .PHONY: mirror-omo .PRECIOUS: $(MIRRORDIR)/omo.owl mirror-omo: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then curl -L $(OBOBASE)/omo.owl --create-dirs -o $(MIRRORDIR)/omo.owl --retry 4 --max-time 200 &&\ - $(ROBOT) convert -i $(MIRRORDIR)/omo.owl -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + curl -L $(OBOBASE)/omo.owl --create-dirs -o $(TMPDIR)/omo-download.owl --retry 4 --max-time 200 && \ + $(ROBOT) convert -i $(TMPDIR)/omo-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 200 &&\ - $(ROBOT) convert -i $(MIRRORDIR)/pato.owl -o $@.tmp.owl && \ - $(ROBOT) remove -i $@.tmp.owl --base-iri $(URIBASE)/PATO --axioms external --preserve-structure false --trim false -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 200 && \ + $(ROBOT) remove -i $(TMPDIR)/pato-download.owl --base-iri $(OBOBASE)/PATO --axioms external --preserve-structure false --trim false -o $(TMPDIR)/$@.owl ## ONTOLOGY: cl .PHONY: mirror-cl .PRECIOUS: $(MIRRORDIR)/cl.owl mirror-cl: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then curl -L $(OBOBASE)/cl.owl --create-dirs -o $(MIRRORDIR)/cl.owl --retry 4 --max-time 200 &&\ - $(ROBOT) convert -i $(MIRRORDIR)/cl.owl -o $@.tmp.owl && \ - $(ROBOT) remove -i $@.tmp.owl --base-iri $(URIBASE)/CL --axioms external --preserve-structure false --trim false -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + curl -L $(OBOBASE)/cl.owl --create-dirs -o $(TMPDIR)/cl-download.owl --retry 4 --max-time 200 && \ + $(ROBOT) remove -i $(TMPDIR)/cl-download.owl --base-iri $(OBOBASE)/CL --axioms external --preserve-structure false --trim false -o $(TMPDIR)/$@.owl ## ONTOLOGY: envo .PHONY: mirror-envo .PRECIOUS: $(MIRRORDIR)/envo.owl mirror-envo: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then curl -L $(OBOBASE)/envo.owl --create-dirs -o $(MIRRORDIR)/envo.owl --retry 4 --max-time 200 &&\ - $(ROBOT) convert -i $(MIRRORDIR)/envo.owl -o $@.tmp.owl && \ - $(ROBOT) remove -i $@.tmp.owl --base-iri $(URIBASE)/ENVO --axioms external --preserve-structure false --trim false -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + curl -L $(OBOBASE)/envo.owl --create-dirs -o $(TMPDIR)/envo-download.owl --retry 4 --max-time 200 && \ + $(ROBOT) remove -i $(TMPDIR)/envo-download.owl --base-iri $(OBOBASE)/ENVO --axioms external --preserve-structure false --trim false -o $(TMPDIR)/$@.owl ## ONTOLOGY: go .PHONY: mirror-go .PRECIOUS: $(MIRRORDIR)/go.owl mirror-go: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then curl -L $(OBOBASE)/go.owl --create-dirs -o $(MIRRORDIR)/go.owl --retry 4 --max-time 200 &&\ - $(ROBOT) convert -i $(MIRRORDIR)/go.owl -o $@.tmp.owl && \ - $(ROBOT) remove -i $@.tmp.owl --base-iri $(URIBASE)/GO --axioms external --preserve-structure false --trim false -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + curl -L $(OBOBASE)/go.owl --create-dirs -o $(TMPDIR)/go-download.owl --retry 4 --max-time 200 && \ + $(ROBOT) remove -i $(TMPDIR)/go-download.owl --base-iri $(OBOBASE)/GO --axioms external --preserve-structure false --trim false -o $(TMPDIR)/$@.owl ## ONTOLOGY: other @@ -518,41 +569,41 @@ mirror-go: | $(TMPDIR) .PHONY: mirror-orcidio .PRECIOUS: $(MIRRORDIR)/orcidio.owl mirror-orcidio: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then $(ROBOT) convert -I https://w3id.org/orcidio/orcidio.owl -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + $(ROBOT) convert -I https://w3id.org/orcidio/orcidio.owl -o $(TMPDIR)/$@.owl ## ONTOLOGY: uberon .PHONY: mirror-uberon .PRECIOUS: $(MIRRORDIR)/uberon.owl mirror-uberon: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then curl -L $(OBOBASE)/uberon.owl --create-dirs -o $(MIRRORDIR)/uberon.owl --retry 4 --max-time 200 &&\ - $(ROBOT) convert -i $(MIRRORDIR)/uberon.owl -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + curl -L $(OBOBASE)/uberon.owl --create-dirs -o $(TMPDIR)/uberon-download.owl --retry 4 --max-time 200 && \ + $(ROBOT) convert -i $(TMPDIR)/uberon-download.owl -o $(TMPDIR)/$@.owl ## ONTOLOGY: obi .PHONY: mirror-obi .PRECIOUS: $(MIRRORDIR)/obi.owl mirror-obi: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then curl -L $(OBOBASE)/obi.owl --create-dirs -o $(MIRRORDIR)/obi.owl --retry 4 --max-time 200 &&\ - $(ROBOT) convert -i $(MIRRORDIR)/obi.owl -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + curl -L $(OBOBASE)/obi.owl --create-dirs -o $(TMPDIR)/obi-download.owl --retry 4 --max-time 200 && \ + $(ROBOT) convert -i $(TMPDIR)/obi-download.owl -o $(TMPDIR)/$@.owl ## ONTOLOGY: cob .PHONY: mirror-cob .PRECIOUS: $(MIRRORDIR)/cob.owl mirror-cob: | $(TMPDIR) - if [ $(MIR) = true ] && [ $(IMP) = true ]; then curl -L $(OBOBASE)/cob.owl --create-dirs -o $(MIRRORDIR)/cob.owl --retry 4 --max-time 200 &&\ - $(ROBOT) convert -i $(MIRRORDIR)/cob.owl -o $@.tmp.owl &&\ - mv $@.tmp.owl $(TMPDIR)/$@.owl; fi + curl -L $(OBOBASE)/cob.owl --create-dirs -o $(TMPDIR)/cob-download.owl --retry 4 --max-time 200 && \ + $(ROBOT) convert -i $(TMPDIR)/cob-download.owl -o $(TMPDIR)/$@.owl $(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 @@ -641,9 +692,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 asserted-only --exclude-tautologies structural --annotate-inferred-axioms False \ + relax \ + reduce -r ELK \ + remove --base-iri http://purl.obolibrary.org/obo/RO_ --base-iri http://purl.obolibrary.org/obo/BFO_0000050 --base-iri http://purl.obolibrary.org/obo/BFO_0000051 --base-iri http://purl.obolibrary.org/obo/BFO_0000060 --base-iri http://purl.obolibrary.org/obo/BFO_0000062 --base-iri http://purl.obolibrary.org/obo/BFO_0000063 --base-iri http://purl.obolibrary.org/obo/BFO_0000066 --base-iri http://purl.obolibrary.org/obo/BFO_0000067 --base-iri http://purl.obolibrary.org/obo/BFO_0000054 --base-iri http://purl.obolibrary.org/obo/BFO_0000055 --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) \ @@ -711,13 +766,16 @@ update_repo: -# 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 @@ -736,6 +794,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 ro-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 @@ -753,7 +812,7 @@ Imports management: Editor utilities: * validate_idranges: Make sure your ID ranges file is formatted correctly -* normalize_src: Load and safe your ro-edit file after you to make sure its serialised correctly +* normalize_src: Load and save your ro-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/imports/cob_import.owl b/src/ontology/imports/cob_import.owl index 7e5506bf..9f5d2164 100644 --- a/src/ontology/imports/cob_import.owl +++ b/src/ontology/imports/cob_import.owl @@ -7,9 +7,9 @@ Prefix(rdfs:=) Ontology( - + Annotation( ) -Annotation(owl:versionInfo "2024-02-09") +Annotation(owl:versionInfo "2024-03-02") Declaration(Class()) Declaration(Class()) @@ -57,23 +57,17 @@ AnnotationAssertion(rdfs:label "def # Object Properties ############################ -# Object Property: (part of) +# Object Property: () -AnnotationAssertion(rdfs:label "part of") InverseObjectProperties( ) TransitiveObjectProperty() -# Object Property: (has part) - -AnnotationAssertion(rdfs:label "has part") - # Object Property: (realized in) AnnotationAssertion(rdfs:label "realized in"@en) -# Object Property: (occurs in) +# Object Property: () -AnnotationAssertion(rdfs:label "occurs in") InverseObjectProperties( ) ObjectPropertyDomain( ) @@ -81,35 +75,25 @@ ObjectPropertyDomain( "contains process"@en) -# Object Property: (characteristic of) +# Object Property: () -AnnotationAssertion(rdfs:label "characteristic of"@en) InverseObjectProperties( ) -# Object Property: (has characteristic) +# Object Property: () -AnnotationAssertion(rdfs:label "has characteristic") -AnnotationAssertion(rdfs:seeAlso "https://github.com/oborel/obo-relations/pull/284") InverseFunctionalObjectProperty() ObjectPropertyRange( ) -# Object Property: (participates in) +# Object Property: () -AnnotationAssertion(rdfs:label "participates in"@en) InverseObjectProperties( ) -# Object Property: (has participant) +# Object Property: () -AnnotationAssertion(rdfs:label "has participant") ObjectPropertyDomain( ) -# Object Property: (is concretized as) - -AnnotationAssertion(rdfs:label "is concretized as"@en) - -# Object Property: (enabled by) +# Object Property: () -AnnotationAssertion(rdfs:label "enabled by") SubObjectPropertyOf( ) diff --git a/src/ontology/ro-odk.yaml b/src/ontology/ro-odk.yaml index dbc8e4ab..8f454173 100644 --- a/src/ontology/ro-odk.yaml +++ b/src/ontology/ro-odk.yaml @@ -1,6 +1,7 @@ id: ro title: "OBO Relations Ontology" github_org: oborel +git_main_branch: master repo: obo-relations report_fail_on: Error edit_format: owl @@ -18,6 +19,12 @@ namespaces: - http://purl.obolibrary.org/obo/BFO_0000050 - http://purl.obolibrary.org/obo/BFO_0000051 - http://purl.obolibrary.org/obo/BFO_0000060 + - http://purl.obolibrary.org/obo/BFO_0000062 + - http://purl.obolibrary.org/obo/BFO_0000063 + - http://purl.obolibrary.org/obo/BFO_0000066 + - http://purl.obolibrary.org/obo/BFO_0000067 + - http://purl.obolibrary.org/obo/BFO_0000054 + - http://purl.obolibrary.org/obo/BFO_0000055 import_group: annotation_properties: - rdfs:label diff --git a/src/ontology/ro.Makefile b/src/ontology/ro.Makefile index 38c327f5..f8d11d12 100644 --- a/src/ontology/ro.Makefile +++ b/src/ontology/ro.Makefile @@ -53,9 +53,34 @@ $(IMPORTDIR)/cob_import.owl: $(MIRRORDIR)/cob.owl $(IMPORTDIR)/cob_terms_combine if [ $(IMP) = true ]; then $(ROBOT) query -i $< --update ../sparql/preprocess-module.ru \ extract -T $(IMPORTDIR)/cob_terms_combined.txt --copy-ontology-annotations true --force true --method BOT \ remove $(patsubst %, --term %, $(ANNOTATION_PROPERTIES)) -T $(IMPORTDIR)/cob_terms_combined.txt --select complement \ + remove --select "RO:* BFO:0000050* BFO:0000051* BFO:0000060* BFO:0000066*" --axioms "annotation" \ query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \ $(ANNOTATE_CONVERT_FILE); fi +# ======================================== +# Custom imports +# ======================================== + +# This filter contains all property characteristic related to RO entities +# Note: For some reason, IrreflexiveObjectProperty is not supported +tmp/missing-base.owl: $(EDIT_PREPROCESSED) $(ONTOLOGYTERMS) + $(ROBOT) merge -i $(EDIT_PREPROCESSED) \ + filter -T $(ONTOLOGYTERMS) --trim false --axioms "AsymmetricObjectProperty FunctionalObjectProperty FunctionalDataProperty InverseFunctionalObjectProperty SymmetricObjectProperty TransitiveObjectProperty InverseObjectProperties ObjectPropertyDomain DataPropertyDomain DataPropertyRange ObjectPropertyRange" \ + -o $@.tmp.owl && mv $@.tmp.owl $@ + +# TODO: This goal (and tmp/missing-base.owl) can be removed once https://github.com/ontodev/robot/issues/1108 is resolved +$(ONT)-base.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(IMPORT_FILES) tmp/missing-base.owl + $(ROBOT_RELEASE_IMPORT_MODE) \ + reason --reasoner ELK --equivalent-classes-allowed asserted-only --exclude-tautologies structural --annotate-inferred-axioms False \ + relax \ + reduce -r ELK \ + remove --base-iri http://purl.obolibrary.org/obo/RO_ --base-iri http://purl.obolibrary.org/obo/BFO_0000050 --base-iri http://purl.obolibrary.org/obo/BFO_0000051 --base-iri http://purl.obolibrary.org/obo/BFO_0000060 --base-iri http://purl.obolibrary.org/obo/BFO_0000062 --base-iri http://purl.obolibrary.org/obo/BFO_0000063 --base-iri http://purl.obolibrary.org/obo/BFO_0000066 --base-iri http://purl.obolibrary.org/obo/BFO_0000067 --base-iri http://purl.obolibrary.org/obo/BFO_0000054 --base-iri http://purl.obolibrary.org/obo/BFO_0000055 --axioms external --preserve-structure false --trim false \ + merge -i tmp/missing-base.owl \ + $(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) \ + --output $@.tmp.owl && mv $@.tmp.owl $@ + # ======================================== # DOCUMENTATION diff --git a/src/ontology/run.sh b/src/ontology/run.sh index 2718ff67..873e9bdf 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:--Xmx8G} 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 00000000..45d431d1 --- /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 395ee647..372412e8 100644 --- a/src/scripts/update_repo.sh +++ b/src/scripts/update_repo.sh @@ -21,10 +21,11 @@ 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 + 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/iri-range-violation.sparql b/src/sparql/iri-range-violation.sparql index 66d8e919..2316f96c 100644 --- a/src/sparql/iri-range-violation.sparql +++ b/src/sparql/iri-range-violation.sparql @@ -13,7 +13,7 @@ WHERE { oboInOwl:inSubset dcterms:contributor } ?term ?property ?value . - FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/RO_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000050") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000051") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000060"))) + FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/RO_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000050") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000051") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000060") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000062") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000063") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000066") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000067") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000054") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000055"))) FILTER (!isIRI(?value)) } diff --git a/src/sparql/label-with-iri-violation.sparql b/src/sparql/label-with-iri-violation.sparql index 7f701bcb..8f092090 100644 --- a/src/sparql/label-with-iri-violation.sparql +++ b/src/sparql/label-with-iri-violation.sparql @@ -4,6 +4,6 @@ SELECT ?term ?value WHERE { ?term rdfs:label ?value . FILTER (REGEX(?value, "http[s]?[:]")) - FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/RO_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000050") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000051") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000060"))) + FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/RO_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000050") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000051") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000060") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000062") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000063") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000066") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000067") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000054") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000055"))) } diff --git a/src/sparql/owldef-self-reference-violation.sparql b/src/sparql/owldef-self-reference-violation.sparql index 1efed040..a9fa013a 100644 --- a/src/sparql/owldef-self-reference-violation.sparql +++ b/src/sparql/owldef-self-reference-violation.sparql @@ -7,6 +7,6 @@ SELECT ?term WHERE { { ?term owl:equivalentClass [ owl:intersectionOf [ rdf:rest*/rdf:first ?term ] ] } UNION { ?term owl:equivalentClass [ owl:intersectionOf [ rdf:rest*/rdf:first [ owl:someValuesFrom ?term ] ] ] } - FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/RO_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000050") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000051") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000060"))) + FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/RO_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000050") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000051") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000060") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000062") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000063") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000066") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000067") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000054") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000055"))) } diff --git a/src/sparql/ro_terms.sparql b/src/sparql/ro_terms.sparql index 40179a04..52a4dd44 100644 --- a/src/sparql/ro_terms.sparql +++ b/src/sparql/ro_terms.sparql @@ -3,5 +3,5 @@ WHERE { { ?s1 ?p1 ?term . } UNION { ?term ?p2 ?o2 . } - FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/RO_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000050") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000051") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000060"))) + FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/RO_") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000050") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000051") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000060") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000062") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000063") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000066") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000067") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000054") || STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/BFO_0000055"))) }