On Mon, Jul 2, 2012 at 3:32 PM, Joshua TAYLOR <joshuaaa...@gmail.com> wrote:
> I found some examples of queries using VALUES in some diffs shown in
> the jena commits mailing list [1].  It seems like the updated query
> should be
>
> PREFIX dc:   <http://purl.org/dc/elements/1.1/>
> PREFIX :     <http://example.org/book/>
> PREFIX ns:   <http://example.org/ns#>
>
> SELECT ?book ?title ?price
> {
>    ?book dc:title ?title ;
>          ns:price ?price .
> }
> VALUES ?book {
>  :book1
> }
>
> and also that the general syntax is
>
> VALUES [var or list of vars] {
>   [one or more term or list of terms]
> }
>
> and that if a single var appears, then single terms must appear in the
> body, and if a list of vars appears, then lists of terms must appear
> in the body (unsurprisingly).  More importantly, the two can 't be
> mixed, so
>
> VALUES ?x { (:particular_x) }
>
> isn't OK, where ?x appears as a non list, but (:particular_x) is a one
> element list.  I only stress this point because the example with
> BINDINGS from the working draft on the W3C site does exactly this:
>
> BINDINGS ?book {
>  (:book1)
> }

Ah, thanks both Andy and Rob for quick and informative responses!  It
looks like I'm on the right track with syntax, and now I've got an
idea what to follow in order to stay up to date. Thanks again!

//JT
-- 
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/

Reply via email to