Interface StoreStrategy

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 Details

    • addToIndex

      void addToIndex(Triple triple, int index)
      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 triple
      index - the stable index it now occupies in the triple set
    • removeFromIndex

      void removeFromIndex(Triple triple, int index)
      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 triple
      index - 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

      boolean containsSubAnyAny(Node s)
    • containsAnyPreAny

      boolean containsAnyPreAny(Node p)
    • containsAnyAnyObj

      boolean containsAnyAnyObj(Node o)
    • containsSubPreAny

      boolean containsSubPreAny(Node s, Node p)
    • containsSubAnyObj

      boolean containsSubAnyObj(Node s, Node o)
    • containsAnyPreObj

      boolean containsAnyPreObj(Node p, Node o)
    • streamSubAnyAny

      Stream<Triple> streamSubAnyAny(Node s)
    • streamAnyPreAny

      Stream<Triple> streamAnyPreAny(Node p)
    • streamAnyAnyObj

      Stream<Triple> streamAnyAnyObj(Node o)
    • streamSubPreAny

      Stream<Triple> streamSubPreAny(Node s, Node p)
    • streamSubAnyObj

      Stream<Triple> streamSubAnyObj(Node s, Node o)
    • streamAnyPreObj

      Stream<Triple> streamAnyPreObj(Node p, Node o)
    • findSubAnyAny

      ExtendedIterator<Triple> findSubAnyAny(Node s)
    • findAnyPreAny

      ExtendedIterator<Triple> findAnyPreAny(Node p)
    • findAnyAnyObj

      ExtendedIterator<Triple> findAnyAnyObj(Node o)
    • findSubPreAny

      ExtendedIterator<Triple> findSubPreAny(Node s, Node p)
    • findSubAnyObj

      ExtendedIterator<Triple> findSubAnyObj(Node s, Node o)
    • findAnyPreObj

      ExtendedIterator<Triple> findAnyPreObj(Node p, Node o)
    • 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