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

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

From: Steve Harris <S.W.Harris@ecs.soton.ac.uk>
Date: Tue, 14 Dec 2004 13:39:43 +0000
To: public-rdf-dawg@w3.org
Message-ID: <20041214133943.GB30803@login.ecs.soton.ac.uk>

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 GMT

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