Is the following Turtle/N3 Long literal valid or should the quote inside it be escaped?
The Turtle specification says that you can use the \" escape inside long strings but doesn't say that you have to.
Is the above literal valid or should it be encoded as follows instead?
As an addition to my question is it still valid to not escape the quote if the quote occurs at the end of the literal e.g.
Or should it be the following:
I've had reports from other people that some RDF parsers don't understand this syntax despite the fact that they should since they should use a longest token (i.e. maximal munch) rule for parsing.
The above literal is valid. From the spec:
Looking at lcharacter:
And in echaracter:
Character is basically everything, plus unicode escapes.
So '"' is fine. It's probably clearer when you contrast
i.e. definitely not '"'.
Concerning new question
I think (much less certain here) the latter is correct, i.e.
Answering my own question, seems you don't need to escape double quotes as one of the Turtle test suite tests uses an unescaped quote in a long literal.
answered 28 Apr '10, 13:15
Rob Vesse ♦