rdfstore-js icon indicating copy to clipboard operation
rdfstore-js copied to clipboard

Feature Request: Data Serializers

Open davidgovea opened this issue 14 years ago • 2 comments

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

RDF Interfaces spec

davidgovea avatar Aug 05 '11 01:08 davidgovea

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.

antoniogarrote avatar Aug 05 '11 08:08 antoniogarrote

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

ariutta avatar Jun 12 '14 19:06 ariutta