protected function EasyRdf_Parser::checkParseParams

Check, cleanup parameters and prepare for parsing @ignore

9 calls to EasyRdf_Parser::checkParseParams()
EasyRdf_Parser_Arc::parse in drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Arc.php
Parse an RDF document into an EasyRdf_Graph
EasyRdf_Parser_Json::parse in drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Json.php
Parse RDF/JSON into an EasyRdf_Graph
EasyRdf_Parser_Ntriples::parse in drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Ntriples.php
Parse an N-Triples document into an EasyRdf_Graph
EasyRdf_Parser_Rapper::parse in drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Rapper.php
Parse an RDF document into an EasyRdf_Graph
EasyRdf_Parser_Rdfa::parse in drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Rdfa.php
Parse RDFa 1.1 into an EasyRdf_Graph

... See full list

File

drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Parser.php, line 87

Class

EasyRdf_Parser
Parent class for the EasyRdf parsers

Code

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;
}