Hello, I just noticed that while ARQ doesn't complain about the
presence of BINDINGS in a query, it doesn't seem to do anything with
it either.  I tried recreating the example given in the working draft
[http://www.w3.org/TR/sparql11-query/#bindings] and so end up with the
following data and query:

== Data ==
@prefix dc:   <http://purl.org/dc/elements/1.1/> .
@prefix :     <http://example.org/book/> .
@prefix ns:   <http://example.org/ns#> .

:book1  dc:title  "SPARQL Tutorial" .
:book1  ns:price  42 .
:book2  dc:title  "The Semantic Web" .
:book2  ns:price  23 .

== Query ==
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 .
}
BINDINGS ?book {
 (:book1)
}

and though the prescribed result is the single row:

<http://example.org/book/book1> "SPARQL Tutorial"       42

I get two rows when I run this through Jena/ARQ:

$ arq --version
Jena:       VERSION: 2.6.4
Jena:       BUILD_DATE: 2010-12-12T16:56:15+0000
ARQ:        VERSION: 2.8.7
ARQ:        BUILD_DATE: 2010-12-12T14:07:48+0000
$ arq --debug -v --query book_query.sparql --data book_data.n3
  1 PREFIX  dc:   <http://purl.org/dc/elements/1.1/>
  2 PREFIX  :     <http://example.org/book/>
  3 PREFIX  ns:   <http://example.org/ns#>
  4
  5 SELECT  ?book ?title ?price
  6 WHERE
  7   { ?book dc:title ?title .
  8     ?book ns:price ?price
  9   }
 10 BINDINGS ?book
 11 {
 12   ( :book1 )
 13 }

 INFO [main] (Explain.java:228) - QUERY
  PREFIX  dc:   <http://purl.org/dc/elements/1.1/>
  PREFIX  :     <http://example.org/book/>
  PREFIX  ns:   <http://example.org/ns#>

  SELECT  ?book ?title ?price
  WHERE
    { ?book dc:title ?title .
      ?book ns:price ?price
    }
  BINDINGS ?book
  {
    ( :book1 )
  }
 INFO [main] (Explain.java:228) - ALGEBRA
  (project (?book ?title ?price)
    (bgp
      (triple ?book <http://purl.org/dc/elements/1.1/title> ?title)
      (triple ?book <http://example.org/ns#price> ?price)
    ))
 INFO [main] (Explain.java:228) - BGP :: (?book
<http://purl.org/dc/elements/1.1/title> ?title) (?book
<http://example.org/ns#price> ?price)
 INFO [main] (Explain.java:228) - Reorder :: (?book
<http://purl.org/dc/elements/1.1/title> ?title) (?book
<http://example.org/ns#price> ?price)
---------------------------------------
| book   | title              | price |
=======================================
| :book2 | "The Semantic Web" | 23    |
| :book1 | "SPARQL Tutorial"  | 42    |
---------------------------------------

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.

Thanks in advance,
//JT

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

Reply via email to