Menu

#23 Add support for SPARQL 1.1 BINDINGS

open
nobody
None
5
2013-01-11
2012-01-24
lukostaz
No

According to the W3C SPARQL 1.1 working draft, the BINDINGS clause allows to bind variables to given values http://www.w3.org/TR/sparql11-query/#bindings.

I have tried to run the W3C example (see above URL) on 6.1.4.
The following triples have been loaded in 6.1.4 on Mac OSX 10.6.5:

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

The execution of the query below fails:

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

Virtuoso 37000 Error SP030: SPARQL compiler, line 12: syntax error at 'BINDINGS' before '?book'

SPARQL query:
define sql:big-data-const 0
#output-format:text/html
define sql:signal-void-variables 1 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)
}

Discussion


Log in to post a comment.