Skip to content

Commit bfcff5e

Browse files
committed
Add ODK configuration options for relax/reduce options.
Add two new options in the ODK configuration object: * robot_relax_options, for options to pass to ROBOT's relax command; * robot_reduce_options, for options to pass to ROBOT's reduce command. This way users can override the ODK's default options for these commands by editing their $(ONT)-odk.yaml file rather than by editing their $(ONT).Makefile, because apparently editing a Makefile would be much more difficult to users than editing the YAML configuration file. This is absurd as editing the custom Makefile is in fact likely to be much easier, since users can look at the standard Makefile to know what the variables they must override are (RELAX_OPTIONS, REDUCE_OPTIONS), whereas editing the YAML file will require them to look up the ODK documentation to find out about `robot_relax_options` and `robot_reduce_options`. But well, there is already so much absurd things in the ODK than one or two more don't matter I guess.
1 parent dd260b2 commit bfcff5e

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

odk/odk.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,12 @@ class OntologyProject(JsonSchemaMixin):
793793
obo_format_options : str = ""
794794
"""Additional args to pass to robot when saving to obo. The default is '--clean-obo "strict drop-untranslatable-axioms"'."""
795795

796+
robot_relax_options : str = "--include-subclass-of true"
797+
"""Additional options to pass to robot's relax command."""
798+
799+
robot_reduce_options : str = "--include-subproperties true"
800+
"""Additional options to pass to robot's reduce command."""
801+
796802
catalog_file : str = "catalog-v001.xml"
797803
"""Name of the catalog file to be used by the build."""
798804

template/src/ontology/Makefile.jinja2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ OBO_FORMAT_OPTIONS = {{ project.obo_format_options }}
6868
SPARQL_VALIDATION_CHECKS = {% for x in project.robot_report.custom_sparql_checks|default(['owldef-self-reference', 'iri-range', 'label-with-iri', 'multiple-replaced_by']) %}{{ x }} {% endfor %}
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 %}
71-
RELAX_OPTIONS = --include-subclass-of true
72-
REDUCE_OPTIONS = --include-subproperties true
71+
RELAX_OPTIONS = {{ project.robot_relax_options }}
72+
REDUCE_OPTIONS = {{ project.robot_reduce_options }}
7373

7474
TODAY ?= $(shell date +%Y-%m-%d)
7575
OBODATE ?= $(shell date +'%d:%m:%Y %H:%M')

0 commit comments

Comments
 (0)