Re: Question on variable scope w.r.t. multiple optional blocks

On Tue, Dec 14, 2004 at 08:41:27 +0900, Yoshio FUKUSHIGE wrote:
> >>PREFIX foaf: <http://xmlns.com/foaf/0.1/>
> >>SELECT ?name, ?nick
> >>WHERE (?x foaf:name ?name)
> >>         [(?x foaf:nick ?nick)
> >>          (?x foaf:givenname ?nick)]
> >>         [(?x foaf:nick ?nick)
> >>          (?x  foaf:surname ?nick)]
> >
> >This would be quite confusing as you could get one solution with two
> >different results for ?nick, using the current execution model. I think.
> 
> Oh...
> Thank you, Steve,  for pointing it out.
> Yes, you are right.
> 
> The optional conditions can be met at the same time, which slipped
> from my mind...
> 
> Hmm, what can I do with my uneasiness...
> 
> It comes from the fact that whenever one adds a new clause to a query
> under construction, one has to check if variables in the new clause 
> confilict
> with other variables in existing clauses.
> 
> Do you think it is a painful but unevitable and necessary task for users?
> Or at least a realistic solution?

I think this situation is perferable, and its unlikly to be a problem in
practice as most queries are small enough that they can be scanned by eye.

At least in the situation where these variables have global scope the
result is either unambiguous (from a scope p.o.v.) or a parse error (if
the same variable exists in multiple optional blocks).

Adding syntax to explicitly declare variable scope would make the language
more complicated, and I think that would be bad for users.

- Steve

Received on Tuesday, 14 December 2004 13:39:48 UTC