protected function _hashQuads($id, $bnodes, $namer) {
    // return cached hash
    if(property_exists($bnodes->{$id}, 'hash')) {
      return $bnodes->{$id}->hash;
    }

    // serialize all of bnode's quads
    $quads = $bnodes->{$id}->quads;
    $nquads = array();
    foreach($quads as $quad) {
      $nquads[] = $this->toNQuad($quad, property_exists($quad, 'name') ?
        $quad->name->value : null, $id);
    }

    // sort serialized quads
    sort($nquads);

    // cache and return hashed quads
    $hash = $bnodes->{$id}->hash = sha1(implode($nquads));
    return $hash;
  }
protected function _hashQuads($id, $bnodes, $namer) {
    // return cached hash
    if(property_exists($bnodes->{$id}, 'hash')) {
      return $bnodes->{$id}->hash;
    }

    // serialize all of bnode's quads
    $quads = $bnodes->{$id}->quads;
    $nquads = array();
    foreach($quads as $quad) {
      $nquads[] = $this->toNQuad($quad, property_exists($quad, 'name') ?
        $quad->name->value : null, $id);
    }

    // sort serialized quads
    sort($nquads);

    // cache and return hashed quads
    $hash = $bnodes->{$id}->hash = sha1(implode($nquads));
    return $hash;
  }
protected function _hashQuads ( $ id , $ bnodes , $ namer ) { // return cached hash if ( property_exists ( $ bnodes -> { $ id } , 'hash' ) ) { return $ bnodes -> { $ id } -> hash ; } // serialize all of bnode's quads $ quads = $ bnodes -> { $ id } -> quads ; $ nquads = array ( ) ; foreach ( $ quads as $ quad ) { $ nquads [ ] = $ this -> toNQuad ( $ quad , property_exists ( $ quad , 'name' ) ? $ quad -> name -> value : null , $ id ) ; } // sort serialized quads sort ( $ nquads ) ; // cache and return hashed quads $ hash = $ bnodes -> { $ id } -> hash = sha1 ( implode ( $ nquads ) ) ; return $ hash ; }
Hashes all of the quads about a blank node.

@param string $id the ID of the bnode to hash quads for.
@param stdClass $bnodes the mapping of bnodes to quads.
@param UniqueNamer $namer the canonical bnode namer.

@return string the new hash.
Hashes all of the quads about a blank node .