Common variables across multiple optional blocks

Hi all,

It seems that the following query has indeterminate solutions

PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?page
WHERE  {
   ?x foaf:name  ?name .

   OPTIONAL { ?x foaf:homepage ?page . }
   OPTIONAL { ?x foaf:workplaceHomepage ?page . }
}

Text in an earlier draft forbade this situation:

http://www.w3.org/TR/2005/WD-rdf-sparql-query-20050217/#OptionalRule

"A variable can not be used in two optional blocks where the outermost 
mention (shallowest occurrence in the tree for each occurrence) of the 
two uses is not the same block."

This was moved to a new section on query execution order:

http://www.w3.org/TR/2005/WD-rdf-sparql-query-20050419/#queryExecutionOrder

"Optional-2... informally, this rule states that there can't be two 
optionals with a common variable, if that variable does not occur in a 
basic graph pattern as well."

This entire section was removed from the July draft.

I think that this rule needs to be reinstated.

For more information and background on this please see chat leading up 
to http://chatlogs.planetrdf.com/swig/2006-01-17#T20-51-16

Cheers,

Ian

-- 
http://internetalchemy.org | http://purl.org/NET/iand
Working on... Spiral <http://www.semanticplanet.com/2005/spiral/>

Received on Tuesday, 17 January 2006 21:52:30 UTC