Package org.aksw.jena_sparql_api.views
Class EquiMap<K,V>
java.lang.Object
org.aksw.jena_sparql_api.views.EquiMap<K,V>
- Type Parameters:
K-V-
A map where keys can be stated as equivalent.
Provides methods for checking consistency (the map gets inconsistent
as soon as a key maps to multiple non-equal values)
TODO Not sure if a conflict resultion strategy for the case that
values are not directly equal but not contradictory should go here.
For instance if a key x maps to {A, B} and y maps to {A} one resolution stragtegy
might be to map both to A.
Essentially I have the ValueSets in mind to quickly reject inconsistent bindings.
- Author:
- raven
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanareAllEqual(Collection<K> set) voidclear()getAllEquivalences(Collection<?> keys, boolean reflexiv) getEquivalences(Object key, boolean reflexiv) booleanisCompatible(EquiMap<K, V> other) Checks whether the union of two equimaps is again consistent.booleanisConsistentInsertEquiv(K a, K b) booleanisConsistentInsertValue(K a, V b) booleanisConsistentSet(Set<V> set) booleanbooleankeySet()booleanvoidtoString()
-
Constructor Details
-
EquiMap
public EquiMap() -
EquiMap
-
-
Method Details
-
keySet
- Returns:
- A view of all keys
-
clear
public void clear() -
isEqual
-
areAllEqual
-
isConsistentInsertEquiv
-
isConsistentSet
-
isConsistentInsertValue
-
isSelfConsistent
public boolean isSelfConsistent() -
getEquivalences
-
getKeyToValue
-
put
-
getAll
-
getEquivalences
-
getAllEquivalences
-
get
-
makeEqual
-
isCompatible
Checks whether the union of two equimaps is again consistent.- Parameters:
other-- Returns:
-
toString
-