Conversation
Converter.to_collection walked an rdf:List chain checking only that each cell carries one rdf:first/rdf:rest pair and that the chain is acyclic. It did not check how many statements point into the chain. The @list form inlines the whole chain at a single reference and writes its cells nowhere else, so when a cell is referenced from more than one place each referring list rendered the shared cells again. The round trip then gained triples: _:tail rdf:first "b" ; rdf:rest rdf:nil . _:head rdf:first "a" ; rdf:rest _:tail . ex:s1 ex:p _:head . ex:s2 ex:p _:tail . # second reference into the chain serialized as two independent @list values, one per referring subject, so the tail was emitted twice: 6 triples in, 8 out, not isomorphic. This is the same defect class as RDFLib#3504, which fixed TurtleSerializer and LongTurtleSerializer by counting statements that point into the chain. The JSON-LD converter has its own chain walk and was not covered by that fix, so it gets the same check: a cell that is the object of more than one statement is not rendered as a list, and the chain is written out with explicit rdf:first/rdf:rest instead. An empty chain still renders as "@list": [], which is rdf:nil rather than a list structure, so nothing is lost there.
This was referenced Sep 14, 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.
Mirror of RDFLib#3543 — tracking only. Do not merge.
Upstream PR: RDFLib#3543
Why this PR exists
Every fix this organisation depends on is written as a self-contained, single-commit
upstream contribution rather than a local patch, so that a fork is only needed for as
long as its contributions are unmerged.
That convention has one weakness: an upstream PR is easy to lose track of, because it
lives in someone else's repository and closes on someone else's schedule. This mirrored PR
is the counterweight — an open PR in our own fork for every contribution still pending
upstream, so the set of things we are carrying is visible from our own repository list.
It is closed when the upstream PR is merged or rejected, not before.
Contents
A single commit, identical in content to the upstream PR head:
confirm/jsonld-shared-list->mainWhere it is used
Not yet consumed: the pipeline pins released
rdflib==7.6.0. Same defect class as the merged RDFLib#3504 (Turtle), whichdiffable-rdf0.0.2 had to work around.