public function EasyRdf_Graph::serialise

Serialise the graph into RDF

The $format parameter can be an EasyRdf_Format object, a format name, a mime type or a file extension.

Example: $turtle = $graph->serialise('turtle');

Parameters

mixed $format The format to serialise to:

Return value

mixed The serialised graph

File

drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Graph.php, line 1269

Class

EasyRdf_Graph
Container for collection of EasyRdf_Resources.

Code

public function serialise($format) {
  if (!$format instanceof EasyRdf_Format) {
    $format = EasyRdf_Format::getFormat($format);
  }
  $serialiser = $format
    ->newSerialiser();
  return $serialiser
    ->serialise($this, $format
    ->getName());
}