Class MinimalStoreStrategy

java.lang.Object
org.apache.jena.mem.store.roaring.strategies.MinimalStoreStrategy
All Implemented Interfaces:
StoreStrategy

public class MinimalStoreStrategy extends Object implements StoreStrategy
A minimal store strategy that does not maintain any bitmaps or indexes. This strategy is used when no indexing is required. The matching operations are performed directly on the set of triples. This strategy is useful for scenarios where the overhead of maintaining an index is not justified, such as when the dataset is small or when the performance of match operations is not critical.
  • Constructor Details

    • MinimalStoreStrategy

      public MinimalStoreStrategy(TripleSet triples)
  • Method Details

    • addToIndex

      public void addToIndex(Triple triple, int index)
      Description copied from interface: StoreStrategy
      Add a triple to the index if the cuurent strategy supports indexing.
      Specified by:
      addToIndex in interface StoreStrategy
      Parameters:
      triple - the triple to add
      index - the index of the triple in the store
    • removeFromIndex

      public void removeFromIndex(Triple triple, int index)
      Description copied from interface: StoreStrategy
      Remove a triple from the index if the current strategy supports indexing.
      Specified by:
      removeFromIndex in interface StoreStrategy
      Parameters:
      triple - the triple to remove
      index - the index of the triple in the store
    • clearIndex

      public void clearIndex()
      Description copied from interface: StoreStrategy
      Clear the index of this store if the current strategy supports indexing. This will remove all triples from the index.
      Specified by:
      clearIndex in interface StoreStrategy
    • containsMatch

      public boolean containsMatch(Triple tripleMatch, MatchPattern pattern)
      Description copied from interface: StoreStrategy
      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.
      Specified by:
      containsMatch in interface StoreStrategy
      Parameters:
      tripleMatch - the triple to match
      pattern - the pattern to match against
      Returns:
      true if there is a match, false otherwise
    • streamMatch

      public Stream<Triple> streamMatch(Triple tripleMatch, MatchPattern pattern)
      Description copied from interface: StoreStrategy
      Stream the triples that match the given triple and pattern. This is used to retrieve the triples that match a given pattern.
      Specified by:
      streamMatch in interface StoreStrategy
      Parameters:
      tripleMatch - the triple to match
      pattern - the pattern to match against
      Returns:
      a stream of triples that match the given pattern
    • findMatch

      public ExtendedIterator<Triple> findMatch(Triple tripleMatch, MatchPattern pattern)
      Description copied from interface: StoreStrategy
      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.
      Specified by:
      findMatch in interface StoreStrategy
      Parameters:
      tripleMatch - the triple to match
      pattern - the pattern to match against
      Returns:
      an iterator over the triples that match the given pattern