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

Re: [sub-select] Some examples and discussion

From: Steve Harris <steve.harris@garlik.com>
Date: Thu, 12 Mar 2009 10:33:25 +0000
Message-Id: <E569B165-6361-464E-81B0-E482A66FC1AC@garlik.com>
To: SPARQL Working Group <public-rdf-dawg@w3.org>
On 12 Mar 2009, at 06:39, Lee Feigenbaum wrote:
> The idea of using ASK queries in expressions appeals to me as well,
> though it doesn't necessarily read as well as !EXISTS in SQL. The
> verbosity is similar though, I guess.

Similar, and it's one less bit of syntax. My personal preference is  
for fewer, more flexible verbs. But it's just a matter of taste.

> I'm curious as to the interplay between:
>
> projected expressions
> sub-selects
> assignment
>
> Is there a combination of these that makes the 3rd irrelevant? Or  
> pairs of them that are far more useful when included together?  
> That's the sort of thing I'm working to wrap my head around.

Yes, if you have projected expressions then you effectively get  
assignments:

    SELECT ?x
    WHERE {
       ?x :age ?age .
       FILTER(?age >= ?min_age)
       (SELECT 18 AS ?min_age)
    }

Is equivalent to:

    SELECT ?x
    WHERE {
       ?x :age ?age .
       FILTER(?age >= ?min_age)
       LET(?min_age := 18)
    }

- Steve

-- 
Steve Harris
Garlik Limited
2 Sheen Road
Richmond  TW9 1AE

T   +44(0)20 8973 2465
F   +44(0)20 8973 2301
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 Thursday, 12 March 2009 10:34:01 GMT

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