Repository navigation
fix(validation): validate ontology prefix IRIs - #755
Merged
jbonofre merged 2 commits intoNov 18, 2026
Merged
Conversation
jbonofre
self-requested a review
November 18, 2026 21:54
jbonofre
force-pushed
the
fix/ontology-prefix-iri-validation
branch
from
November 18, 2026 22:00
ba02699 to
840f8ed
Compare
jbonofre
approved these changes
Nov 18, 2026
jbonofre
left a comment
Member
There was a problem hiding this comment.
LGTM, thanks for addressing this!
The check in validate_ontology cleanly closes the gap where format: iri in ontology/ontology.json isn't enforced by Draft202012Validator by default, while keeping the validator dependency-free, tolerating malformed shapes on direct calls, and keeping [Schema] vs [Reference] error boundaries intact. Unit and CLI regression tests look solid as well.
I rebased from main.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The ontology schema declares each
prefixesvalue withformat: iri, but the Python validator does not enable an IRI format checker. As a result, an invalid namespace value such asnot a valid iri at all !!!currently passes validation.This follow-up is related to #479, which added preservation of
iriandprefixesthrough converter round-trips, and the gap identified in the review of #489. It is complementary to the ontology reference checks in #488; those issues are already closed, so this PR does not claim to close them.The validator now requires each namespace value to have an absolute IRI scheme and contain no whitespace. The check accepts HTTPS and URN examples without adding a dependency. It intentionally does not implement full RFC 3987 validation.
Reproduction
Input:
Before this change, running:
reported
Validation PASSED. With this change, the same command exits with status 1 and reports:Testing
make check— passed on Python 3.13.15 for validator tests (755 passed, 1 skipped), Python SDK (278 passed), spec script tests (15 passed), compliance grader (50 passed), canonical examples, generated spec types, and all 17 compliance fixtures.git diff --check— passed.Checklist
Validation
Tests
make check)Compliance
Specification, ontology definitions, converter behavior, documentation, examples, and contribution-process files are unchanged, so those checklist items do not apply. No new source files were added; no vendored source was copied.
Written with LLM assistance; I reviewed the change, regression tests, and complete diff.