Skip to content

Commit bf0becb

Browse files
committed
Include SubObjectPropertyOf axioms when reducing.
By default, ROBOT's `reduce` command does not take SubObjectPropertyOf axioms into account, which leads it to leave in place some axioms that are in fact redundant. We pass the `--include-subproperties true` option to all calls to `reduce` to change that behaviour. This is configurable at the Makefile level (by overriding the REDUCE_OPTIONS variable, either on the command line or in the custom Makefile), _not_ at the ODK level (as we already do with RELAX_OPTIONS).
1 parent 48b71bf commit bf0becb

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

template/src/ontology/Makefile.jinja2

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ SPARQL_VALIDATION_CHECKS = {% for x in project.robot_report.custom_sparql_check
6969
SPARQL_EXPORTS = {% for x in project.robot_report.custom_sparql_exports|default(['basic-report', 'class-count-by-prefix', 'edges', 'xrefs', 'obsoletes', 'synonyms']) %}{{ x }} {% endfor %}
7070
ODK_VERSION_MAKEFILE = {% if env is defined %}{{env['ODK_VERSION'] or "Unknown" }}{% else %}"Unknown"{% endif %}
7171
RELAX_OPTIONS = --include-subclass-of true
72+
REDUCE_OPTIONS = --include-subproperties true
7273

7374
TODAY ?= $(shell date +%Y-%m-%d)
7475
OBODATE ?= $(shell date +'%d:%m:%Y %H:%M')
@@ -1340,7 +1341,7 @@ $(ONT)-base.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(IMPORT_FILES)
13401341
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 %}
13411342
materialize {% for iri in project.release_materialize_object_properties %}--term {{iri}} {% endfor %} \{% endif %}{% endif %}
13421343
relax $(RELAX_OPTIONS) \{% if project.release_use_reasoner %}
1343-
reduce -r $(REASONER) \{% endif %}
1344+
reduce -r $(REASONER) $(REDUCE_OPTIONS) \{% endif %}
13441345
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 \
13451346
$(SHARED_ROBOT_COMMANDS) \
13461347
annotate --link-annotation http://purl.org/dc/elements/1.1/type http://purl.obolibrary.org/obo/IAO_8000001 \
@@ -1363,7 +1364,7 @@ $(ONT)-full.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(IMPORT_FILES)
13631364
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 %}
13641365
materialize {% for iri in project.release_materialize_object_properties %}--term {{iri}} {% endfor %} \{% endif %}
13651366
relax $(RELAX_OPTIONS) \
1366-
reduce -r $(REASONER) \
1367+
reduce -r $(REASONER) $(REDUCE_OPTIONS) \
13671368
$(SHARED_ROBOT_COMMANDS) annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) {% if project.release_date -%}--annotation oboInOwl:date "$(OBODATE)" {% endif -%}--output $@.tmp.owl && mv $@.tmp.owl $@
13681369
{% endif -%}
13691370

@@ -1384,7 +1385,7 @@ $(ONT)-simple.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(SIMPLESEED) $(IMPORT_FILE
13841385
relax $(RELAX_OPTIONS) \
13851386
remove --axioms equivalent \
13861387
filter --term-file $(SIMPLESEED) --select "annotations ontology anonymous self" --trim true --signature true \{% if project.release_use_reasoner %}
1387-
reduce -r $(REASONER) \{% endif %}
1388+
reduce -r $(REASONER) $(REDUCE_OPTIONS) \{% endif %}
13881389
odk:normalize --base-iri {{ project.uribase }} --subset-decls true --synonym-decls true \
13891390
repair --merge-axiom-annotations true \
13901391
$(SHARED_ROBOT_COMMANDS) annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) {% if project.release_date -%}--annotation oboInOwl:date "$(OBODATE)" {% endif -%}--output $@.tmp.owl && mv $@.tmp.owl $@
@@ -1397,7 +1398,7 @@ $(ONT)-simple.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(SIMPLESEED) $(IMPORT_FILE
13971398
$(ONT)-simple-non-classified.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(SIMPLESEED) $(IMPORT_FILES)
13981399
$(ROBOT_RELEASE_IMPORT_MODE_BASE) \
13991400
remove --axioms equivalent \{% if project.release_use_reasoner %}
1400-
reduce -r $(REASONER) \{% endif %}
1401+
reduce -r $(REASONER) $(REDUCE_OPTIONS) \{% endif %}
14011402
filter --select ontology --term-file $(SIMPLESEED) --trim false \
14021403
$(SHARED_ROBOT_COMMANDS) annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) {% if project.release_date -%}--annotation oboInOwl:date "$(OBODATE)" {% endif -%}--output $@.tmp.owl && mv $@.tmp.owl $@
14031404
{% endif -%}
@@ -1422,7 +1423,7 @@ $(ONT)-basic.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(SIMPLESEED) $(KEEPRELATION
14221423
remove --axioms disjoint \
14231424
remove --term-file $(KEEPRELATIONS) --select complement --select object-properties --trim true \
14241425
filter --term-file $(SIMPLESEED) --select "annotations ontology anonymous self" --trim true --signature true \
1425-
reduce -r $(REASONER) \
1426+
reduce -r $(REASONER) $(REDUCE_OPTIONS) \
14261427
$(SHARED_ROBOT_COMMANDS) annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) {% if project.release_date -%}--annotation oboInOwl:date "$(OBODATE)" {% endif -%}--output $@.tmp.owl && mv $@.tmp.owl $@
14271428
{% endif -%}
14281429
{% for r in project.release_artefacts %}

0 commit comments

Comments
 (0)