RDFLib/rdflib — Issue #17: format="nt" multiline literals need escaping
Author: gjhiggins
Created: 2012-02-20 08:30:32+00:00
State: open

drewpca, 2008-02-22T17:19:18.000Z

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'

Comment 1 by eik...@gmail.com

Comment 2 by gromgull
Fixed in r1759