You are here

public function EasyRdf_Graph::dump in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/easyrdf/easyrdf/lib/EasyRdf/Graph.php \EasyRdf_Graph::dump()

Return a human readable view of all the resources in the graph

This method is intended to be a debugging aid and will return a pretty-print view of all the resources and their properties.

Parameters

string $format Either 'html' or 'text':

Return value

string

File

vendor/easyrdf/easyrdf/lib/EasyRdf/Graph.php, line 1312

Class

EasyRdf_Graph
Container for collection of EasyRdf_Resources.

Code

public function dump($format = 'html') {
  $result = '';
  if ($format == 'html') {
    $result .= "<div style='font-family:arial; font-weight: bold; padding:0.5em; " . "color: black; background-color:lightgrey;border:dashed 1px grey;'>" . "Graph: " . $this->uri . "</div>\n";
  }
  else {
    $result .= "Graph: " . $this->uri . "\n";
  }
  foreach ($this->index as $resource => $properties) {
    $result .= $this
      ->dumpResource($resource, $format);
  }
  return $result;
}