rdf.js
rdf.js copied to clipboard
Bug report: Turtle serializer
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.
This also occurs with boolean values.