drlivingston / kr

Clojure API for RDF and SPARQL - provides consistent access to APIs including Jena and Sesame
56 stars 17 forks source link

write as turtle #2

Closed ouvanous closed 11 years ago

ouvanous commented 11 years ago

Hi Sorry if it is a stupid question but I am quite new to java/clojure ... I would like to know how you export query-rdf to turtle or rdf/xml ... Many thanks,

Samuel

drlivingston commented 11 years ago

Hi Samuel,

Currently there is no direct support in the KR package for doing directly what you ask. But it would not be hard to implement. Mostly KR is a really good wrapper for Sesame, and Jena (less experimented with). So you could get to the native Sesame objects and use them directly too.

Right now there is a Sesame writer-kb that if assertions are added to that KB it will serialize them as n-triples. It uses the RIO output library built into Sesame, it wouldn't be terribly hard to extend the writer kb or have options to use different RIO output formats. (I'm happy to accept patches or discuss how to do it too.)

Most of my work uses ntriples or gziped ntriples, so you can pass the constructor for the writer kb an open gzip output stream and write to that to get better compression.

Another option is to use a tool like Rapper to convert between formats.

Thanks for your interest. What kind of RDF work are you doing?

Kevin

On Sun, Feb 17, 2013 at 11:23 AM, Samuel MORELLO notifications@github.comwrote:

Hi Sorry if it is a stupid question but I am quite new to java/clojure ... I would like to know how you export query-rdf to turtle or rdf/xml ... Many thanks,

Samuel

— Reply to this email directly or view it on GitHubhttps://github.com/drlivingston/kr/issues/2.

ouvanous commented 11 years ago

Hi Kevin and many thanks, for your reply.

I will look at RIO and see how to do.
I would like to have n3/turtle as output.

Regarding what i do, i make web apps to collect data.
I use nodejs and 4store to do that but i would like to experiment with clojure.
Thanks again,

Samuel

Le lundi 18 février 2013 à 04:11, Kevin Livingston a écrit :

Hi Samuel,

Currently there is no direct support in the KR package for doing directly
what you ask. But it would not be hard to implement. Mostly KR is a
really good wrapper for Sesame, and Jena (less experimented with). So you
could get to the native Sesame objects and use them directly too.

Right now there is a Sesame writer-kb that if assertions are added to that
KB it will serialize them as n-triples. It uses the RIO output library
built into Sesame, it wouldn't be terribly hard to extend the writer kb or
have options to use different RIO output formats. (I'm happy to accept
patches or discuss how to do it too.)

Most of my work uses ntriples or gziped ntriples, so you can pass the
constructor for the writer kb an open gzip output stream and write to that
to get better compression.

Another option is to use a tool like Rapper to convert between formats.

Thanks for your interest. What kind of RDF work are you doing?

Kevin

On Sun, Feb 17, 2013 at 11:23 AM, Samuel MORELLO
<notifications@github.com (mailto:notifications@github.com)>wrote:

Hi
Sorry if it is a stupid question but I am quite new to java/clojure ...
I would like to know how you export query-rdf to turtle or rdf/xml ...
Many thanks,

Samuel


Reply to this email directly or view it on GitHubhttps://github.com/drlivingston/kr/issues/2.

— Reply to this email directly or view it on GitHub (https://github.com/drlivingston/kr/issues/2#issuecomment-13704845).