W3C home > Mailing lists > Public > public-sparql-dev@w3.org > April to June 2012

Re: SPARQL 1.1. BINDINGS + FILTER

From: Benjamin Nowack <bn@talis.com>
Date: Thu, 03 May 2012 16:55:51 +0200
Message-ID: <4FA29C77.6010208@talis.com>
To: Andy Seaborne <andy.seaborne@epimorphics.com>
CC: public-sparql-dev@w3.org
Hi Andy,

Thank you very much for the update.

We are looking for something much more simple. All we would like to 
offer are basic SPARQL query templates, quite similar to how Prepared 
Statements work in SQL.

Using BIND or VALUES seems to require query parsing and advanced 
knowledge of scoping in SPARQL 1.1, to avoid injecting the parameter 
values in the wrong place.

Very late request, I know. It's just for the record, and maybe SPARQL 
1.2 ;)

Cheers,
Benji


On 5/2/12 12:17 PM, Andy Seaborne wrote:
> Hi guys,
> cc: public-sparql-dev
>
> I thought you might like to know what's going on:
>
> The WG hasn't completed it's discussion yet but the working proposal is:
>
> http://lists.w3.org/Archives/Public/public-rdf-dawg/2012AprJun/0076.html
> and thread except that the word DATA will be VALUES.
>
> Note the slight change in syntax to make the one variable/several
> variables cases a little clearer.
>
> For the filter use cases, the setting of variables needs to move into a
> {} block for scoping reasons.
>
> 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)
> }
>
> Outstanding issues include exactly what happens to BINDINGS at the end
> of a query - one proposal to the group is to keep the concept (for the
> federated query use case) but adopt the same word/syntax as VALUES.
>
> Andy
>
> On 02/05/12 10:49, Benjamin Nowack wrote:
>> Hi,
>>
>> Just wanted to let you know that we (Kasabi/Talis) have a similar use
>> case to [1] and would benefit from BINDINGS as a placeholder mechanism
>> for parametrised queries,  la:
>>
>> [[[
>> SELECT ?person WHERE {
>> ?person ex:name ?name .
>> FILTER(REGEX(?name, ?value))
>> }
>> BINDINGS ?value {('John')}
>> ]]]
>>
>>
>> (We don't need a formal response, just wanted to report the use case.)
>>
>> Cheers,
>> Benji
>>
>> [1]
>> http://lists.w3.org/Archives/Public/public-rdf-dawg-comments/2012Mar/0018.html
>>
>>
>>

-- 
Benjamin Nowack
Software Engineer, Talis Systems Ltd

http://talis.com/
http://twitter.com/bengee
Received on Saturday, 5 May 2012 22:29:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 5 May 2012 22:29:23 GMT