gjhiggins/rdflib — Issue #18: format="nt" multiline literals need escaping
Author: gjhiggins
Created: 2011-10-19 00:55:42+00:00
State: open

Originally filed by drewpca on 2008-02-22T17:19:18

What steps will reproduce the problem?

>>> from rdflib import Graph, Literal, URIRef
>>> g = Graph()
>>> g.add((URIRef("foo"), URIRef("foo"), Literal("multi\nline")))
>>> g.serialize(format="nt")
' """multi\nline""".\n'

The output should be something like this, since ntriples doesn't allow
literals to span multiple lines:
' "multi\\nline".\n'