Re: Trailing dot in update grammar

On 03/08/2010 10:54 AM, Steve Harris wrote:
> Apologies if this is a known problem.
>
> According to our implementation of the Update grammar, you can have a trailing dot in INSERT DATA, so:
>     INSERT DATA { GRAPH<G>  {<s>  <p>  <o>  . } }
> doesn't match the grammar, as far as we can see.

Could you explain the route through the grammar that forbids it? It 
would be helpful to know how you are going through the grammar rules and 
where you end up that forbids it.

A series of test cases to cover what you expect, and don't expect, would 
be good too :-)

> The goes against the spirit of SPARQL 1.0, and some examples given in the Update document, e.g. the example in §4.1.1 (though that example doesn't use the GRAPH keyword, so it's not exactly the same).
>
> - Steve
>

[34] Insert ::= 'INSERT' ( 'DATA' QuadData | .... )
[46] QuadData ::= '{' Quads '}'
[43] Quads ::= TriplesTemplate?
               ( QuadsNotTriples '.'? TriplesTemplate? )*
[44] QuadsNotTriples ::= 'GRAPH' VarOrIRIref '{' TriplesTemplate '}'
[45] TriplesTemplate  ::= TriplesSameSubject ( '.' TriplesTemplate? )?

and
( '.' TriplesTemplate? )?

can be a single '.'

You example parses with ARQ's SPARQL 1.1 Update parser.

(I do see a bug in QuadsNotTriples in that it does not allow {} and 
QuadsNotTriples is used elsewhere for WHERE but it's nothing to do with 
DOT).

Fixed:
[44] QuadsNotTriples ::= 'GRAPH' VarOrIRIref '{' TriplesTemplate? '}'


	Andy

Received on Tuesday, 3 August 2010 10:22:43 UTC