Re: Review of Query document

On 21/09/10 14:56, Nico Michaelis wrote:
>> That's easy to address - the grammar wasn't up to date.
>>
>> The master copy is
>>
>> http://www.w3.org/2009/sparql/docs/sparql-grammar-11.html
>
> Two little thoughts regarding the grammer:
>
> 1)
>
> ExistsFunc ::= 'EXISTS' GroupGraphPattern
> NotExistsFunc ::= 'NOT EXISTS' GroupGraphPattern
>
> Doesn't the rule
>
> ExistsFunc ::= 'NOT'? 'EXISTS' GroupGraphPattern
>
> suffice? Anyways, the NotExistsFunc definition forces the lexer to look
> exactly for ' EXISTS' after any 'NOT', which will make the lexer more
> complex, since you can't assume that any keyword ends with a whitespace
> - both rules even force a specific whitespace. The same holds for the
> 'NOT IN' in the RelationalExpression rule.

The rules are written to two operations, NOT EXISTS and EXISTS.  I hope 
being specific about operations, not the low level details, will make it 
slightly easier for implements.

"NOT EXISTS" is a specific token in the grammar that includes the 
whitespace possibility; all the lexers I'm aware of have no problem with 
this. The notes for the grammar will mention this case (there are 
others, e.g. INSERT DATA, where this style is more important).

Choosing what's a token and what's a rule can be as much a matter of 
style as technical approach.

>
> 2)
>
> WhereClause ::= 'WHERE'? GroupGraphPattern
>
> Never noticed that the 'WHERE' is optional. I didn't find a place where
> that would lead to ambiguities, but is it intended?

Yes, it's intended  - it's optional in SPARQL 1.0.

	Andy

>
> Best
>
> Nico

Received on Tuesday, 21 September 2010 14:36:27 UTC