Class: RDF::Raptor::RDFXML::Writer

Inherits:
Writer
  • Object
show all
Defined in:
lib/rdf/raptor/rdfxml.rb

Overview

RDF/XML serializer.

Examples:

Obtaining an RDF/XML writer class

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

Serializing RDF statements into an RDF/XML file

RDF::Writer.open("output.rdf") do |writer|
  graph.each_statement do |statement|
    writer << statement
  end
end