fix(frame): keep reference-valued properties as IRIs - #161
Merged
Merged
Conversation
Contributor
Release previewMerging this PR would release v1.0.1 (current: Changelog preview (truncated)## v1.0.1 (2026-09-19)
### Bug Fixes
- **frame**: Keep reference-valued properties as IRIs
([`0e04a1a`](https://github.com/OO-LD/oold-python/commit/0e04a1a87b3e3db077a3f76d7252e56ee6cbf621))
### Chores
- Classify as Beta
([`c147a05`](https://github.com/OO-LD/oold-python/commit/c147a05f7665f1ede18f6b48c99a5c0540640d9a))
### Documentation
- **examples**: Optional children extension in wiki_data
([`2f372c3`](https://github.com/OO-LD/oold-python/commit/2f372c3f060fa25770b6194642db4eeca905357c))
Preview via python-semantic-release and conventional commits. |
Contributor
📊 Benchmark ResultsClick to see benchmark comparisonThreshold: 1.3x (30% slower triggers a regression warning) Note: Benchmarks are informational only and won't fail the build. 💡 Tip: Download the |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
schema_to_frame emitted no subframe for reference-valued properties, on the assumption that a referenced IRI carries no local triples. Where the target does carry triples in the same graph, framing embedded it as an object and the framed document stopped validating against the schema the frame came from. Reference signals per OOLD-EXT-68fa: x-oold-range, an IRI-family format, or a term mapped "@type": "@id". Embedding wins where both appear. keyword_alias_keys excludes keys aliasing a JSON-LD keyword: id carries an IRI format and so matches, but a subframe there writes {"@id": {...}}, which pyld rejects. Found through allOf, since the base schema declares the convention. Refs OO-LD/oold-schema#160
simontaurus
force-pushed
the
fix/frame-reference-embed-never
branch
from
September 19, 2026 13:46
5fd1cbe to
0e04a1a
Compare
Contributor
📊 Benchmark ResultsClick to see benchmark comparisonThreshold: 1.3x (30% slower triggers a regression warning) Note: Benchmarks are informational only and won't fail the build. 💡 Tip: Download the |
simontaurus
added a commit
that referenced
this pull request
Sep 19, 2026
OOLD-EXT-6ea3 (SHOULD) wants an IRI-valued property to constrain its lexical form, and OOLD-EXT-1f92 recommends iri-reference - it admits absolute IRIs, compact IRIs and context-relative references alike, which is what instances carry. Our own validator warned on our own output: "IRI reference properties without an iri-reference/uri* format". It is also the second of the three reference signals a frame derivation looks for (OOLD-EXT-68fa), so this keeps the schema side and oold.validation.frame.reference_properties in agreement - the same principle #161 applied to framing. A format the declaration already states is left alone; OSW declares `format: autocomplete` on link properties for its UI.
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.
Port of OO-LD/oold-js#3; same defect, since this module is a port of
schema_to_frame.mjs.schema_to_frameemitted no subframe for reference-valued properties, on the assumption stated in the module docstring: a referenced IRI with no local triples stays{"id": ...}. Where the target does carry triples in the same graph, framing pulls them in as an object and the framed document stops validating against the schema the frame was derived from, which declares a string there.OOLD-EXT-68faalready requires@embed: @neverhere, and the worked example in the specification's #framing section already prints it, so both implementations were in breach of an existing MUST.Reference signals:
x-oold-range, an IRI-familyformat(the familyOOLD-EXT-6ea3recommends), or a term mapped"@type": "@id". Embedding wins where a property carries both.keyword_alias_keys
Thing.schema.jsondeclaresidwith"format": "iri"while its context aliasesidto@id, so the reference signals match it. A subframe there writes{"@id": {...}}and pyld fails with "@id" value must be a string. Keys aliasing a JSON-LD keyword are excluded.The alias is searched across the composed schema: after dereferencing,
Contactkeeps Thing's@contexton itsallOfmember rather than at the root, so a root-only scan misses it. This surfaced from the committed corpus, not from a unit test, and the same fix went back into oold-js.Verified
502 passed, 7 skippedacrosstests/test_validation/. Removing only the@neverline fails exactly the two new framing tests, so they are not vacuous.