Closed RinkeHoekstra closed 1 year ago
@RinkeHoekstra CI fails. If I only add your first commit https://github.com/linkeddata/rdflib.js/pull/558/commits/e0d332e0cb53207bbb0879626b6dc1f19e4b1b3f it does not fail locally
I think you should only keep this one and make other PR for your last 2 commits that are not directly related so I can merge your PR.
The JSON-LD parser currently uses the JSON-LD flattening algorithm of
jsonld.js
. This algorithm assigns@id
attributes to blank nodes, but the JSON-LD parser only creates aBlankNode
when no@id
is present.This means that currently, the blank nodes in JSON-LD are interpreted as
NamedNode
, which is incorrect.This pull request does the following:
@id
value starts with_:
.BlankNode
, otherwise it is aNamedNode
._:
as this will be added by the instantiation of theBlankNode
class.This fixes #555
Also raised an issue in
rdf-canonize
(https://github.com/digitalbazaar/rdf-canonize/issues/45) to flag the problem that blank node identifiers generated byjsonld.js
are not unique across loads (this is the cause of issue #405 )