Re: Multiple BINDING clauses in SPARQL queries

Alexander,

Thank you for your comments on BINDINGS.

The working group has reworked what was previously BINDINGS with a new 
VALUES clause that can be used for inline data at any point in the graph 
pattern where a pattern group element can be given. The details are in 
the editors' working draft [1] and the grammar.

The syntax is a little different from BINDINGS to make the one 
variable/several variables cases a little clearer as this is the 
emerging use for VALUES, not it's original motivation from federated query.

so:

SELECT *
{
      VALUES ?x { :x1 :x2 }
      ?x rdfs:label ?label .
}

SELECT *
WHERE {
     VALUES (?dayIDCheck ?dayName) {
     (0 "Sunday"@en)
     (1 "Monday"@en)
     (2 "Tuesday"@en)
     (3 "Wednesday"@en)
     (4 "Thursday"@en)
     (5 "Friday"@en)
     (6 "Saturday"@en) }
     BIND (0 AS ?dayID)
     FILTER (?dayIDCheck = ?dayID)
}

VALUES can be used where BINDINGSs was allowed but also multiple VALUES 
clauses are allowed within the graph pattern and will cause a join of 
each table of inline data with the query pattern matching. VALUES 
clauses are allowed on sub-queries.

We would be grateful if you would acknowledge that your comments have 
been answered by sending a reply to this mailing list.

Andy, on behalf of the SPARQL WG.

[1] http://www.w3.org/2009/sparql/docs/query-1.1/rq25.xml#inline-data

Received on Friday, 13 July 2012 14:08:48 UTC