rdf4j icon indicating copy to clipboard operation
rdf4j copied to clipboard

SparqlBuilder DELETE/MODIFY only allows triple patterns not quads

Open pulquero opened this issue 3 years ago • 1 comments

SparqlBuilder method signatures for delete/insert/modify only allow triple patterns, but I'm pretty sure from the spec, quads are allowed.

pulquero avatar Oct 22 '20 19:10 pulquero

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.

fkleedorfer avatar Nov 15 '21 16:11 fkleedorfer