-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Instead of hard-coding `{{ project.reasoner }}` at several places in the standard Makefile (whenever a reasoner is required), we add a new Make variable REASONER which is set to the value of `{{ project.reasoner }}`, and which is then used whenever a reasoner is required. This allows: (1) quickly changing the reasoner used by an entire project, without having to change the ODK configuration and re-generate the Makefile (e.g. for temporarily testing another reasoner); (2) custom worklows in $(ONT).Makefile to automatically use the same reasoner as the standard workflows, by using the REASONER variable themselves instead of hard-coding a reasoner's name. closes #1139
- Loading branch information
Showing
1 changed file
with
11 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ SRC = $(ONT)-edit.$(EDIT_FORMAT) | |
MAKE_FAST= $(MAKE) IMP=false PAT=false COMP=false MIR=false | ||
CATALOG= {{ project.catalog_file }} | ||
ROBOT= robot --catalog $(CATALOG) | ||
REASONER= {{ project.reasoner }} | ||
{% if project.owltools_memory|length %}OWLTOOLS_MEMORY= {{ project.owltools_memory }}{% endif %} | ||
OWLTOOLS= {% if project.owltools_memory|length %}OWLTOOLS_MEMORY=$(OWLTOOLS_MEMORY) {% endif %}owltools --use-catalog | ||
RELEASEDIR= ../.. | ||
|
@@ -131,7 +132,7 @@ release_diff: $(REPORTDIR)/release-diff.md | |
|
||
.PHONY: reason_test | ||
reason_test: $(EDIT_PREPROCESSED) | ||
$(ROBOT) reason --input $< --reasoner {{ project.reasoner }} --equivalent-classes-allowed {{ project.allow_equivalents }} \ | ||
$(ROBOT) reason --input $< --reasoner $(REASONER) --equivalent-classes-allowed {{ project.allow_equivalents }} \ | ||
--exclude-tautologies {{ project.exclude_tautologies }} --output test.owl && rm test.owl | ||
|
||
.PHONY: odkversion | ||
|
@@ -1118,10 +1119,10 @@ merge $(patsubst %, -i %, $(OTHER_SRC)) {% endif %} | |
# 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) \{% if project.release_use_reasoner %} | ||
reason --reasoner {{ project.reasoner }} --equivalent-classes-allowed {{ project.allow_equivalents }} --exclude-tautologies {{ project.exclude_tautologies }} --annotate-inferred-axioms {{ project.release_annotate_inferred_axioms|default('false')|lower }} \{% if project.release_materialize_object_properties is defined and project.release_materialize_object_properties %} | ||
reason --reasoner $(REASONER) --equivalent-classes-allowed {{ project.allow_equivalents }} --exclude-tautologies {{ project.exclude_tautologies }} --annotate-inferred-axioms {{ project.release_annotate_inferred_axioms|default('false')|lower }} \{% if project.release_materialize_object_properties is defined and project.release_materialize_object_properties %} | ||
materialize {% for iri in project.release_materialize_object_properties %}--term {{iri}} {% endfor %} \{% endif %}{% endif %} | ||
relax $(RELAX_OPTIONS) \{% if project.release_use_reasoner %} | ||
reduce -r {{ project.reasoner }} \{% endif %} | ||
reduce -r $(REASONER) \{% endif %} | ||
remove {% if project.namespaces is not none %}{% for iri in project.namespaces %}--base-iri {{iri}} {% endfor %}{% else %}--base-iri $(URIBASE)/{{ project.id.upper() }} {% endif %}--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 \ | ||
|
@@ -1141,10 +1142,10 @@ $(ONT)-baselite.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) | |
# Full: The full artefacts with imports merged, reasoned. | ||
$(ONT)-full.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(IMPORT_FILES) | ||
$(ROBOT_RELEASE_IMPORT_MODE) \ | ||
reason --reasoner {{ project.reasoner }} --equivalent-classes-allowed {{ project.allow_equivalents }} --exclude-tautologies {{ project.exclude_tautologies }} \{% if project.release_materialize_object_properties is defined and project.release_materialize_object_properties %} | ||
reason --reasoner $(REASONER) --equivalent-classes-allowed {{ project.allow_equivalents }} --exclude-tautologies {{ project.exclude_tautologies }} \{% if project.release_materialize_object_properties is defined and project.release_materialize_object_properties %} | ||
materialize {% for iri in project.release_materialize_object_properties %}--term {{iri}} {% endfor %} \{% endif %} | ||
relax $(RELAX_OPTIONS) \ | ||
reduce -r {{ project.reasoner }} \ | ||
reduce -r $(REASONER) \ | ||
$(SHARED_ROBOT_COMMANDS) annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) {% if project.release_date -%}--annotation oboInOwl:date "$(OBODATE)" {% endif -%}--output [email protected] && mv [email protected] $@ | ||
{% endif -%} | ||
|
||
|
@@ -1161,11 +1162,11 @@ $(ONT)-non-classified.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(IMPORT_FILES) | |
# remove --select imports --trim false | ||
$(ONT)-simple.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(SIMPLESEED) $(IMPORT_FILES) | ||
$(ROBOT_RELEASE_IMPORT_MODE) \{% if project.release_use_reasoner %} | ||
reason --reasoner {{ project.reasoner }} --equivalent-classes-allowed {{ project.allow_equivalents }} --exclude-tautologies {{ project.exclude_tautologies }} --annotate-inferred-axioms {{ project.release_annotate_inferred_axioms|default('false')|lower }} \{% endif %} | ||
reason --reasoner $(REASONER) --equivalent-classes-allowed {{ project.allow_equivalents }} --exclude-tautologies {{ project.exclude_tautologies }} --annotate-inferred-axioms {{ project.release_annotate_inferred_axioms|default('false')|lower }} \{% endif %} | ||
relax $(RELAX_OPTIONS) \ | ||
remove --axioms equivalent \ | ||
filter --term-file $(SIMPLESEED) --select "annotations ontology anonymous self" --trim true --signature true \{% if project.release_use_reasoner %} | ||
reduce -r {{ project.reasoner }} \{% endif %} | ||
reduce -r $(REASONER) \{% endif %} | ||
query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru \ | ||
$(SHARED_ROBOT_COMMANDS) annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) {% if project.release_date -%}--annotation oboInOwl:date "$(OBODATE)" {% endif -%}--output [email protected] && mv [email protected] $@ | ||
{% endif -%} | ||
|
@@ -1177,7 +1178,7 @@ $(ONT)-simple.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(SIMPLESEED) $(IMPORT_FILE | |
$(ONT)-simple-non-classified.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(SIMPLESEED) $(IMPORT_FILES) | ||
$(ROBOT_RELEASE_IMPORT_MODE_BASE) \ | ||
remove --axioms equivalent \{% if project.release_use_reasoner %} | ||
reduce -r {{ project.reasoner }} \{% endif %} | ||
reduce -r $(REASONER) \{% endif %} | ||
filter --select ontology --term-file $(SIMPLESEED) --trim false \ | ||
$(SHARED_ROBOT_COMMANDS) annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) {% if project.release_date -%}--annotation oboInOwl:date "$(OBODATE)" {% endif -%}--output [email protected] && mv [email protected] $@ | ||
{% endif -%} | ||
|
@@ -1196,13 +1197,13 @@ $(ONT)-international.owl: $(ONT).owl $(TRANSLATIONS_OWL) | |
# removes any axioms that contains one of the ops that not in the whitelist file | ||
$(ONT)-basic.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(SIMPLESEED) $(KEEPRELATIONS) $(IMPORT_FILES) | ||
$(ROBOT_RELEASE_IMPORT_MODE) \{% if project.release_use_reasoner %} | ||
reason --reasoner {{ project.reasoner }} --equivalent-classes-allowed {{ project.allow_equivalents }} --exclude-tautologies {{ project.exclude_tautologies }} --annotate-inferred-axioms {{ project.release_annotate_inferred_axioms|default('false')|lower }} \{% endif %} | ||
reason --reasoner $(REASONER) --equivalent-classes-allowed {{ project.allow_equivalents }} --exclude-tautologies {{ project.exclude_tautologies }} --annotate-inferred-axioms {{ project.release_annotate_inferred_axioms|default('false')|lower }} \{% endif %} | ||
relax $(RELAX_OPTIONS) \ | ||
remove --axioms equivalent \ | ||
remove --axioms disjoint \ | ||
remove --term-file $(KEEPRELATIONS) --select complement --select object-properties --trim true \ | ||
filter --term-file $(SIMPLESEED) --select "annotations ontology anonymous self" --trim true --signature true \ | ||
reduce -r {{ project.reasoner }} \ | ||
reduce -r $(REASONER) \ | ||
$(SHARED_ROBOT_COMMANDS) annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) {% if project.release_date -%}--annotation oboInOwl:date "$(OBODATE)" {% endif -%}--output [email protected] && mv [email protected] $@ | ||
{% endif -%} | ||
{% for r in project.release_artefacts %} | ||
|