Parse some RDF data into the graph object.
string $data Data to parse for the graph:
string $format Optional format of the data:
string $uri The URI of the data to load:
integer The number of triples added to the graph
public function parse($data, $format = null, $uri = null) {
$this
->checkResourceParam($uri, true);
if (empty($format) or $format == 'guess') {
// Guess the format if it is Unknown
$format = EasyRdf_Format::guessFormat($data, $uri);
}
else {
$format = EasyRdf_Format::getFormat($format);
}
if (!$format) {
throw new EasyRdf_Exception("Unable to parse data of an unknown format.");
}
$parser = $format
->newParser();
return $parser
->parse($this, $data, $format, $uri);
}