Exemplo n.º 1
0
 /**
  * Check if a given instance of \Saft\Rdf\Node is equal to this instance.
  *
  * @param \Saft\Rdf\Node $toCompare
  * @return boolean True, if both instances are semantically equal, false otherwise.
  */
 public function equals(\Saft\Rdf\Node $toCompare)
 {
     if ($toCompare instanceof BlankNode) {
         return $this->getBlankId() === $toCompare->getBlankId();
     }
     return false;
 }
Exemplo n.º 2
0
 public function createRedlandNodeFromNode(Node $node)
 {
     if ($node instanceof NamedNode || $node instanceof Literal || $node instanceof BlankNode) {
         return $node->getRedlandNode();
     } elseif ($node->isNamed()) {
         return $this->createNamedNode($node->getUri())->getRedlandNode();
     } elseif ($node->isLiteral()) {
         return $this->createLiteral($node->getValue(), $node->getDatatype(), $node->getLanguage())->getRedlandNode();
     } elseif ($node->isBlank()) {
         return $this->createBlankNode($node->getBlankId())->getRedlandNode();
     }
     throw new \Exception("This node type (" . get_class($node) . ") is not supported by Redland backend");
 }