ARC2::getParser PHP Method

getParser() static public method

* parsers
static public getParser ( $prefix, $a = '' )
    static function getParser($prefix, $a = '')
    {
        return ARC2::getComponent($prefix . 'Parser', $a);
    }

Usage Example

Example #1
0
 /**
  * Parse an RDF document into an EasyRdf_Graph
  *
  * @param object EasyRdf_Graph $graph   the graph to load the data into
  * @param string               $data    the RDF document data
  * @param string               $format  the format of the input data
  * @param string               $baseUri the base URI of the data being parsed
  * @return boolean             true if parsing was successful
  */
 public function parse($graph, $data, $format, $baseUri)
 {
     parent::checkParseParams($graph, $data, $format, $baseUri);
     if (array_key_exists($format, self::$_supportedTypes)) {
         $className = self::$_supportedTypes[$format];
     } else {
         throw new EasyRdf_Exception("EasyRdf_Parser_Arc does not support: {$format}");
     }
     $parser = ARC2::getParser($className);
     if ($parser) {
         $parser->parse($baseUri, $data);
         $rdfphp = $parser->getSimpleIndex(false);
         return parent::parse($graph, $rdfphp, 'php', $baseUri);
     } else {
         throw new EasyRdf_Exception("ARC2 failed to get a {$className} parser.");
     }
 }
All Usage Examples Of ARC2::getParser