Class GraphComparisons.Partitioning

java.lang.Object
org.eclipse.rdf4j.model.util.GraphComparisons.Partitioning
Enclosing class:
GraphComparisons

static class GraphComparisons.Partitioning extends Object
Encapsulates the current partitioning state of the algorithm, keeping track of previous and current node:hashcode mappings as well as static value mappings.
  • Field Details

    • staticValueMapping

      private final Map<Value,com.google.common.hash.HashCode> staticValueMapping
    • previousNodeMapping

      private Map<BNode,com.google.common.hash.HashCode> previousNodeMapping
    • currentNodeMapping

      private Map<BNode,com.google.common.hash.HashCode> currentNodeMapping
    • currentHashCodeMapping

      private com.google.common.collect.Multimap<com.google.common.hash.HashCode,BNode> currentHashCodeMapping
    • nodeCount

      private final int nodeCount
  • Constructor Details

    • Partitioning

      public Partitioning(Set<BNode> blankNodes)
    • Partitioning

      public Partitioning(Map<BNode,com.google.common.hash.HashCode> nodeMapping, Map<Value,com.google.common.hash.HashCode> staticValueMapping)
  • Method Details

    • getStaticValueMapping

      public Map<Value,com.google.common.hash.HashCode> getStaticValueMapping()
    • getCurrentHashCode

      public com.google.common.hash.HashCode getCurrentHashCode(Value value)
    • getNodes

      public Set<BNode> getNodes()
    • getPreviousHashCode

      public com.google.common.hash.HashCode getPreviousHashCode(Value value)
    • setCurrentHashCode

      public void setCurrentHashCode(BNode bnode, com.google.common.hash.HashCode hashCode)
    • getCurrentNodeMapping

      public Map<BNode,com.google.common.hash.HashCode> getCurrentNodeMapping()
    • nextIteration

      public void nextIteration()
    • isFine

      public boolean isFine()
      A partitioning is fine if every hashcode maps to exactly one blank node.
      Returns:
      true if the partitioning is fine, false otherwise.
    • isFullyDistinguished

      public boolean isFullyDistinguished()
    • getLowestNonTrivialPartition

      public Collection<BNode> getLowestNonTrivialPartition()
    • getMappingSize

      public BigInteger getMappingSize()
      Return a mapping size to determine a canonical lowest mapping.
    • getStaticLiteralHashCode

      private com.google.common.hash.HashCode getStaticLiteralHashCode(Literal value)
    • getCurrentHashCodeMapping

      private com.google.common.collect.Multimap<com.google.common.hash.HashCode,BNode> getCurrentHashCodeMapping()
    • currentUnchanged

      private boolean currentUnchanged()
      Verify if the current node mapping is unchanged compared to the previous node mapping.

      it is unchanged if: all bnodes that have the same hashcode in current also shared the same hashcode in previous, and all bnodes that have different ones in current also have different ones in previous.

      Returns:
      true if unchanged, false otherwise