W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > October to December 2009

Re: Draft Response for "Comments on SPARQL 1.1 WD 20091022"

From: Steve Harris <steve.harris@garlik.com>
Date: Fri, 6 Nov 2009 16:57:56 +0000
Cc: SPARQL Working Group <public-rdf-dawg@w3.org>
Message-Id: <316BD7B5-7EB9-417B-923E-9605BDD7A852@garlik.com>
To: Andy Seaborne <andy.seaborne@talis.com>
On 6 Nov 2009, at 13:19, Andy Seaborne wrote:

> 2009/11/6 Steve Harris <steve.harris@garlik.com>:
>> On 6 Nov 2009, at 08:58, Andy Seaborne wrote:
>>
>>> Proposed response:
>>>
>>> http://www.w3.org/2009/sparql/wiki/CommentResponse:ldodds-query-1
>>
>> Re. FILTER( EXISTS { ... })
>>
>> I think that at the F2F that agreed that we wouldn't allow for  
>> EXISTS inside
>> FILTER for this reason, and because there was some reluctance to  
>> have BGP
>> expressions in the FILTER syntax.
>>
>> If that matches the minutes, and/or other people's recollection it  
>> might be
>> worth pointing that out, as it answers the concern.
>>
>
> I wasn't there and I'll wait for the formal outcomes but I read the
> logs as discussing sub-SELECT in FILTER.  That does make sense because
> (1) we have named variables so it's a lot less necessary to be able to
> put a scalar sub-SELECT into a FILTER for testing and (2) FILTER
> motion can complicate the scoping rules.

I recall it as all sub-queries (including FILTER(EXISTS{}) as a sub- 
ASK), but with jetlag and all I wouldn't swear to it!

> Neither of these apply for EXISTS.  On (1), the best I came up with is
>
> { SELECT (count(*) > 0 AS ?boolean)
>   WHERE { pattern1 . EXISTS{pattern2} }
> }
>
> which I think we'd agree is "inconvenient" :-)  and inefficient.
>
> { SELECT (count(*) > 0 AS ?boolean)
>   WHERE { SELECT * { pattern1 . EXISTS{pattern2} } LIMIT 1 }
> }
>
> is faster and worse to write.

"Faster" presumes something about the optimiser, but I'll grant that  
it's easier to optimise.

The feeling was that it didn't add any capability, has the coping  
peculiarity and messes up the grammar. Also, it's a bit of a corner- 
case requirement. There could be a convincing use-case, but I don't  
think anyone came up with one at the F2F.

- Steve

-- 
Steve Harris, CTO, Garlik Limited
2 Sheen Road, Richmond, TW9 1AE, UK
+44(0)20 8973 2465  http://www.garlik.com/
Registered in England and Wales 535 7233 VAT # 849 0517 11
Registered office: Thames House, Portsmouth Road, Esher, Surrey, KT10  
9AD
Received on Friday, 6 November 2009 16:58:31 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:40 GMT