/dev/null", $output, $status); if ($status != 0) { throw new EasyRdf_Exception( "Failed to execute the command '$rapperCmd': $result" ); } else { $this->rapperCmd = $rapperCmd; } } /** * Serialise an EasyRdf_Graph to the RDF format of choice. * * @param object EasyRdf_Graph $graph An EasyRdf_Graph object. * @param string $format The name of the format to convert to. * @return string The RDF in the new desired format. */ 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 ); } }