Serialise an EasyRdf_Graph to the RDF format of choice.
object EasyRdf_Graph $graph An EasyRdf_Graph object.:
string $format The name of the format to convert to.:
string The RDF in the new desired format.
Overrides EasyRdf_Serialiser_Ntriples::serialise
public function serialise($graph, $format) {
parent::checkSerialiseParams($graph, $format);
$ntriples = parent::serialise($graph, 'ntriples');
// Hack to produce more concise RDF/XML
if ($format == 'rdfxml') {
$format = 'rdfxml-abbrev';
}
return EasyRdf_Utils::execCommandPipe($this->rapperCmd, array(
'--quiet',
'--input',
'ntriples',
'--output',
$format,
'-',
'unknown://',
), $ntriples);
}