You can use SPIN API an operate the SPARQL query structure as RDF. We have developed a helper class for this purpose: https://github.com/Graphity/graphity-client/blob/master/src/main/java/org/graphity/processor/update/ModifyBuilder.java
On Tue, Mar 10, 2015 at 9:32 AM, Maarten van Dessel <maarten.vandes...@ugent.be> wrote: > Hi, > > Thanks for your answer. > > Isn't there any way to avoid String concatenation/substitution when creating > delete/insert queries? > > I'm looking for something like this: > > Update update = new Update(); > update.setQueryInsertDeleteType(); > ElementGroup group = new ElementGroup(); > // .... > update.setQueryPattern(group); // set WHERE > BasicPattern basicPattern = new BasicPattern(); > // .... > update.setDeletePattern(new Template(basicPattern)); // set DELETE > // .... > update.setInsertPattern(new Template(basicPattern)); // set INSERT > > If this is currently not possible, I'll go with the Strings. But I want to > avoid this as much as possible. > > Thanks, > > Maarten > >> Op 9-mrt.-2015, om 23:42 heeft Trevor Donaldson <tmdona...@gmail.com> het >> volgende geschreven: >> >> Take a look at parameterizedsparqlstring. That is a good place to start. >> On Mar 9, 2015 6:25 PM, "Maarten van Dessel" <maarten.vandes...@ugent.be> >> wrote: >> >>> Hi everyone, >>> >>> I'm already familiar with the programmatic creation of SPARQL construct >>> queries: >>> >>> Query query = new Query(); >>> query.setQueryConstructType(); >>> >>> ElementGroup group = new ElementGroup(); >>> // .... >>> query.setQueryPattern(group); // set WHERE clause >>> >>> BasicPattern basicPattern = new BasicPattern(); >>> // .... >>> query.setConstructTemplate(new Template(basicPattern)); // set CONSTRUCT >>> clause >>> >>> Is it however possible to create SPARQL 1.1 Delete & Insert queries in the >>> same manner? >>> I know Jena is capable of parsing sparql query-strings, but I can't figure >>> out how to create them >>> programmatically by using the same constructs as above. >>> >>> Thanks in advance, >>> >>> Maarten >