Skip to content

Instantly share code, notes, and snippets.

@eiel
Created March 4, 2016 08:13
Show Gist options
  • Save eiel/bdb3d6ff7af2428c6c01 to your computer and use it in GitHub Desktop.
Save eiel/bdb3d6ff7af2428c6c01 to your computer and use it in GitHub Desktop.
require 'linkeddata'
require 'csv'
graph = RDF::Graph.load("http://hiroshimarb.github.io/")
query = RDF::Query.new({
person: {
RDF.type => RDF::Vocab::SCHEMA.Person,
RDF::Vocab::SCHEMA.name => :name,
RDF::Vocab::SCHEMA.description => :desc,
}
})
puts %W[なまえ 自己紹介].to_csv
query.execute(graph).map do |person|
puts [person.name, person.desc].to_csv
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment