rdf4j
rdf4j copied to clipboard
SparqlBuilder DELETE/MODIFY only allows triple patterns not quads
SparqlBuilder method signatures for delete/insert/modify only allow triple patterns, but I'm pretty sure from the spec, quads are allowed.
It is possible to insert/delete quads.
For example, org.eclipse.rdf4j.sparqlbuilder.examples.updatespec.Section3Test#example_2
executes the quad insert from Example 2 in https://www.w3.org/TR/2013/REC-sparql11-update-20130321/#insertData
Here's what that looks like:
InsertDataQuery insertDataQuery =
Queries.INSERT_DATA
.prefix(dc, ns)
.insertData(iri("http://example/book1").has(ns.iri("price"), Rdf.literalOf(42)))
.into(iri("http://example/bookStore"));
... i.e., you have to provide the graph IRI (4th component of the quad) with .into()
(or .with()
, using()
, from()
, or usingNamed()
)
There is nothing to be done here, except maybe to improve the user docs.