public function EasyRdf_Serialiser_GraphViz::serialise

Serialise an EasyRdf_Graph into a GraphViz dot document.

Supported output format names: dot, gif, png, svg

Parameters

string $graph An EasyRdf_Graph object.:

string $format The name of the format to convert to.:

Return value

string The RDF in the new desired format.

Overrides EasyRdf_Serialiser::serialise

File

drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/GraphViz.php, line 374

Class

EasyRdf_Serialiser_GraphViz
Class to serialise an EasyRdf_Graph to GraphViz

Code

public function serialise($graph, $format) {
  parent::checkSerialiseParams($graph, $format);
  switch ($format) {
    case 'dot':
      return $this
        ->serialiseDot($graph);
    case 'png':
    case 'gif':
    case 'svg':
      return $this
        ->renderImage($graph, $format);
    default:
      throw new EasyRdf_Exception("EasyRdf_Serialiser_GraphViz does not support: {$format}");
  }
}