How-to: Serialize results to rdf/xml, turtle, json-ld or N-triples format #57

m1ci opened this Issue Nov 28, 2013 · 3 comments


None yet

2 participants



I need to serialize graph (result from CONSTRUCT or SELECT query) in different RDF serialization formats: rdf/xml, turtle, json-ld and N-triples.
I use the graph.toNT() method to get the results in N-triples, what about the rdf/xml and the other formats?

Is there some way to serialize the results in other formats?

Thanks, all the best!


Hi Antonio,

I saw the implementation of the .toNT() function and the use of the .toString(), however, I still do not see how I can serialize the results in RDF/XML. I think you are suggesting writing my own converter to XML (RDF/XML).
If I am not wrong, also the RDF/XML results for the SPARQL endpoint you are serializing "manually"...



Hi Milan,

Yes I think this needs to be implemented still. So you can also get the triples an serialize them yourself in an external function. I think it would make sense to include rdf/xml serializing, especially since now also a rdf/xml parser is included.

Best regards,
Michael (not Antonio :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment