- From: Andy Seaborne <andy@apache.org>
- Date: Sat, 15 Jun 2013 20:54:04 +0100
- To: RDF-WG <public-rdf-wg@w3.org>
The TriG showed up one issue with the TriG grammar.
In "traditional" TriG, and in SPARQL and N3, the final DOT in a {...} is
optional making this legal:
{ :s :p :o }
It is illegal by the current TriG grammar which requires a trailing DOT
Two bad syntax tests show this:
** trig-syntax-bad-struct-08
----
# No DOT
{<http://example/s> <http://example/p> <http://example/o>}
----
** trig-syntax-bad-struct-11
----
# Trailing ;
{<http://example/s> <http://example/p> <http://example/o> ;}
----
because in Turtle
<s> <p> <o>; .
is legal turtle (it's quite useful for repeated lines to always
terminate with ";" and not have to worry about the last line being
special -- the Turtle test manifest uses this).
The grammar rule affected is TriG [3g]
Currently:
[3g] graph ::= graphIri? '{' (triples '.')* '}'
A change would be:
[3g] graph ::= graphIri? '{' triplesBlock? '}'
[] triplesBlock ::= triples ('.' triplesBlock?)?
which is recursive; it is at least contained to a single rule -- it's
how SPARQL 1.0 writes it so it should be reasonable for everyone.
Andy
PS This not not new - see also, from Gregg:
http://lists.w3.org/Archives/Public/public-rdf-comments/2011Dec/0012.html
there, [6] allows multiple adjacent DOTs:
[6] triples ::=
subject predicateObjectList ( "." ( subject predicateObjectList)? )*
matches
:s :p :o1 .... :s :p :o2 ..
Received on Saturday, 15 June 2013 19:54:33 UTC