Issues found in Turtle spec

I just finished implementing RDF 1.1 Turtle [1] from the most recent spec [2]. I encountered some minor issues and ambiguities in the spec:


 *   In section 2.1, the spec indicates that "Literals , prefixed names and IRIs may also contain escapes to encode surrounding syntax ...", however the description in 5.2 indicates that only IRI_REF and the various STRING_LITERAL terms are subject to unescaping. This means that an IRI which might otherwise be representable using a PNAME cannot if the IRI contains any characters that might need escaping. This implementation currently abides by this restriction. Presumably, this would affect both PNAME_NS and PNAME_LN terminals.
 *   The empty prefix ':' does not have a default definition. In Notation, this definition was '<#>' which is specifically not intended to be used in Turtle. However, example markup using the empty prefix is common. This implementation defines the empty prefix as an alias for the current base IRI (either defined using @base, or based on the document's origin).
 *   The EBNF definition of IRI_REF seems malformed, and has no provision for \^, as discussed elsewhere in the spec. We presume that [#0000- ] is intended to be [#0000-#0020].
 *   The list example in section 6 uses a list on it's own, without a predicate or object, which is not allowed by the grammar (neither is a blankNodeProperyList). Either the EBNF should be updated to allow for these forms, or the examples should be changed such that ( ... ) and [ ... ] are used only in the context of being a subject or object. This implementation will generate triples, however an error will be generated if the parser is run in validation mode.

FWIW, I was able to use the SWIG toolset to generate turtle-ll1.n3 (after some patches), and generate branch and first/follow tables to implement the parser directly from the EBNF description. However, there is a bug in ebnf2turtle.py that breaks @base and @prefix definitions in the generated Turtle/N3.

Gregg

[1] http://github.com/gkellogg/rdf-turtle.
[2] http://www.w3.org/TR/2011/WD-turtle-20110809/

Gregg

Received on Monday, 29 August 2011 19:22:18 UTC