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 ; }
Hashes all of the quads about a blank node .