W3C home > Mailing lists > Public > semantic-web@w3.org > December 2010

Re: csv to rdf

From: carmen <_@whats-your.name>
Date: Thu, 16 Dec 2010 17:08:15 +0000
To: semantic-web@w3c.org
Message-ID: <20101216170815.GA2875@11.Belkin>

   open('a.csv').readlines.map{|l|l.chomp.split(/\t/)}.do{|t|
      t[0].do{|x|
        t[1..-1].each_with_index{|r,ow|r.each_with_index{|v,i|
            yield '#r'+ow.to_s,x[i],v
          }}}}



a minimalist option in Ruby,
just minting a URI for each row (ideas ther?)..

after a bit of code massaging the resulting model into HTML (http://element.rubyforge.org/git?p=element.git;a=blob;f=ruby/W/sw.rb)

http://blog.whats-your.name/public/16m.html
Received on Thursday, 16 December 2010 17:08:57 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 21:45:40 GMT