rdfstore-js
rdfstore-js copied to clipboard
Feature Request: Data Serializers
It would be great to be able to serialize the graph to N-Triple / Turtle format.
webr3's rdf.js has functionality that can be drawn from - see here
Yes, it is a must. Right now you can only add parsers to load data in the store but not to serialize the content.
Nevertheless, W3C's RDF Interfaces API spcifies a toNT() method that can be used to serialize a graph you retrieve from the store with a SPARQL 'CONSTRUCT' or the graph() store function.
Oddly enough, W3C RDF's API does not specify this same method in the graph object. I have made some changes and now you can use it on a returned graph to get the N3 serialization:
https://gist.github.com/1127140
Regards.
It looks as if it's possible to serialize to JSON-LD as well: https://github.com/antoniogarrote/rdfstore-js/blob/e4b0cbbd27ee3a8a8f7ba06531ef5730ade35945/dist/nodejs/server.js#L370