Skip to content

Commit 8078f88

Browse files
turbomamclaude
andcommitted
Fix metpo-base.* empty-artifact bug; protect against ODK 1.6 import management
Adds metpo.Makefile override for $(ONT)-base.owl to use --base-iri $(URIBASE)/metpo (lowercase) instead of the generated $(URIBASE)/METPO (uppercase). The uppercase form matched no METPO terms (all IRIs are https://w3id.org/metpo/<id>), silently producing empty base artifacts. Re-applies the fix from #463 which the Makefile regeneration in the ODK upgrade reverted. Also updates the comment on the $(ONT).owl / $(ONT).json overrides to accurately describe the uribase design tension rather than calling it an ODK template bug. Adds manage_import_declarations: FALSE to metpo-odk.yaml. ODK 1.6 introduced automatic rewriting of owl:imports in the edit file during update_repo; this flag disables that step, preventing failures if update_repo is run with the current uribase: https://w3id.org config. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent deb7e00 commit 8078f88

2 files changed

Lines changed: 25 additions & 4 deletions

File tree

src/ontology/metpo-odk.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@ components:
4343
use_dosdps: FALSE
4444
use_mappings: FALSE
4545
use_edit_file_imports: FALSE
46+
manage_import_declarations: FALSE
4647
uribase: https://w3id.org

src/ontology/metpo.Makefile

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,15 @@ components/metpo_sheet.owl: ../templates/stubs.tsv ../templates/metpo-properties
119119
--annotation owl:versionInfo $(TODAY) \
120120
convert -f ofn --output $@.tmp.owl && mv $@.tmp.owl $@
121121

122-
# Upstream ODK template bug: $(ONT).owl and $(ONT).json use $(URIBASE)/$@
123-
# which expands to https://w3id.org/metpo.owl (missing /metpo/ path segment).
124-
# Correct IRI is https://w3id.org/metpo/metpo.owl = $(ONTBASE)/$@.
125-
# Remove these overrides once the ODK template is fixed upstream.
122+
# The generated $(ONT).owl and $(ONT).json recipes use $(URIBASE)/$@ which
123+
# expands to https://w3id.org/metpo.owl — wrong (missing /metpo/ path segment).
124+
# The correct IRI is https://w3id.org/metpo/metpo.owl = $(ONTBASE)/$@.
125+
# Root cause: metpo-odk.yaml sets uribase: https://w3id.org (the bare domain)
126+
# because the ODK Python tooling derives ONTBASE as $(URIBASE)/$(id), and
127+
# changing uribase to https://w3id.org/metpo would give ONTBASE
128+
# https://w3id.org/metpo/metpo (double segment) and break all sub-artifact IRIs.
129+
# These recipe overrides are the correct long-term fix until ODK provides a way
130+
# to set URIBASE and ONTBASE independently in the config.
126131
# Tracked at: https://github.com/berkeleybop/metpo/issues/465
127132

128133
$(ONT).owl: $(ONT)-full.owl
@@ -133,3 +138,18 @@ $(ONT).json: $(ONT).owl
133138
$(ROBOT) annotate --input $< --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \
134139
convert --check false -f json -o $@.tmp.json &&\
135140
mv $@.tmp.json $@
141+
142+
# The generated $(ONT)-base.owl recipe uses --base-iri $(URIBASE)/METPO (uppercase)
143+
# which matches no METPO terms (all IRIs are lowercase https://w3id.org/metpo/<id>),
144+
# silently producing empty base artifacts. Fixed in https://github.com/berkeleybop/metpo/issues/463
145+
# and tracked as a known ODK upgrade regression in https://github.com/berkeleybop/metpo/issues/465.
146+
$(ONT)-base.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(IMPORT_FILES)
147+
$(ROBOT_RELEASE_IMPORT_MODE) \
148+
reason --reasoner $(REASONER) --equivalent-classes-allowed asserted-only --exclude-tautologies structural --annotate-inferred-axioms false \
149+
relax $(RELAX_OPTIONS) \
150+
reduce -r $(REASONER) $(REDUCE_OPTIONS) \
151+
remove --base-iri $(URIBASE)/metpo --axioms external --preserve-structure false --trim false \
152+
$(SHARED_ROBOT_COMMANDS) \
153+
annotate --link-annotation http://purl.org/dc/elements/1.1/type http://purl.obolibrary.org/obo/IAO_8000001 \
154+
--ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \
155+
--output $@.tmp.owl && mv $@.tmp.owl $@

0 commit comments

Comments
 (0)