Skip to content

Fix expansion with @base#248

Merged
mielvds merged 8 commits into
masterfrom
fix-expand-base
Apr 27, 2026
Merged

Fix expansion with @base#248
mielvds merged 8 commits into
masterfrom
fix-expand-base

Conversation

@anatoly-scherbakov
Copy link
Copy Markdown
Collaborator

  • Guard active @base use in _expand_iri when base is not None
  • Add regression test for @base vs property term expansion

@anatoly-scherbakov anatoly-scherbakov self-assigned this Apr 10, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 10, 2026

@davidlehn
Copy link
Copy Markdown
Member

  • Why are those dev libs now needed? Did the github testing systems change behavior?
  • If that test is not in the main JSON-LD API test suite, please add it there immediately. The WG needs to agree on the behavior (I assume they will in this case) and have tests to ensure all implementations interoperate. That also removes the need to have the test duplicated here.
  • If the above can not be done now for some reason, then before merging this, please add tracking issues in the json-ld api repo and here to add the test case and clean it up here.

Comment thread tests/test_base_vs_vocab.py Outdated
Comment thread tests/test_base_vs_vocab.py Outdated
@anatoly-scherbakov
Copy link
Copy Markdown
Collaborator Author

@davidlehn, thanks for the review!

  • Updated the test comment as suggested 👍
  • libxml2-dev / libxslt1-dev are needed when CI builds lxml from source on PyPy (no wheel for that combo). I did not check how it ran before, it failed for me, and I fixed it.

This bug is a very recent regression. I haven't found a test in the suite that would cover it. Which explains why the bug could appear.

PR in json-ld-api added: w3c/json-ld-api#686 — but, it is unclear when that can be merged. For that reason, I propose we merge this PR. I do not consider a redundant test a problem, provided that the test is spec compliant.

Copy link
Copy Markdown
Collaborator

@mielvds mielvds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix @anatoly-scherbakov! Given that this doesn't break any other test, I guess this must of slipped through when introducing the default base URI. As long as the case is registered with the test-suite, I also prefer merging to preserve backwards-compatibility.

Comment thread lib/pyld/jsonld.py
Comment thread tests/test_base_vs_vocab.py Outdated
@mielvds
Copy link
Copy Markdown
Collaborator

mielvds commented Apr 13, 2026

@anatoly-scherbakov I did a cleanup in master, so please rebase so my commits are no longer in your PR

@anatoly-scherbakov
Copy link
Copy Markdown
Collaborator Author

Thanks for review! Comments addressed. cc @mielvds

Copy link
Copy Markdown
Collaborator

@mielvds mielvds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good! Much appreciated

@mielvds mielvds merged commit 64472dd into master Apr 27, 2026
18 checks passed
@mielvds mielvds deleted the fix-expand-base branch April 27, 2026 07:28
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.

3 participants