Re: RDF to CSV

I've used a command pipeline to do this, where I first convert to 
N-TRIPLES format.  I then use the "sed" tool to convert the NTRIPLES to 
CSV.  I use Jena's rdfcat tool to convert from Turtle or RDF/XML to 
N-TRIPLES.

The sed pipeline is:

    sed 's/ \.$//' | sed 's/> />,/g' | sed 's/ </,</'

Not sure if this works for all cases, but N-TRIPLES is a very simple 
syntax, so there aren't too many variations.

I put this script in a file named ntrip2csv, and then do something like 
this (for RDF file myfile.owl):

    java jena.rdfcat -out t  myfile.owl | ntrip2csv 

If on windows instead of Unix, use double quotes instead of single 
quotes in the sed command, and get a windows-compatible sed here: 
http://www.cornerstonemag.com/sed/

 -Mark

Mark Wallace
Principal Engineer, Semantic Applications
Modus Operandi, Melbourne, FL, USA



vasavi kamdar wrote:
> Hi,
>
> Can any one please help me with converting an RDF file to CSV
> Thanks and Regards,
> Vasavi Kamdar
>
> The great pleasure in life is doing what people say you cannot do...

Received on Wednesday, 27 January 2010 13:27:49 UTC