Parse an RDF document into an EasyRdf_Graph
object EasyRdf_Graph $graph the graph to load the data into:
string $data the RDF document data:
string $format the format of the input data:
string $baseUri the base URI of the data being parsed:
integer The number of triples added to the graph
Overrides EasyRdf_Parser_Json::parse
public function parse($graph, $data, $format, $baseUri) {
parent::checkParseParams($graph, $data, $format, $baseUri);
$json = EasyRdf_Utils::execCommandPipe($this->rapperCmd, array(
'--quiet',
'--input',
$format,
'--output',
'json',
'--ignore-errors',
'--input-uri',
$baseUri,
'--output-uri',
'-',
'-',
), $data);
// Parse in the JSON
return parent::parse($graph, $json, 'json', $baseUri);
}