Class: RDF::Raptor::RDFXML::Reader

Inherits:
RDF::Raptor::Reader
  • Object
show all
Defined in:
lib/rdf/raptor/rdfxml.rb

Overview

RDF/XML parser.

Examples:

Obtaining an RDF/XML reader class

RDF::Reader.for(:rdfxml)       #=> RDF::Raptor::RDFXML::Reader
RDF::Reader.for("input.rdf")
RDF::Reader.for(file_name:      "input.rdf")
RDF::Reader.for(file_extension: "rdf")
RDF::Reader.for(content_type:   "application/rdf+xml")

Parsing RDF statements from an RDF/XML file

RDF::Reader.open("input.rdf") do |reader|
  reader.each_statement do |statement|
    puts statement.inspect
  end
end