Package org.eclipse.rdf4j.model.util
Class GraphComparisons.Partitioning
java.lang.Object
org.eclipse.rdf4j.model.util.GraphComparisons.Partitioning
- Enclosing class:
GraphComparisons
Encapsulates the current partitioning state of the algorithm, keeping track of previous and current node:hashcode
mappings as well as static value mappings.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate com.google.common.collect.Multimap
<com.google.common.hash.HashCode, BNode> private final int
-
Constructor Summary
ConstructorsConstructorDescriptionPartitioning
(Map<BNode, com.google.common.hash.HashCode> nodeMapping, Map<Value, com.google.common.hash.HashCode> staticValueMapping) Partitioning
(Set<BNode> blankNodes) -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
Verify if the current node mapping is unchanged compared to the previous node mapping.com.google.common.hash.HashCode
getCurrentHashCode
(Value value) private com.google.common.collect.Multimap
<com.google.common.hash.HashCode, BNode> Return a mapping size to determine a canonical lowest mapping.getNodes()
com.google.common.hash.HashCode
getPreviousHashCode
(Value value) private com.google.common.hash.HashCode
getStaticLiteralHashCode
(Literal value) boolean
isFine()
A partitioning is fine if every hashcode maps to exactly one blank node.boolean
void
void
setCurrentHashCode
(BNode bnode, com.google.common.hash.HashCode hashCode)
-
Field Details
-
staticValueMapping
-
previousNodeMapping
-
currentNodeMapping
-
currentHashCodeMapping
private com.google.common.collect.Multimap<com.google.common.hash.HashCode,BNode> currentHashCodeMapping -
nodeCount
private final int nodeCount
-
-
Constructor Details
-
Partitioning
-
Partitioning
-
-
Method Details
-
getStaticValueMapping
-
getCurrentHashCode
-
getNodes
-
getPreviousHashCode
-
setCurrentHashCode
-
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
-
getMappingSize
Return a mapping size to determine a canonical lowest mapping. -
getStaticLiteralHashCode
-
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
-