Sha256: 843d78132e157721612b6c8e3dc6af318e914fde7d74e665a2809e2eadb4f891
Contents?: true
Size: 1.22 KB
Versions: 16
Compression:
Stored size: 1.22 KB
Contents
#!/usr/bin/env ruby $:.unshift(File.join(File.dirname(__FILE__), 'lib')) require 'rubygems' require 'rdf/rdfxml' data = <<-EOF; <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ex="http://www.example.org/" xml:lang="en" xml:base="http://www.example.org/foo"> <ex:Thing rdf:about="http://example.org/joe" ex:name="bar"> <ex:belongsTo rdf:resource="http://tommorris.org/" /> <ex:sampleText rdf:datatype="http://www.w3.org/2001/XMLSchema#string">foo</ex:sampleText> <ex:hadADodgyRelationshipWith> <rdf:Description> <ex:name>Tom</ex:name> <ex:hadADodgyRelationshipWith> <rdf:Description> <ex:name>Rob</ex:name> <ex:hadADodgyRelationshipWith> <rdf:Description> <ex:name>Mary</ex:name> </rdf:Description> </ex:hadADodgyRelationshipWith> </rdf:Description> </ex:hadADodgyRelationshipWith> </rdf:Description> </ex:hadADodgyRelationshipWith> </ex:Thing> </rdf:RDF> EOF RDF::RDFXML::Reader.new(data, :base_uri => 'http://example.org/example.xml') do |reader| reader.each_statement do |statement| statement.inspect! end end
Version data entries
16 entries across 16 versions & 2 rubygems