rdf.js icon indicating copy to clipboard operation
rdf.js copied to clipboard

Bug report: Turtle serializer

Open davidgovea opened this issue 14 years ago • 1 comments

The turtle serializer is not returning the proper value for typed literals.

Example to replicate problem:

var graph, serialized,
    turtle = '    \
@prefix foaf: <http://xmlns.com/foaf/0.1/> .    \
@prefix test: <http://david/> .                 \
                                                \
test:me a foaf:Person;                          \
    foaf:age 9001 .                             \
';

rdf.parseTurtle(turtle, function(g){
    graph = g;
});
serialized = rdf.turtle(graph);

The resulting output:

@prefix foaf: <http://xmlns.com/foaf/0.1/> . 
@prefix test: <http://david/> . 
test:me a foaf:Person; 
    foaf:age undefined .

And here is the output of rdf.nt(graph):

<http://david/me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> . 
<http://david/me> <http://xmlns.com/foaf/0.1/age> "9001"^^<http://www.w3.org/2001/XMLSchema#integer> .

On parsing, the Literal is typed properly, but the turtle serializer does not return the expected result.

davidgovea avatar Aug 05 '11 21:08 davidgovea

This also occurs with boolean values.

davidgovea avatar Aug 05 '11 21:08 davidgovea