JSON-LD and blank nodes

I'm trialing Stardog now and immediately ran in to the same issue as this closed discussion:

I can of course convert to Turtle format and generate my own blank node IDs myself, but it seems like I shouldn't have to. How are JSON-LD data imports intended to be used with multiple named graphs in Stardog currently?

In the previous post, Stephen wrote:

it just happens that the spec doesn't account for additional JSON-LD documents being loaded into the same graph,

But looking at the spec, I see:

The blank node identifier is scoped to the document in which it is used.

Which doesn't seem to be the case in Stardog. If I load two jsonld documents in to two separately named graphs, then do this query:

select ?p ?o
where {
<_:b0> ?p ?o .

I get pred/obj pairs from both graphs.

Is there more general guidance on how to work with blank nodes?


I discovered the preserve.bnodes.ids database setting, which I've tried setting to false. When this is false, importing named quads files produces IDs more in line with what I'd expect. That is, they include random strings. For example:


However, importing JSON-LD files still produces blank node ids that conflict.

Maybe I'm missing something fundamental, but I was surprised that generating IDs wasn't the default, and when it is enabled (that is preserving is disabled), it appears that JSON-LD importing is broken in that it does not respect this setting.

Having stated my intuition, I'm extremely new to this stuff. Am I missing something?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.