Module org.apache.jena.core
Interface StoreStrategy
- All Known Implementing Classes:
EagerStoreStrategy,LazyStoreStrategy,ManualStoreStrategy,MinimalStoreStrategy
public interface StoreStrategy
The store strategy defines how triples are indexed and how matches are found.
It is used to implement different indexing strategies like Eager, Lazy, Manual, and Minimal.
For the matching operations, only matches for the patterns SUB_ANY_ANY, ANY_PRE_ANY, ANY_ANY_OBJ,
SUB_PRE_ANY, ANY_PRE_OBJ, and SUB_ANY_OBJ are supported.
The patterns SUB_PRE_OBJ and ANY_ANY_ANY are not supported by the store strategies.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddToIndex(Triple triple, int index) Add a triple to the index if the cuurent strategy supports indexing.voidClear the index of this store if the current strategy supports indexing.booleancontainsMatch(Triple tripleMatch, MatchPattern pattern) Check if the index contains a match for the given triple and pattern.findMatch(Triple tripleMatch, MatchPattern pattern) Find the triples that match the given triple and pattern.voidremoveFromIndex(Triple triple, int index) Remove a triple from the index if the current strategy supports indexing.streamMatch(Triple tripleMatch, MatchPattern pattern) Stream the triples that match the given triple and pattern.
-
Method Details
-
addToIndex
Add a triple to the index if the cuurent strategy supports indexing.- Parameters:
triple- the triple to addindex- the index of the triple in the store
-
removeFromIndex
Remove a triple from the index if the current strategy supports indexing.- Parameters:
triple- the triple to removeindex- the index of the triple in the store
-
clearIndex
void clearIndex()Clear the index of this store if the current strategy supports indexing. This will remove all triples from the index. -
containsMatch
Check if the index contains a match for the given triple and pattern. This is used to quickly check if a triple matches a given pattern without retrieving the triples.- Parameters:
tripleMatch- the triple to matchpattern- the pattern to match against- Returns:
- true if there is a match, false otherwise
-
streamMatch
Stream the triples that match the given triple and pattern. This is used to retrieve the triples that match a given pattern.- Parameters:
tripleMatch- the triple to matchpattern- the pattern to match against- Returns:
- a stream of triples that match the given pattern
-
findMatch
Find the triples that match the given triple and pattern. This is used to retrieve the triples that match a given pattern as an iterator.- Parameters:
tripleMatch- the triple to matchpattern- the pattern to match against- Returns:
- an iterator over the triples that match the given pattern
-