Skip to content

fix: a schema with no @context loses nothing - #6

Merged
simontaurus merged 1 commit into
mainfrom
fix/no-context-not-lossy
Sep 27, 2026
Merged

simontaurus merged 1 commit into
mainfrom
fix/no-context-not-lossy

Conversation

@simontaurus

Copy link
Copy Markdown
Contributor

Closes #1, the documented divergence from oold-python, which fixed the same thing in OO-LD/oold-python#141.

An absent @context maps nothing, so every declared property is unmapped and none can be lost: there was never a term to lose it through. Reporting them fails a schema for the one thing OOLD-SCH-2d05 says must not fail it.

rc.4 does not make this moot. The schema is now rejected by the meta-schema, but the round-trip check still ran and added a second, spurious finding on top of the real one, so the two implementations still disagreed on invalid input.

Measured on the issue's own repro plus a control:

N.schema.json  (no @context)                 INVALID (meta-schema): must have required property '@context'
                                             no RT-LOSSY
M.schema.json  (@context, 'orphan' unmapped) RT-LOSSY: property lost through RDF: orphan

The false positive goes, the true positive stays. npm test: 6 passing.

An absent context maps nothing, so every declared property is unmapped
and none can be lost. Reporting them failed a schema for the one thing
OOLD-SCH-2d05 says must not fail it, and doubled up on a finding the
meta-schema already makes.

Closes #1
@simontaurus
simontaurus merged commit 4bc7df0 into main Sep 27, 2026
1 check passed
@simontaurus
simontaurus deleted the fix/no-context-not-lossy branch September 27, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A schema with no @context is reported as losing every property

1 participant