private static String hashQuads(String id, Map<String, Object> bnodes, UniqueNamer namer) {
        // return cached hash
        if (((Map<String, Object>) bnodes.get(id)).containsKey("hash")) {
            return (String) ((Map<String, Object>) bnodes.get(id)).get("hash");
        }

        // serialize all of bnode's quads
        final List<Map<String, Object>> quads = (List<Map<String, Object>>) ((Map<String, Object>) bnodes
                .get(id)).get("quads");
        final List<String> nquads = new ArrayList<String>();
        for (int i = 0; i < quads.size(); ++i) {
            nquads.add(toNQuad((RDFDataset.Quad) quads.get(i),
                    quads.get(i).get("name") != null
                            ? (String) ((Map<String, Object>) quads.get(i).get("name")).get("value")
                            : null,
                    id));
        }
        // sort serialized quads
        Collections.sort(nquads);
        // return hashed quads
        final String hash = sha1hash(nquads);
        ((Map<String, Object>) bnodes.get(id)).put("hash", hash);
        return hash;
    }
private static String hashQuads ( String id , Map < String , Object > bnodes , UniqueNamer namer ) { if ( ( ( Map < String , Object > ) bnodes . get ( id ) ) . containsKey ( "hash" ) ) { return ( String ) ( ( Map < String , Object > ) bnodes . get ( id ) ) . get ( "hash" ) ; } final List < Map < String , Object > > quads = ( List < Map < String , Object > > ) ( ( Map < String , Object > ) bnodes . get ( id ) ) . get ( "quads" ) ; final List < String > nquads = new ArrayList < String > ( ) ; for ( int i = 0 ; i < quads . size ( ) ; ++ i ) { nquads . add ( toNQuad ( ( RDFDataset . Quad ) quads . get ( i ) , quads . get ( i ) . get ( "name" ) != null ? ( String ) ( ( Map < String , Object > ) quads . get ( i ) . get ( "name" ) ) . get ( "value" ) : null , id ) ) ; } Collections . sort ( nquads ) ; final String hash = sha1hash ( nquads ) ; ( ( Map < String , Object > ) bnodes . get ( id ) ) . put ( "hash" , hash ) ; return hash ; }
Hashes all of the quads about a blank node.

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

@return the new hash.