Article Image

Despite being allowed by the the SPARQL 1.1 Update language, Virtuoso doesn’t allow to insert statements containing blank nodes using the INSERT DATA update query. Oddly enough, when using the INSERT update query it is possible to add statements with blank nodes. Unfortunately in this case a WHERE clause has to be specified. So what is needed is a WHERE clause which returns a non-empty result in all circumstances to ensure insertion of the statements. Here is a rather hacky solution to accomplish this problem:

  _:node123 <> <> .
  SELECT * {
    OPTIONAL { ?s ?p ?o . }
  } LIMIT 1

To get a non-empty result set at any price just use a nested SELECT query with an optional triple selection limited to one result. This guarantees the execution of the INSERT clause. Happy inserting of blank nodes.

Head over to GitHub to follow this issue.

Image credits: <a href="">Problems of the RDF model: Blank Nodes</a>

Blog Logo

Marvin Frommhold

"Aufgrund falschen Medienkonsums und Bildungsmangel gibt es in Deutschland immer mehr assipöse Menschen."



random stuff by a linked data engineer

Back to Overview