/** * Create a new blank node with an optional identifier. * * @param mixed $nodeId The nodeId value or librdf_node resource * @return void * @throws LibRDF_Error If unable to create a new node * @access public */ public function __construct($nodeId = NULL) { if ($nodeId !== NULL) { if (is_resource($nodeId)) { if (librdf_node_is_blank($nodeId)) { $this->node = $nodeId; } else { throw new LibRDF_Error("Resource argument not a valid" . " librdf_node blank node"); } } else { $this->node = librdf_new_node_from_blank_identifier(librdf_php_get_world(), $nodeId); } } else { $this->node = librdf_new_node(librdf_php_get_world()); } if (!$this->node) { throw new LibRDF_Error("Unable to create new blank node"); } }
function _blankNode($id) { if (!isset($this->_blankNodes[$id])) { $r = $this->_blankNodes[$id] = librdf_new_node_from_blank_identifier($this->_world, $id); } else { $r = $this->_blankNodes[$id]; } return $r; }