Sounds like this might be a good extension to the QueryBuilder, or perhaps
a new class in that package to handle insert, update and delete calls.

On Tue, Mar 10, 2015 at 9:01 AM, Maarten van Dessel <
[email protected]> wrote:

> Jena offers, among others, these methods on the UpdateModify class:
>
> public void setElement(Element element) {
>     this.wherePattern = element ;
> }
> public QuadAcc getDeleteAcc() {
>     return deletePattern ;
> }
> public QuadAcc getInsertAcc() {
>     return insertPattern ;
> }
>
> Why can't I set the Delete- or Insert-pattern the same way I can set the
> Where-pattern?
> Or do I miss something?
>
> Greets,
>
> Maarten
>
> > Op 10-mrt.-2015, om 09:32 heeft Maarten van Dessel <
> [email protected]> het volgende geschreven:
> >
> > 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 <[email protected]>
> 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" <
> [email protected]>
> >> 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
> >
>
>


-- 
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren

Reply via email to