w3c / rdf-star

RDF-star specification
https://w3c.github.io/rdf-star/
Other
120 stars 23 forks source link

trig-star : grammar and tests are inconsistent #283

Closed lisp closed 1 year ago

lisp commented 1 year ago

the grammar suggests the following:

[5] | wrappedGraph | ::= | "{" triplesBlock? "}"
[6] | triplesBlock | ::= | triples ("." triplesBlock?)?

except for 'trig-star-annotation-1.trig' the syntax tests require

[5] | wrappedGraph | ::= | "{" triplesBlock?  "." "}"
[6] | triplesBlock | ::= | triples ("." triplesBlock?)?
Tpt commented 1 year ago

Hi! I believe the current grammar is correct. Indeed triplesBlock allows to be finished with a "." (note the question mark after the recursive call to triplesBlock in triplesBlock rule).

The current grammar allow productions like: wrappedGraph -> "{" triplesBlock? "}" -> "{" triplesBlock "}" -> "{" triples ("." triplesBlock?)? "}" -> "{" triples "." triplesBlock? "}" -> "{" triples "." "}" so, allows trailing dots.

Your grammar change would means that a dot at the end of a łrappedGraph is mandatory and it is allowed to have two dots at the end.

But I am maybe missing something

lisp commented 1 year ago

thank you for pointing this out to me. i had overlooked the inner optional.