Check, cleanup parameters and prepare for parsing @ignore
protected function checkParseParams($graph, $data, $format, $baseUri) {
if ($graph == null or !is_object($graph) or !$graph instanceof EasyRdf_Graph) {
throw new InvalidArgumentException("\$graph should be an EasyRdf_Graph object and cannot be null");
}
else {
$this->graph = $graph;
}
if ($format == null or $format == '') {
throw new InvalidArgumentException("\$format cannot be null or empty");
}
elseif (is_object($format) and $format instanceof EasyRdf_Format) {
$this->format = $format = $format
->getName();
}
elseif (!is_string($format)) {
throw new InvalidArgumentException("\$format should be a string or an EasyRdf_Format object");
}
else {
$this->format = $format;
}
if ($baseUri) {
if (!is_string($baseUri)) {
throw new InvalidArgumentException("\$baseUri should be a string");
}
else {
$this->baseUri = new EasyRdf_ParsedUri($baseUri);
}
}
else {
$this->baseUri = null;
}
// Prepare for parsing
$this
->resetBnodeMap();
$this->tripleCount = 0;
}