/** * getRdf get the full BIBO RDF serialization of the collection of entries * @param $format the serialization format * @throws Exception if PHP_ZOTERO_ENTRIES_ARC_PATH is not defined */ public function getRdf($format = 'rdf/xml') { if (!defined('PHP_ZOTERO_ENTRIES_ARC_PATH')) { throw new Exception('PHP_ZOTERO_ENTRIES_ARC_PATH must be defined and valid to use RDF methods'); } require_once PHP_ZOTERO_ENTRIES_ARC_PATH; switch ($format) { case 'rdf/xml': $ser = ARC2::getRDFXMLSerializer($this->arcConf); break; case 'rdf/json': $ser = ARC2::getRDFJsonSerializer($this->arcConf); break; case 'turtle': $ser = ARC2::getTurtleSerializer($this->arcConf); break; case 'ntriples': $ser = ARC2::getNTriplesSerializer($this->arcConf); break; } return $ser->getSerializedIndex($this->getArcIndex()); }
/** * getItemAsRdf returns the BIBO RDF for the entire Zotero Item * @param $format default 'rdf/xml' the rdf serialization to use * @return string the RDF serialization * @throw Exception if PHP_ZOTERO_ENTRIES_ARC_PATH is not defined */ public function getItemAsRdf($format = 'rdf/xml') { if (!defined('PHP_ZOTERO_ENTRIES_ARC_PATH')) { throw new Exception('PHP_ZOTERO_ENTRIES_ARC_PATH must be defined and valid to use RDF methods'); } if (!$this->arcIndex) { $this->setRdf(); } switch ($format) { case 'rdf/xml': $ser = ARC2::getRDFXMLSerializer($this->arcConf); break; case 'rdf/json': $ser = ARC2::getRDFJsonSerializer($this->arcConf); break; case 'turtle': $ser = ARC2::getTurtleSerializer($this->arcConf); break; case 'ntriples': $ser = ARC2::getNTriplesSerializer($this->arcConf); break; } return $ser->getSerializedIndex(array($this->itemUri => $this->arcIndex[$this->itemUri])); }