Class: RDF::Raptor::Graphviz::Writer

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

Overview

Graphviz serializer.

Examples:

Obtaining a Graphviz writer class

RDF::Writer.for(:graphviz)     #=> RDF::Raptor::Graphviz::Writer
RDF::Writer.for("output.dot")
RDF::Writer.for(file_name:      "output.dot")
RDF::Writer.for(file_extension: "dot")
RDF::Writer.for(content_type:   "text/vnd.graphviz")

Serializing RDF statements into a Graphviz file

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