On Mon, Jul 2, 2012 at 3:22 PM, Joshua TAYLOR <joshuaaa...@gmail.com> wrote:
> Thanks for the quick reply.  I just grabbed the latest versions (and
> posted my results with them before I saw this message).  Is the syntax
> of VALUES documented somewhere?  The Working Draft I cited still uses
> "BINDINGS", and I'm not sure where the working group discussion would
> be (but I'll start grepping the Jena source, and will report back if
> no one else does first).

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)
}

//JT

[1] 
http://mail-archives.apache.org/mod_mbox/jena-commits/201205.mbox/%3c20120514150836.84ceb2388...@eris.apache.org%3E

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

Reply via email to