History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: SES-952
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Jeen Broekstra
Reporter: Josh Mandel
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Sesame

SPARQL 1.1 BINDINGS clause + CONSTRUCT: BINDINGS are ignored.

Created: 06/Mar/12 11:11 PM   Updated: 07/Mar/12 05:52 AM
Component/s: SPARQL
Affects Version/s: 2.6.2, 2.6.3
Fix Version/s: 2.6.4

Environment: System Version: Mac OS X 10.6.8 (10K549)
  Kernel Version: Darwin 10.8.0
  Boot Volume: Macintosh HD
Issue Links:
Related
This issue is related to:
SES-920 SPARQL 1.1 BINDINGS clause + ASK - al... Major Resolved
 


 Description   
I tried the example from http://www.w3.org/TR/sparql11-query/#bindings
with the BINDINGS clause. Thus I added the triples into a Native Java store RDF schema:

=====
@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 .
=====

and I tried the 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)
}
======

the result is, as expected, the same result reported at http://www.w3.org/TR/sparql11-query/#bindings

The problem arises when I use an ASK instead of a SELECT clause.
If I try with

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

ASK
{
   ?book dc:title ?title ;
         ns:price ?price .
}
BINDINGS ?book {
 (:book1)
}
=====

the answer is TRUE (as expected), but if I try with

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

ASK
{
   ?book dc:title ?title ;
         ns:price ?price .
}
BINDINGS ?book {
 (:book5)
}
=====

the answer is TRUE again (and :book5 does not exist).
In fact, if I try with the same ASK but without using the BINDINGS clause like in

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

ASK
{
   :book5 dc:title ?title ;
         ns:price ?price .
}
=====

the answer is FALSE, as expected.
The BINDINGS clause coupled with the SELECT clause works also in the case of book5, like in
the 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 {
 (:book5)
}
====

where I get no results, as expected.

 All   Comments   Change History      Sort Order:
Comment by Jeen Broekstra [07/Mar/12 05:52 AM]
This issue is caused by the same problem that caused errors in ASK queries.