You are here

public function EasyRdf_Graph::parseFile in Zircon Profile 8

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

Parse a file containing RDF data into the graph object.

Parameters

string $filename The path of the file to load:

string $format Optional format of the file:

string $uri The URI of the file to load:

Return value

integer The number of triples added to the graph

File

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

Class

EasyRdf_Graph
Container for collection of EasyRdf_Resources.

Code

public function parseFile($filename, $format = null, $uri = null) {
  if ($uri === null) {
    $uri = "file://{$filename}";
  }
  return $this
    ->parse(file_get_contents($filename), $format, $uri);
}