'RDFXML', 'turtle' => 'Turtle', 'ntriples' => 'NTriples', 'posh' => 'POSHRDF' ); /** * Constructor * * @return object EasyRdf_Serialiser_Arc */ public function __construct() { require_once 'arc/ARC2.php'; } /** * Serialise an EasyRdf_Graph into RDF format of choice. * * @param EasyRdf_Graph $graph An EasyRdf_Graph object. * @param string $format The name of the format to convert to. * @param array $options * @throws EasyRdf_Exception * @return string The RDF in the new desired format. */ public function serialise($graph, $format, array $options = array()) { parent::checkSerialiseParams($graph, $format); if (array_key_exists($format, self::$supportedTypes)) { $className = self::$supportedTypes[$format]; } else { throw new EasyRdf_Exception( "EasyRdf_Serialiser_Arc does not support: $format" ); } $serialiser = ARC2::getSer($className); if ($serialiser) { return $serialiser->getSerializedIndex( parent::serialise($graph, 'php') ); } else { throw new EasyRdf_Exception( "ARC2 failed to get a $className serialiser." ); } } } EasyRdf_Format::register('posh', 'poshRDF');