RDFLib / rdflib

RDFLib is a Python library for working with RDF, a simple yet powerful language for representing information.
https://rdflib.readthedocs.org
BSD 3-Clause "New" or "Revised" License
2.11k stars 547 forks source link

Assign consistent bnode identifiers in N3 formulas #2785

Closed eyusupov closed 1 month ago

eyusupov commented 1 month ago

Summary of changes

Blank nodes are assigned inconsistent identifiers when they are within different quoted graphs. I could not find a normative section in the spec that would define the scope of blank nodes, but section 3.6.1 says that we "Then, we use this identifier within our N3 graph", where "N3 document represents an N3 graph".

Checklist

eyusupov commented 1 month ago

Note: interestingly, QuotedGraph documentation mentions that it's intended to be completely disjoint from other graphs https://github.com/RDFLib/rdflib/blob/main/rdflib/graph.py#L33-L49, which contradicts my understanding of the situation

eyusupov commented 1 month ago

Looks like this is expected behavior at the moment: https://w3c.github.io/N3/spec/semantics.html#example3