Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for reassigned term aliases #2925

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

avillar
Copy link
Contributor

@avillar avillar commented Oct 9, 2024

Summary of changes

In JSON-LD, when a term is aliased to one of the NODE_KEYS (e.g, id to @id), but is later reassigned in a child context (e.g., id to dct:identifier), rdflib incorrectly keeps the original alias and uses it for the binding (e.g., @id instead of dct:identifier).

This commit removes any aliases for a term inherited from parent contexts when that term is bound in the current context.

Checklist

  • Checked that there aren't other open pull requests for
    the same change.
  • Checked that all tests and type checking passes.
  • Considered granting push permissions to the PR branch,
    so maintainers can fix minor issues and keep your PR up to date.

@coveralls
Copy link

Coverage Status

coverage: 90.631% (-0.02%) from 90.648%
when pulling 4b407d6 on avillar:fix-jsonld-reassign-id
into 0b69f4f on RDFLib:main.

@ashleysommer
Copy link
Contributor

Looks like a great fix, thanks @avillar

@ashleysommer ashleysommer merged commit dc304a4 into RDFLib:main Oct 10, 2024
22 checks passed
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