Skip to content

Commit

Permalink
Added check for Blank Node id that should fix #555
Browse files Browse the repository at this point in the history
  • Loading branch information
RinkeHoekstra committed Jul 18, 2022
1 parent c14dfd5 commit e0d332e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/jsonldparser.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ export function jsonldObjectToTerm (kb, obj) {
}

if (Object.prototype.hasOwnProperty.call(obj, '@id')) {
return kb.rdfFactory.namedNode(obj['@id'])
if (obj['@id'].startsWith('_:')) {
// This object is a Blank Node
return kb.rdfFactory.blankNode(obj['@id']);
} else {
// This object is a Named Node
return kb.rdfFactory.namedNode(obj['@id']);
}
}

if (Object.prototype.hasOwnProperty.call(obj, '@language')) {
Expand Down

0 comments on commit e0d332e

Please sign in to comment.