invalid JSON query output with newlines in literal values

Bug #158954 reported by Mikael Högqvist
2
Affects Status Importance Assigned to Milestone
rdflib
New
Undecided
Unassigned

Bug Description

Input data:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE owl [
        <!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
        <!ENTITY xsd 'http://www.w3.org/2001/XMLSchema#'>
]>
<rdf:RDF xmlns:rdf="&rdf;"
        xmlns:xsd="&xsd;"
 >

<rdf:Description rdf:about="http://somewhere/JohnSmith/">
  <rdf:value>This
is
some
multi-line
text
literal</rdf:value>
</rdf:Description>

</rdf:RDF>

Query:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?value
WHERE {
  ?bla rdf:value ?value ;
}

This returns invalid JSON looking something like this:

{ "head" : { "vars" : [ "value" ] },
    "results" : { "ordered" : false, "distinct" : false, "bindings" : [ {
                   "value" : {"type": "literal", "xml:lang" : "None", "value" : "This
is
some
multi-line
text
literal"}}]}}

The newline characters should be escaped.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.