| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This repository features an extension of the java.util.Map<K, Set<T>> interface for supporting subset and superset queries over sets of tags associated with keys. Most prominently, an implementation based on the Set Trie datastructure is provided, which is an Index Data Structure for Fast Subset and Superset Queries based on the paper by Iztok Savnik.
The artifact is published on Maven Central, and thus ready for use in your project.
<dependency>
<groupId>org.aksw.commons</groupId>
<artifactId>tagmap-core</artifactId>
<version>1.0.0</version>
</dependency>The project introduces the TagMap interface with the following important properties:
public interface TagMap<K, V>
extends Map<K, Set<V>>
{
TagMap<K, V> getAllSubsetsOf(Collection<?> set);
TagMap<K, V> getAllSupersetsOf(Collection<?> set);
}NOTE: The interface supports iterative refinement of a TagMap, however, at present, all implementations return a TagMapSimple which has linear complexity
The following implementations exist:
TagMap<String, Integer> simpleFm = new TagMapSimple<>();
TagMap<String, Integer> setTrieFm = new TagMapSetTrie<>();
TagMap<String, Integer> invertedListFm = new TagMapInvertedIndex<>();
TagMap<String, Integer> fm = ValidationUtils.createValidatingProxy(setTrieFm, simpleFm);
fm.put("a", Sets.newHashSet(1, 2, 3));
fm.put("b", Sets.newHashSet(1, 2, 4));
fm.put("c", Sets.newHashSet(2, 3, 4));
fm.getAllSubsetsOf(Arrays.asList(1, 2, 3))
.entrySet().forEach(e -> System.out.println("" + e));
fm.getAllSupersetsOf(Arrays.asList(1, 4))
.entrySet().forEach(e -> System.out.println("" + e));| Back | FazBrowse Home | New Git URL |