Package com.apicatalog.rdf.canon
Class RdfCanon.HashNDegreeQuads
- java.lang.Object
-
- com.apicatalog.rdf.canon.RdfCanon.HashNDegreeQuads
-
- Enclosing class:
- RdfCanon
private class RdfCanon.HashNDegreeQuads extends java.lang.ObjectThe state information for the hash n-degree quads algorithm.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) IdentifierIssuerchosenIssuerThe currently chosen identifier issuer.(package private) java.lang.StringBuilderchosenPathThe currently chosen path.(package private) java.lang.StringBuilderdataToHashThe data which will go into the hash.
-
Constructor Summary
Constructors Modifier Constructor Description privateHashNDegreeQuads()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidappendToPath(java.lang.String related, java.lang.StringBuilder pathBuilder, IdentifierIssuer issuerCopy, java.util.List<java.lang.String> recursionList)Append an ID to the hash path.private java.util.SortedMap<java.lang.String,java.util.Set<java.lang.String>>createHashToRelated(java.lang.String id, IdentifierIssuer issuer)Implementation of steps 1 to 3 of the Hash N-Degree Quads algorithm.private voiddoPermutation(java.lang.String[] permutation, IdentifierIssuer issuer)Process one possible permutation of the blank nodes.(package private) NDegreeResulthash(java.lang.String id, IdentifierIssuer defaultIssuer)Calculate the hash from the N-Degree nodes.private java.lang.StringhashRelatedBlankNode(java.lang.String related, Quad quad, IdentifierIssuer issuer, Position position)Create a hash of the related blank nodes, as described in the specification.
-
-
-
Field Detail
-
dataToHash
final java.lang.StringBuilder dataToHash
The data which will go into the hash.
-
chosenIssuer
IdentifierIssuer chosenIssuer
The currently chosen identifier issuer.
-
chosenPath
java.lang.StringBuilder chosenPath
The currently chosen path.
-
-
Method Detail
-
appendToPath
private void appendToPath(java.lang.String related, java.lang.StringBuilder pathBuilder, IdentifierIssuer issuerCopy, java.util.List<java.lang.String> recursionList)Append an ID to the hash path.- Parameters:
related- the ID to appendpathBuilder- the path to append toissuerCopy- the identifier issuerrecursionList- the node recursion list
-
createHashToRelated
private java.util.SortedMap<java.lang.String,java.util.Set<java.lang.String>> createHashToRelated(java.lang.String id, IdentifierIssuer issuer)Implementation of steps 1 to 3 of the Hash N-Degree Quads algorithm.- Parameters:
id- the ID of the blank node to process related nodes forissuer- the ID issuer currently being used.- Returns:
- the required mapping
-
doPermutation
private void doPermutation(java.lang.String[] permutation, IdentifierIssuer issuer)Process one possible permutation of the blank nodes.- Parameters:
permutation- the permutationissuer- the identifier issuer
-
hash
NDegreeResult hash(java.lang.String id, IdentifierIssuer defaultIssuer)
Calculate the hash from the N-Degree nodes.- Parameters:
bid- the blank node starting IDdefaultIssuer- the identifier issuer- Returns:
- the result
-
hashRelatedBlankNode
private java.lang.String hashRelatedBlankNode(java.lang.String related, Quad quad, IdentifierIssuer issuer, Position position)Create a hash of the related blank nodes, as described in the specification.- Parameters:
related- the ID nodes are related toquad- the quad to processissuer- the identifier issuerposition- the position in the quad- Returns:
- the hash
-
-