[ 
https://issues.apache.org/jira/browse/JENA-1295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15887877#comment-15887877
 ] 

Aleksandar Babic commented on JENA-1295:
----------------------------------------

It looks much better, but there is an error, addValues for ?x should be 
{code}.addValues("?x", "foo", "fu"){code}

However, there should be a method overloading (or type checking) for those who 
want to send a large list of values for single variable:
{code}
.addValues("?x", Arrays.asList("foo", "fu"))
{code}

as well as to add all at once:
{code}
Map<String, List<String>> values = new HashMap<>(2);
values.put("?x", Arrays.asList("foo", "fu"))
values.put("?y", Arrays.asList("bar", "baz"))

builder.addValues(values);
{code}

I forgot size of all collections should be the same, but it makes sense to 
perform check. Additional, "Values builder" might be good fit here as well:

{code}
Values values = new Values.Builder("?x", "?y")
        .withData(Arrays.asList("foo", "fu"))
        .withData(Arrays.asList("bar", "baz"))
        .build();

selectBuilder.setValues(values);
{code}

P.S. Note that values support 
"[UNDEF|http://www.snee.com/bobdc.blog/2012/09/sparql-11s-new-values-keyword.html]";
 as keyword, which should be also supported. 



> Add support to VALUES in SelectBuilder
> --------------------------------------
>
>                 Key: JENA-1295
>                 URL: https://issues.apache.org/jira/browse/JENA-1295
>             Project: Apache Jena
>          Issue Type: Wish
>          Components: QueryBuilder
>            Reporter: Aleksandar Babic
>            Assignee: Claude Warren
>             Fix For: Jena 3.3.0
>
>
> It seems that QueryBuilder is lacking on support for building VALUES block, 
> or there is no obvious method to do that.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to