Language-tagged strings in Turtle


The parsing section of the Turtle spec [1] states the following:

> Literals are composed of a lexical form and an optional language tag [BCP47] or datatype IRI.

However that's not what the RDF Concepts spec states [2]:

> A literal is a language-tagged string if and only if its datatype IRI is, and only in this case the third element is present: a non-empty language tag as defined by [BCP47].

So a literal *always* has a datatype IRI and if it is it also has to have a language tag.
I think the term constructor for RDFLiteral in the Turtle spec needs to explicitly state that if the LANGTAG production rule matched then this is a language-tagged string with the specific datatype IRI

The next sentence in the term constructor for RDFLiteral has a small typo, it needs to start upper-case:

> if neither a language tag nor a datatype IRI is provided, the literal has a datatype of xsd:string.

Otherwise it can stay like that since RDF Concepts explicitly allows this:

> Concrete syntaxes may support simple literals, consisting of only a lexical form without any datatype IRI or language tag. Simple literals only exist in concrete syntaxes, and are treated as syntactic sugar for abstract syntax literals with the datatype IRI



Received on Wednesday, 20 February 2013 21:50:08 UTC