Re: ARQ doesn't support BINDINGS?
On Mon, Jul 2, 2012 at 3:11 PM, Joshua TAYLOR joshuaaa...@gmail.com wrote: Is this the expected behavior? BINDINGS doesn't seem to be rejected, but silently ignored. I know that initial bindings can be set programmatically through the API, so I figured that BINDINGS would work too, but it doesn't seem to. It occurred to me that I wasn't using the latest Jena and ARQ, so I just downloaded those, and BINDINGS still doesn't work, but now, at least, it triggers a parsing error: $ /usr/local/lib/apache-jena-2.7.2/bin/arq --version Jena: VERSION: 2.7.2 Jena: BUILD_DATE: 2012-06-28T14:39:01+0100 ARQ:VERSION: 2.9.2 ARQ:BUILD_DATE: 2012-06-28T14:39:01+0100 $ /usr/local/lib/apache-jena-2.7.2/bin/arq -v --debug --query book_query.sparql --data book_data.n3 Encountered bind BIND at line 10, column 1. Was expecting one of: EOF limit ... offset ... order ... values ... group ... having ... This is, at least, a different behavior, but still not one that works with BINDINGS. -- Joshua Taylor, http://www.cs.rpi.edu/~tayloj/
Re: ARQ doesn't support BINDINGS?
On 02/07/12 20:22, Joshua TAYLOR wrote: On Mon, Jul 2, 2012 at 3:16 PM, Rob Vesse rve...@yarcdata.com wrote: Hi Joshua BINDINGS is being changed to be VALUES instead by the SPARQL working group which works similarly except that it can be applied more broadly i.e. Used throughout queries rather than only at the end The version of ARQ you are using (2.8.7) is very old and pre-Apache which makes it at least a year old so may explain why BINDINGS was accepted by the parser but not implemented. The latest version 2.9.2 just came out and supports the new VALUES syntax 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). See the editors' working draft: http://www.w3.org/2009/sparql/docs/query-1.1/rq25.xml#inline-data and http://lists.w3.org/Archives/Public/public-sparql-dev/2012AprJun/0018.html Andy Thanks! //JT
Re: ARQ doesn't support BINDINGS?
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/
Re: ARQ doesn't support BINDINGS?
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/
Re: ARQ doesn't support BINDINGS?
BINDINGS has been replaced with VALUES in the latest version of Jena. You should be able to simply change BINDINGS to VALUES, and your query would then work. See the SPARQL 1.1 Editor's Draft [1]. -Stephen [1] http://www.w3.org/2009/sparql/docs/query-1.1/rq25.xml#inline-data On Mon, Jul 2, 2012 at 12:19 PM, Joshua TAYLOR joshuaaa...@gmail.com wrote: On Mon, Jul 2, 2012 at 3:11 PM, Joshua TAYLOR joshuaaa...@gmail.com wrote: Is this the expected behavior? BINDINGS doesn't seem to be rejected, but silently ignored. I know that initial bindings can be set programmatically through the API, so I figured that BINDINGS would work too, but it doesn't seem to. It occurred to me that I wasn't using the latest Jena and ARQ, so I just downloaded those, and BINDINGS still doesn't work, but now, at least, it triggers a parsing error: $ /usr/local/lib/apache-jena-2.7.2/bin/arq --version Jena: VERSION: 2.7.2 Jena: BUILD_DATE: 2012-06-28T14:39:01+0100 ARQ: VERSION: 2.9.2 ARQ: BUILD_DATE: 2012-06-28T14:39:01+0100 $ /usr/local/lib/apache-jena-2.7.2/bin/arq -v --debug --query book_query.sparql --data book_data.n3 Encountered bind BIND at line 10, column 1. Was expecting one of: EOF limit ... offset ... order ... values ... group ... having ... This is, at least, a different behavior, but still not one that works with BINDINGS. -- Joshua Taylor, http://www.cs.rpi.edu/~tayloj/