W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > January 2006

[CLOSED] Re: Common variables across multiple optional blocks [OK?]

From: Ian Davis <iand@internetalchemy.org>
Date: Wed, 18 Jan 2006 15:41:21 +0000
Message-ID: <43CE61A1.6050908@internetalchemy.org>
To: andy.seaborne@hp.com
CC: public-rdf-dawg-comments@w3.org

Thanks for the informative answer. I agree with the resolution.

For email archive purposes, the key information I was missing is given here:

http://www.w3.org/TR/2005/WD-rdf-sparql-query-20051123/#OptionalMatchingDefn

It says:

{ optional { pattern } }

is defined to be

{ } optional { pattern }

It would be nice to put a little editorial prose in this section 
detailing the relevance, the explanation you give in your reply would be 
ideal:

On 18/01/2006 10:09, Seaborne, Andy wrote:
> The OPTIONAL operator is defined as a binary operator and it is 
> left-associative (the latter has been added since as it was unclear as 
> someone pointed out).
> 
> So
>  {
>     ?x foaf:name  ?name .
>     OPTIONAL { ?x foaf:homepage ?page . }
>     OPTIONAL { ?x foaf:workplaceHomepage ?page . }
>  }
> 
> is (adding some braces):
>  {
>     { {  ?x foaf:name  ?name . }
>          OPTIONAL { ?x foaf:homepage ?page . }
>       }
>       OPTIONAL { ?x foaf:workplaceHomepage ?page . }
>  }
> 
> that is, the second optional will operate on the matching of the of the 
> first.

Thanks,

Ian
Received on Wednesday, 18 January 2006 15:41:28 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:14:50 GMT