You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
. found 0 -> BNode item.n3()='_:b0'
. found 1 -> BNode item.n3()='_:b1'
. found 2 -> BNode item.n3()='_:x9'
Which actually extends the reach and life-time of these local identifiers far beyond their intended scope.
In practice: loading two distinct json-ld files which happen to use the same local bnode-identifiers into the same graph will effectively mix up the nodes from both.
in case you get bitten by this bug too:
a dirty hack around this is just serializing to another format and use another rdflib parser that does not have this problem
defreparse(g: Graph, format="nt"):
"""This is a dirty hack workaround for issue https://github.com/RDFLib/rdflib/issues/2760 It reproduces the graph by serializing and parsing it again Via an intermediate format (not jsonld!) that is known to work :param g: the graph to reparse :param format: the intermediate format to use """returnGraph().parse(data=g.serialize(format=format), format=format)
marc-portier
changed the title
jsonld parser does not randomise bnodes when using local _prefixed identifiers "@id": "_:mybnode01"
BUG : jsonld parser does not randomise bnodes when using local _prefixed identifiers "@id": "_:mybnode01"Apr 9, 2024
Parsing this turtle:
leads to the bnode local-identifiers (correctly) being replaced with generated uuid
and (also correct) new ones at every run
While parsing the equivalent json-ld:
will lead to
Which actually extends the reach and life-time of these local identifiers far beyond their intended scope.
In practice: loading two distinct json-ld files which happen to use the same local bnode-identifiers into the same graph will effectively mix up the nodes from both.
Note: A similar issue was identified and fixed in rdflib.js --> linkeddata/rdflib.js#555
The text was updated successfully, but these errors were encountered: