- All Known Implementing Classes:
EagerStoreStrategy,EagerStoreStrategy,LazyStoreStrategy,ManualStoreStrategy,MinimalStoreStrategy
public interface StoreStrategy
Plug-in interface that controls how the auxiliary subject/predicate/object
index of a
TripleStore which supports strategies
is maintained and how partial-pattern matches are evaluated.
The match methods only need to handle the partial-pattern cases:
MatchPattern.SUB_ANY_ANY, MatchPattern.ANY_PRE_ANY,
MatchPattern.ANY_ANY_OBJ, MatchPattern.SUB_PRE_ANY,
MatchPattern.ANY_PRE_OBJ and MatchPattern.SUB_ANY_OBJ.
The fully concrete pattern MatchPattern.SUB_PRE_OBJ and the
fully open pattern MatchPattern.ANY_ANY_ANY are answered directly
from the triple set by the enclosing store and never reach the strategy.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddToIndex(Triple triple, int index) Notify the strategy that a triple was added to the underlying triple set at the given index.voidDiscard any auxiliary index data held by the strategy.booleanbooleanbooleancontainsAnyPreObj(Node p, Node o) booleanbooleancontainsSubAnyObj(Node s, Node o) booleancontainsSubPreAny(Node s, Node p) findAnyPreObj(Node p, Node o) findSubAnyObj(Node s, Node o) findSubPreAny(Node s, Node p) default booleanCheck if the index has been initialized and all triples are indexed.voidremoveFromIndex(Triple triple, int index) Notify the strategy that the triple at the given index has been removed from the underlying triple set.streamAnyPreObj(Node p, Node o) streamSubAnyObj(Node s, Node o) streamSubPreAny(Node s, Node p)
-
Method Details
-
addToIndex
Notify the strategy that a triple was added to the underlying triple set at the given index. Implementations that maintain an index must update it; implementations without an index are free to no-op.- Parameters:
triple- the newly added tripleindex- the stable index it now occupies in the triple set
-
removeFromIndex
Notify the strategy that the triple at the given index has been removed from the underlying triple set. Implementations that maintain an index must remove the triple from it; implementations without an index are free to no-op.- Parameters:
triple- the removed tripleindex- the index it occupied immediately before removal
-
clearIndex
void clearIndex()Discard any auxiliary index data held by the strategy. Implementations without an index may no-op. -
containsSubAnyAny
-
containsAnyPreAny
-
containsAnyAnyObj
-
containsSubPreAny
-
containsSubAnyObj
-
containsAnyPreObj
-
streamSubAnyAny
-
streamAnyPreAny
-
streamAnyAnyObj
-
streamSubPreAny
-
streamSubAnyObj
-
streamAnyPreObj
-
findSubAnyAny
-
findAnyPreAny
-
findAnyAnyObj
-
findSubPreAny
-
findSubAnyObj
-
findAnyPreObj
-
isIndexInitialized
default boolean isIndexInitialized()Check if the index has been initialized and all triples are indexed.- Returns:
- true if the index is initialized, false otherwise
-