Skip to content

Instantly share code, notes, and snippets.

@arockwell
Created October 4, 2010 20:03
Show Gist options
  • Select an option

  • Save arockwell/610324 to your computer and use it in GitHub Desktop.

Select an option

Save arockwell/610324 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'rdf/raptor'
require 'rdf/ntriples'
glid_pred = RDF::URI.new('http://vivo.ufl.edu/ontology/vivo-ufl/gatorlink')
uri_glid = { RDF::URI.new('http://vivo.ufl.edu/individual/n1639') => RDF::Literal.new('alexhr'),
RDF::URI.new('http://vivo.ufl.edu/individual/n44438') => RDF::Literal.new('drspeedo')
}
statements = []
uri_glid.each do |uri, glid|
statements << RDF::Statement(uri, glid_pred, glid)
end
RDF::Writer.open('test.nt') do |writer|
statements.each do |statement|
writer << statement
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment