I am writing an application using the Apache Jena framework. With this I am able to do everything (insert, update, select). But i can't wrap my head around how to properly insert blank nodes using an INSERT query.
Is there a go-to approach for this (which works with every endpoint)? I know SPARQL 1.1 introduced some features for this to be accomplished, but it does not seem to work using a Virtuoso endpoint.
There are a couple of syntaxes to use. Suppose you want to add a bnode of type :Person to an object property named child. Here's one way:
?s :child [a :Person] .
And another:
?s :child [] .
[] a :Person .
And the _:bn notation is pretty universal, and useful when there are more than one bnode in a graph:
?s :child _:b0 .
_:b0 a :Person .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With