drobilla / serd

A lightweight C library for RDF syntax
https://gitlab.com/drobilla/serd
ISC License
86 stars 15 forks source link

Parsing erroneous literals containing double quotes #10

Closed wouterbeek closed 6 years ago

wouterbeek commented 6 years ago

The following is illegal in Turtle-based languages:

<a:a> <a:a> """^^<b:b> .
<c:c> <c:c> """^^<b:b> .

But Serd 0.29.2 parses this, resulting in an output that is also illegal Turtle:

$ serdi test.ttl
<a:a> <a:a> "^^<b:b> .\n<c:c> <c:c> "^^<b:b> .
drobilla commented 6 years ago

Is it? All the characters in the long literal are legal, and that long literal has datatype . That output is ntriples (by default), if you set it to turtle with -o turtle it will look similar to the input (but indented).

rapper, rdfpipe (rdflib), and cwm all have the same behaviour.

wouterbeek commented 6 years ago

Oops, the double quotes got to me there :) closing...

drobilla commented 6 years ago

Took me a minute, too :)

Implementing these triple quotes is a bit annoying, but the official test suite covers the edge cases pretty well.