Class RdfCanon.HashNDegreeQuads

  • Enclosing class:
    RdfCanon

    private class RdfCanon.HashNDegreeQuads
    extends java.lang.Object
    The state information for the hash n-degree quads algorithm.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) IdentifierIssuer chosenIssuer
      The currently chosen identifier issuer.
      (package private) java.lang.StringBuilder chosenPath
      The currently chosen path.
      (package private) java.lang.StringBuilder dataToHash
      The data which will go into the hash.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private HashNDegreeQuads()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      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 void doPermutation​(java.lang.String[] permutation, IdentifierIssuer issuer)
      Process one possible permutation of the blank nodes.
      (package private) NDegreeResult hash​(java.lang.String id, IdentifierIssuer defaultIssuer)
      Calculate the hash from the N-Degree nodes.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.
    • Constructor Detail

      • HashNDegreeQuads

        private HashNDegreeQuads()
    • 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 append
        pathBuilder - the path to append to
        issuerCopy - the identifier issuer
        recursionList - 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 for
        issuer - 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 permutation
        issuer - 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 ID
        defaultIssuer - 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 to
        quad - the quad to process
        issuer - the identifier issuer
        position - the position in the quad
        Returns:
        the hash