# installation: gem1.9.1 install rdf
require 'rdf' require 'rdf/ntriples'
graph = RDF::Graph.new << [:hello, RDF::DC.title, "Hello, world!"] graph.dump(:ntriples)
# or
RDF::Writer.open("hello.nt") { |writer| writer << graph }
Here's the contents of file hello.nt