fix: issue with trig reference counting across graphs by aucampia · Pull Request #2085 · RDFLib/rdflib (original) (raw)

Summary of changes

The TriG serializer was only considering BNode references inside a single
graph and not counting the BNodes subjects as references when considering if a
BNode should be serialized as unlabeled blank nodes (i.e. [ ]), and as a
result it was serializing BNodes as unlabeled if they were in fact referencing
BNodes in other graphs.

One caveat of this change is that some RDF Datasets may be serialized
less sussinctly in that it would not use unlabeled blank nodes where it is
technically possible. This can be trivially fixed, but a trivial fix
increases the compuational complexity of serialization significantly.

Other changes:

Checklist