Created
January 30, 2013 09:01
-
-
Save chikoski/4671786 to your computer and use it in GitHub Desktop.
.ttl ファイルを JSONに出力するスクリプト。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'rdf' | |
gem 'rdf-json' | |
gem 'rdf-turtle' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'bundler/setup' | |
require 'rdf' | |
require 'rdf/turtle' | |
require 'rdf/json' | |
TTL="http://data.tom.sfc.keio.ac.jp/rdf/fujisawa_evacuation_site.ttl" | |
json = RDF::Writer.for(:json).buffer do |writer| | |
RDF::Reader.open(TTL) do|reader| | |
reader.each do |stmt| | |
writer << stmt | |
end | |
end | |
end | |
puts json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment