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

Add ability to set base IRIs for report in ODK #609

Merged
merged 4 commits into from
May 27, 2022
Merged
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
3 changes: 3 additions & 0 deletions odk/odk.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ class ReportConfig(JsonSchemaMixin):
use_labels : bool = True
"""see http://robot.obolibrary.org/report#labels for details. """

use_base_iris: bool = True
"""If true, only reports on problems with entities belonging to this ontology. Set the base_iris using the 'namespaces' at project level."""

custom_profile : bool = False
"""This will replace the call to the standard OBO report to a custom profile instead."""

Expand Down
4 changes: 2 additions & 2 deletions template/src/ontology/Makefile.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ endif
# ----------------------------------------

$(REPORTDIR)/$(SRC)-obo-report.tsv: $(SRCMERGED) | $(REPORTDIR)
$(ROBOT) report -i $< $(REPORT_LABEL) $(REPORT_PROFILE_OPTS) --fail-on $(REPORT_FAIL_ON) --print 5 -o $@
$(ROBOT) report -i $< $(REPORT_LABEL) $(REPORT_PROFILE_OPTS) --fail-on $(REPORT_FAIL_ON) {% if project.robot_report.use_base_iris %}{% if project.namespaces is not none %}{% for iri in project.namespaces %}--base-iri {{ iri }} {% endfor %}{% else %}--base-iri $(URIBASE)/{{ project.id.upper() }}_ --base-iri $(URIBASE)/{{ project.id }} {% endif %}{% endif %} --print 5 -o $@

$(REPORTDIR)/%-obo-report.tsv: % | $(REPORTDIR)
$(ROBOT) report -i $< $(REPORT_LABEL) $(REPORT_PROFILE_OPTS) --fail-on $(REPORT_FAIL_ON) --print 5 -o $@
$(ROBOT) report -i $< $(REPORT_LABEL) $(REPORT_PROFILE_OPTS) --fail-on $(REPORT_FAIL_ON) {% if project.robot_report.use_base_iris %}{% if project.namespaces is not none %}{% for iri in project.namespaces %}--base-iri {{ iri }} {% endfor %}{% else %}--base-iri $(URIBASE)/{{ project.id.upper() }}_ --base-iri $(URIBASE)/{{ project.id }} {% endif %}{% endif %} --print 5 -o $@

# ----------------------------------------
# Release assets
Expand Down
22 changes: 22 additions & 0 deletions tests/test-robot-report-baseiri.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
id: rrcb
title: "Test ROBOT report: Base IRIs"
github_org: INCATools
repo: ontology-development-kit
edit_format: owl
namespaces:
- http://purl.obolibrary.org/obo/RRCB_
import_group:
products:
- id: ro
- id: omo
robot_report:
use_base_iris: True
release_reports: True
fail_on : ERROR
use_labels : False
custom_profile : True
report_on :
- edit
custom_sparql_checks : []
custom_sparql_exports :
- basic-report