Dear Graham,

> With reference to
> I think it would be helpful to add some explanation that
> and
>    P { OPTIONAL Q }
> can yield different results. 

This observation is correct and these are two different queries. Note that the latter is equivalent to

  P { {} OPTIONAL Q }

There is explanation for this equivalence in the current draft at which the group considers sufficient.

> I recognize that to some extent this request 
> challenges the philosophy of what a specification is _for_, and accept that the 
> first purpose of a specification is to specify, but I also think that some level 
> of explanation helps to ensure the specification is properly followed.  In this 
> case, both myself and at least one other experienced developer had not expected 
> there to be a difference.

Although we add as many examples as we can afford, please understand that we can't have separate examples for every special case in the spec. This is what the test cases shall cover. In fact,

has a number of test cases for OPTIONAL patterns.

> For my own benefit, I've created an explanation based on elements of the query 
> algebra which you are welcome to copy and/or adapt if that is helpful:
> #g

Thanks for this input, which was discussed in the group; at the moment we don't see new information that would warrant an additional example to go to the spec text.

Axel Polleres, on behalf of the SPARQL working group

Last modified on 12 October 2010, at 16:22