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 Details

    • addToIndex

      void addToIndex(Triple triple, int index)
      Add a triple to the index if the cuurent strategy supports indexing.
      Parameters:
      triple - the triple to add
      index - the index of the triple in the store
    • removeFromIndex

      void removeFromIndex(Triple triple, int index)
      Remove a triple from the index if the current strategy supports indexing.
      Parameters:
      triple - the triple to remove
      index - 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

      boolean containsMatch(Triple tripleMatch, MatchPattern pattern)
      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 match
      pattern - the pattern to match against
      Returns:
      true if there is a match, false otherwise
    • streamMatch

      Stream<Triple> streamMatch(Triple tripleMatch, MatchPattern pattern)
      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 match
      pattern - the pattern to match against
      Returns:
      a stream of triples that match the given pattern
    • findMatch

      ExtendedIterator<Triple> findMatch(Triple tripleMatch, MatchPattern pattern)
      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 match
      pattern - the pattern to match against
      Returns:
      an iterator over the triples that match the given pattern