fix(frame): keep reference-valued properties as IRIs - #3
Merged
Merged
Conversation
A derived frame carried no subframe for reference-valued properties, on the assumption that a referenced IRI has 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, which declares a string there. Reference signals per OOLD-EXT-68fa: x-oold-range, an IRI-family format, or a term mapped "@type": "@id". Embedding wins where a property carries both. Adds the first tests in this repo, covering the worked example from the specification's #framing section. Refs OO-LD/oold-schema#160
simontaurus
force-pushed
the
fix/frame-reference-embed-never
branch
from
September 19, 2026 13:41
071e4d8 to
f73efc9
Compare
This was referenced Sep 19, 2026
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.
schemaToFrameemitted no subframe for reference-valued properties, on the assumption stated in the module header: a referenced IRI with no local triples stays{ id: ... }. That assumption fails whenever the referenced node carries triples in the same graph.Framing a Person schema whose
works_foris declared{"type": "string", "format": "iri-reference"}against a graph where the employer has its ownrdf:typeandschema:name:An object where the schema requires a string, so the framed document fails the very schema the frame was derived from.
OOLD-EXT-68faalready requires@embed: @neverhere, and the worked example in the specification's #framing section already prints it.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.keywordAliasKeysexcludes keys that alias a JSON-LD keyword.idtypically carries"format": "iri"and so matches the reference signals, but a subframe there writes{ "@id": {...} }, which a processor rejects. The alias is searched throughallOfbecause a dereferenced subclass chain keeps each superclass's context on its own member and the convention is declared by the base schema. The Python port caught this against the shared corpus.Tests
First tests in this repo, run with
npm test(node's built-in runner, no new dependency). Covering the specification's worked example, both-signals precedence, the keyword alias, and the round-trip above including an Ajv check that the framed output validates.Removing only the
@neverline fails 3 of 5 with the expected messages, so they are not vacuous.Paired with OO-LD/oold-python for the port. Refs OO-LD/oold-schema#160.