Re: [ISSUE-8] subqueries and datasets

On 8 May 2009, at 05:40, Lee Feigenbaum wrote:
> It seems to me that ARQ's behavior is simple and avoids this  
> problem, but I'm not sure at what cost. My natural inclination is  
> that its valuable for queries & their subqueries to be able to  
> target different graphs.
>
> Current recommendation? Unsure.
>
> Suggested next steps? Determine whether we have reasonable use cases  
> to require that subqueries can target different datastes from parent  
> queries.

Good summary.

For the record, I think it makes most sense to ban FROM in subqueries.

The specification of FROM is a little unclear in my mind, but by my  
understanding it should be possible to rewrite any sub-FROM'd query  
using GRAPH, eg. if you want to ask something like:

FROM <a>
SELECT ?x WHERE {
   ?x a :Person .
   {
     FROM <b>
     SELECT ?x, ?z WHERE {
       ?x :knows ?z
     }
   }
}

you could also write something like:

FROM <a>, <b>
SELECT ?x WHERE {
   GRAPH <a> { ?x a :Person }
   {
     SELECT ?x, ?z WHERE {
       GRAPH <b> { ?x :knows ?z }
     }
   }
}

Possibly you need to use FROM NAMED, not FROM.

- Steve

-- 
Steve Harris
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, 8 May 2009 10:35:26 UTC