Conversation
skydudie
changed the base branch from
master
to
codex/255-split-iri-and-util-tests
September 15, 2026 21:59
skydudie
force-pushed
the
fix-direction-inheritance
branch
from
September 15, 2026 21:59
5b65a42 to
d13ba5b
Compare
Author
Rebased onto codex/255-split-iri-and-util-tests and retargeted the PR to it. Moved the tests from tests/test_jsonld.py into tests/jsonld/test_expand.py Lmk if there is anything else ya want changed😃 |
mielvds
changed the base branch from
codex/255-split-iri-and-util-tests
to
master
September 16, 2026 07:41
Collaborator
|
yes, could you rebase to master? :) I had a small fix in |
skydudie
force-pushed
the
fix-direction-inheritance
branch
from
September 17, 2026 03:33
d13ba5b to
a849bce
Compare
Author
Rebased onto master and thanks for the schema.org fix! |
Collaborator
|
Thx @skydudie looks good. @anatoly-scherbakov could you have a final look at this? |
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.
Fixes #337.
What
Two fixes in
_process_context-related direction handling, mirroring jsonld.js semantics per JSON-LD 1.1 API Context Processing:_clone_active_contextnow copies@direction, matching the existing handling of@language/@base/@vocab. Previously any context layer processed on top of an existing active context — a second document-level layer, a property-/type-scoped context, an embedded node@context, or a remote context — silently dropped the inherited default base direction (while the default language survived), changing expanded output and, underrdfDirection, the emitted N-Quads. (Default @direction is not inherited across context layers — _clone_active_context omits @direction #337; same bug as Default @direction is not inherited across context layers — _cloneActiveContext omits @direction jsonld.js#586; matching PR Copy @direction when cloning the active context jsonld.js#587.)@direction: nullcontext entry is now a no-op when no default direction is set (rval.pop('@direction', None)instead of an unguardeddel). This mirrors JSdeletesemantics. Found while writing the tests: on released 3.3.0,jsonld.expand({'@context': {'@direction': None}, 'http://ex/p': 'v'})raisesKeyError: '@direction', and a legitimate scoped@direction: nullreset is rejected asinvalid scoped context.Tests
TestExpandmethods (per AGENTS.md, added to the existing class): default@directionsurvival across document-level layers, inheritance into a property-scoped context, and scoped override /nullreset.pytest, W3C suites included via thespecifications/submodules): 1885 passed / 18 failed / 29 skipped / 1 xfailed on this branch vs 1882 / 18 / 29 / 1 on unpatchedmaster— the failure lists are byte-identical (tests/test_cli.pyJSON-decode issues and a missingaiohttpmodule in this environment), i.e. +3 new passing tests, zero regressions.make lintclean.Compatibility note
This changes expanded output (and N-Quads under
rdfDirection) for documents that combine a default@directionwith multiple context layers or scoped contexts — flagging for the 4.0.0 changelog since RDFC hashes over such documents change. Related: w3c/vc-data-integrity#366.