RE: Variable scope for subqueries



> -----Original Message-----
> From: public-rdf-dawg-request@w3.org [mailto:public-rdf-dawg-request@w3.org]
> On Behalf Of Lee Feigenbaum
> Sent: 31 August 2009 06:46
> To: SPARQL Working Group
> Subject: Variable scope for subqueries
> 
> This is in reference to ISSUE-4
> (http://www.w3.org/2009/sparql/track/issues/4) and is in discharge of
> ACTION-16.
> 
> At the F2F, we had a short discussion about variable scope and
> subqueries: http://www.w3.org/2009/sparql/meeting/2009-05-07#line0199
> 
> At the time, Axel asked for a fleshed out example of the query that Andy
> used on IRC to demonstrate the scoping issue.
> 
> Andy's query on IRC was :
> 
> SELECT * { {?x :p ?v } { SELECT * { ?x :q ?w FILTER (?v>3) } } }
> 
> ...but I don't believe that demonstrates the proper issue. The above
> query has the (non-)issue of whether ?v is visible inside the subquery.
> I believe that SPARQL Query/1.0 already answers that: the bottom-up
> nature of SPARQL's algebra means that the scope of the FILTER is within
> the subquery's group. The only way that this FILTER would apply to
> bindings from the {?x :p ?v} BGP is via a top-down evaluation model, and
> that would be a breaking change to current SPARQL semantics.
> 
> Instead, I think this query demonstrates the scoping issue for subqueries:
> 
> SELECT * { ?x :p1 ?y {SELECT ?x { ?x :p 2?y }} FILTER(?y > 3)}
> 
> The question is, I think, does the subquery's projection completely hide
> the "inner" ?y from the rest of the query? I believe there was clear
> consensus at the F2F that the answer is "yes", which is consistent with
> current SPARQL bottom-up semantics and with projection in general.
> 
> Anyway, having reviewed this issue, I think it's more of a non-issue, as
> I haven't seen any advocates for an alternative approach. If anyone is
> unhappy with this resolution to ISSUE-4, please let us know.
> 
> Lee

I concur with the resolution.


How are we capturing the details of agreements?  In the issue tracker but at some point they need to be backed up by test cases.   Are we doing that as we go along or as a later phase?  

I suggest now because it gets some work happening in parallel and it's a more concrete record than WG wording of resolutions.  You also get to find out when some other issue affects a decision as well.

 Andy

Received on Monday, 31 August 2009 13:49:12 UTC