You are here

public static function EasyRdf_Graph::newAndLoad in Zircon Profile 8

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

Create a new graph and load RDF data from a URI into it

This static function is shorthand for: $graph = new EasyRdf_Graph($uri); $graph->load($uri, $format);

The document type is optional but should be specified if it can't be guessed or got from the HTTP headers.

Parameters

string $uri The URI of the data to load:

string $format Optional format of the data (eg. rdfxml):

Return value

object EasyRdf_Graph The new the graph object

File

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

Class

EasyRdf_Graph
Container for collection of EasyRdf_Resources.

Code

public static function newAndLoad($uri, $format = null) {
  $graph = new self($uri);
  $graph
    ->load($uri, $format);
  return $graph;
}