Introducing the RDF gem

# 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

_:hello http://purl.org/dc/terms/title "Hello, world!" .

Tags:
Source:
1831hrs.txt
Published:
26-01-2012 18:31