Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental migration to ODK 1.5 #228

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 28 additions & 25 deletions src/ontology/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ----------------------------------------
# Makefile for oba
# Generated using ontology-development-kit
# ODK Version: v1.4
# ODK Version: v1.5
# ----------------------------------------
# IMPORTANT: DO NOT EDIT THIS FILE. To override default make goals, use oba.Makefile instead

Expand Down Expand Up @@ -44,7 +44,7 @@ REPORT_PROFILE_OPTS = --profile $(ROBOT_PROFILE)
OBO_FORMAT_OPTIONS =
SPARQL_VALIDATION_CHECKS = equivalent-classes owldef-self-reference
SPARQL_EXPORTS = basic-report
ODK_VERSION_MAKEFILE = v1.4
ODK_VERSION_MAKEFILE = v1.5

TODAY ?= $(shell date +%Y-%m-%d)
OBODATE ?= $(shell date +'%d:%m:%Y %H:%M')
Expand All @@ -62,7 +62,7 @@ PATTERN_RELEASE_FILES= $(PATTERNDIR)/definitions.owl $(PATTERNDIR)/pattern.

FORMATS = $(sort owl obo json owl)
FORMATS_INCL_TSV = $(sort $(FORMATS) tsv)
RELEASE_ARTEFACTS = $(sort $(ONT)-base $(ONT)-full $(ONT)-basic $(ONT)-baseplus )
RELEASE_ARTEFACTS = $(sort $(ONT)-base $(ONT)-full $(ONT)-basic $(ONT)-baselite )

# ----------------------------------------
# Top-level targets
Expand All @@ -80,6 +80,10 @@ all_odk: odkversion test all_assets release_diff
test: odkversion dosdp_validation 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

Expand Down Expand Up @@ -430,7 +434,7 @@ mirror-ro: | $(TMPDIR)
.PRECIOUS: $(MIRRORDIR)/chebi.owl
mirror-chebi: | $(TMPDIR)
if [ $(MIR) = true ] && [ $(IMP) = true ]; then $(ROBOT) convert -I https://raw.githubusercontent.com/obophenotype/chebi_obo_slim/main/chebi_slim.owl -o [email protected] && \
$(ROBOT) remove -i [email protected] --base-iri $(URIBASE)/CHEBI --axioms external --preserve-structure false --trim false -o [email protected] &&\
$(ROBOT) remove -i [email protected] --base-iri $(OBOBASE)/CHEBI --axioms external --preserve-structure false --trim false -o [email protected] &&\
mv [email protected] $(TMPDIR)/[email protected]; fi


Expand Down Expand Up @@ -498,7 +502,7 @@ mirror-ncbitaxon: | $(TMPDIR)
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 [email protected] && \
$(ROBOT) remove -i [email protected] --base-iri $(URIBASE)/UBERON --axioms external --preserve-structure false --trim false -o [email protected] &&\
$(ROBOT) remove -i [email protected] --base-iri $(OBOBASE)/UBERON --axioms external --preserve-structure false --trim false -o [email protected] &&\
mv [email protected] $(TMPDIR)/[email protected]; fi


Expand All @@ -523,7 +527,7 @@ mirror-nbo: | $(TMPDIR)
.PRECIOUS: $(MIRRORDIR)/pr.owl
mirror-pr: | $(TMPDIR)
if [ $(MIR) = true ] && [ $(IMP) = true ]; then $(ROBOT) convert -I https://raw.githubusercontent.com/obophenotype/pro_obo_slim/master/pr_slim.owl -o [email protected] && \
$(ROBOT) remove -i [email protected] --base-iri $(URIBASE)/PR --axioms external --preserve-structure false --trim false -o [email protected] &&\
$(ROBOT) remove -i [email protected] --base-iri $(OBOBASE)/PR --axioms external --preserve-structure false --trim false -o [email protected] &&\
mv [email protected] $(TMPDIR)/[email protected]; fi


Expand All @@ -533,7 +537,7 @@ mirror-pr: | $(TMPDIR)
mirror-so: | $(TMPDIR)
if [ $(MIR) = true ] && [ $(IMP) = true ]; then curl -L $(OBOBASE)/so.owl --create-dirs -o $(MIRRORDIR)/so.owl --retry 4 --max-time 200 &&\
$(ROBOT) convert -i $(MIRRORDIR)/so.owl -o [email protected] && \
$(ROBOT) remove -i [email protected] --base-iri $(URIBASE)/SO --axioms external --preserve-structure false --trim false -o [email protected] &&\
$(ROBOT) remove -i [email protected] --base-iri $(OBOBASE)/SO --axioms external --preserve-structure false --trim false -o [email protected] &&\
mv [email protected] $(TMPDIR)/[email protected]; fi


Expand All @@ -543,7 +547,7 @@ mirror-so: | $(TMPDIR)
mirror-po: | $(TMPDIR)
if [ $(MIR) = true ] && [ $(IMP) = true ]; then curl -L $(OBOBASE)/po.owl --create-dirs -o $(MIRRORDIR)/po.owl --retry 4 --max-time 200 &&\
$(ROBOT) convert -i $(MIRRORDIR)/po.owl -o [email protected] && \
$(ROBOT) remove -i [email protected] --base-iri $(URIBASE)/PO --axioms external --preserve-structure false --trim false -o [email protected] &&\
$(ROBOT) remove -i [email protected] --base-iri $(OBOBASE)/PO --axioms external --preserve-structure false --trim false -o [email protected] &&\
mv [email protected] $(TMPDIR)/[email protected]; fi


Expand All @@ -553,14 +557,14 @@ mirror-po: | $(TMPDIR)
mirror-bfo: | $(TMPDIR)
if [ $(MIR) = true ] && [ $(IMP) = true ]; then curl -L $(OBOBASE)/bfo.owl --create-dirs -o $(MIRRORDIR)/bfo.owl --retry 4 --max-time 200 &&\
$(ROBOT) convert -i $(MIRRORDIR)/bfo.owl -o [email protected] && \
$(ROBOT) remove -i [email protected] --base-iri $(URIBASE)/BFO --axioms external --preserve-structure false --trim false -o [email protected] &&\
$(ROBOT) remove -i [email protected] --base-iri $(OBOBASE)/BFO --axioms external --preserve-structure false --trim false -o [email protected] &&\
mv [email protected] $(TMPDIR)/[email protected]; fi

ALL_MIRRORS = $(patsubst %, $(MIRRORDIR)/%.owl, $(IMPORTS))
MERGE_MIRRORS = true

$(MIRRORDIR)/merged.owl: $(ALL_MIRRORS)
if [ $(IMP) = true ] && [ $(MERGE_MIRRORS) = true ]; then $(ROBOT) merge $(patsubst %, -i %, $^) -o $@; fi
if [ $(IMP) = true ] && [ $(MERGE_MIRRORS) = true ]; then $(ROBOT) merge $(patsubst %, -i %, $^) remove --axioms equivalent --preserve-structure false -o $@; fi
.PRECIOUS: $(MIRRORDIR)/merged.owl


Expand Down Expand Up @@ -722,9 +726,9 @@ $(ONT)-basic.json: $(ONT)-basic.owl
$(ROBOT) annotate --input $< --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \
convert --check false -f json -o [email protected] &&\
mv [email protected] $@
$(ONT)-baseplus.obo: $(ONT)-baseplus.owl
$(ONT)-baselite.obo: $(ONT)-baselite.owl
$(ROBOT) convert --input $< --check false -f obo $(OBO_FORMAT_OPTIONS) -o [email protected] && grep -v ^owl-axioms [email protected] > $@ && rm [email protected]
$(ONT)-baseplus.json: $(ONT)-baseplus.owl
$(ONT)-baselite.json: $(ONT)-baselite.owl
$(ROBOT) annotate --input $< --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \
convert --check false -f json -o [email protected] &&\
mv [email protected] $@
Expand Down Expand Up @@ -756,15 +760,8 @@ 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
# base: A version of the ontology that does not include any externally imported axioms.
$(ONT)-base.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC)
$(ROBOT_RELEASE_IMPORT_MODE_BASE) \
$(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 [email protected] && mv [email protected] $@
# baseplus: A highly experimental variant of base, UNSTABLE. Only to be used experimentally (may disappear in future ODK releases).
$(ONT)-baseplus.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(IMPORT_FILES)
$(ROBOT_RELEASE_IMPORT_MODE) \
reason --reasoner ELK --equivalent-classes-allowed asserted-only --exclude-tautologies structural \
relax \
Expand All @@ -774,12 +771,17 @@ $(ONT)-baseplus.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(IMPORT_FILES)
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 [email protected] && mv [email protected] $@
# baselite: All the axioms as they are editted by the editors, excluding reasoning. This is currently the same as "base". Only to be used experimentally (may disappear in future ODK releases).
$(ONT)-baselite.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC)
$(ROBOT_RELEASE_IMPORT_MODE_BASE) \
$(SHARED_ROBOT_COMMANDS) annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \
--output [email protected] && mv [email protected] $@
# Full: The full artefacts with imports merged, reasoned.
$(ONT)-full.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(IMPORT_FILES)
$(ROBOT_RELEASE_IMPORT_MODE) \
reason --reasoner ELK --equivalent-classes-allowed asserted-only --exclude-tautologies structural \
relax \
reduce -r ELK \
reason --reasoner ELK --equivalent-classes-allowed asserted-only --exclude-tautologies structural \
relax \
reduce -r ELK \
$(SHARED_ROBOT_COMMANDS) annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) --output [email protected] && mv [email protected] $@

# foo-basic: A version of -simple containing only relationships using relations on a configurable whitelist (default = BFO:0000050 (?)).
Expand Down Expand Up @@ -881,6 +883,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 oba-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
Expand All @@ -907,8 +910,8 @@ DOSDP templates

Editor utilities:
* validate_idranges: Make sure your ID ranges file is formatted correctly
* normalize_src: Load and safe your oba-edit file after you to make sure its serialised correctly
* normalize_obo_src: Load and safe your oba-edit.obo file after you to merge duplicate annotation assertions
* normalize_src: Load and save your oba-edit file after you to make sure its serialised correctly
* normalize_obo_src: Load and save your oba-edit.obo file after you to merge duplicate annotation assertions
* 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.
Expand Down
2 changes: 1 addition & 1 deletion src/ontology/oba-odk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ release_artefacts:
- base
- full
- basic
- baseplus
- baselite
primary_release: full
import_group:
use_base_merging: TRUE
Expand Down
8 changes: 8 additions & 0 deletions src/ontology/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ ODK_TAG=${ODK_TAG:-latest}
ODK_JAVA_OPTS=${ODK_JAVA_OPTS:--Xmx8G}
ODK_DEBUG=${ODK_DEBUG:-no}

# 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
Expand Down