예제 #1
0
파일: Node.php 프로젝트: bakulf/raop
 /**
  * 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");
     }
 }
예제 #2
0
파일: Graph.php 프로젝트: sgml/rww.io
 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;
 }