function Serializer($name) { $ser = new LibRDF_Serializer($name); foreach (self::$Vocabularies as $name => $vocab) { if ($name == 'rdf') { continue; } $ser->setNamespace($vocab->getNS(), $name); } return $ser; }
/** * Set namespace mappings on class level. * * @param array $map * @return void */ public static function setNamespaces($map) { self::$namespaces = $map; }
/** * Serialize the model and write the contents to a file. * * @param LibRDF_Serializer $serializer The serializer to use * @param string $file_name The name of the file to which to write * @param string $base_uri The base URI to use * @return void * @throws LibRDF_Error If unable to serialize the model * @access public */ public function serializeStatementsToFile(LibRDF_Serializer $serializer, $file_name, $base_uri = NULL) { if ($base_uri) { $base_uri = new LibRDF_URI($base_uri); } $ret = librdf_serializer_serialize_model_to_file($serializer->getSerializer(), $file_name, $base_uri ? $base_uri->getURI() : $base_uri, $this->model); if ($ret) { throw new LibRDF_Error("Error serializing model to file"); } }