Enum Class IndexingStrategy

java.lang.Object
java.lang.Enum<IndexingStrategy>
org.apache.jena.mem.IndexingStrategy
All Implemented Interfaces:
Serializable, Comparable<IndexingStrategy>, Constable

public enum IndexingStrategy extends Enum<IndexingStrategy>
Indexing strategies supported by IndexedSetTripleStore and RoaringTripleStore. The indexing strategy determines how (and when) the auxiliary subject/predicate/object index is maintained for pattern-matching operations.

The graph always keeps a flat set of triples. Operations that do not involve pattern matching (size, iterating all triples, lookup of a fully concrete triple, etc.) are evaluated directly against this set and are unaffected by the indexing strategy.

Pattern matching refers to Graph.find(org.apache.jena.graph.Triple), Graph.remove(org.apache.jena.graph.Node, org.apache.jena.graph.Node, org.apache.jena.graph.Node) or Graph.contains(org.apache.jena.graph.Node, org.apache.jena.graph.Node, org.apache.jena.graph.Node) called with a triple pattern such as S__, SP_, S_O, _P_, _PO or __O (where _ denotes a wildcard). Lookups for fully concrete triples (SPO) are always answered directly from the triple set and never use the index.

  • Enum Constant Details

    • EAGER

      public static final IndexingStrategy EAGER
      The index is always present. Graph.add(org.apache.jena.graph.Triple), Graph.delete(org.apache.jena.graph.Triple) and Graph.clear() update the index immediately. Calling clearIndex simply discards the existing index, which is then rebuilt from the triple set.
    • LAZY

      public static final IndexingStrategy LAZY
      The index is built on demand the first time a pattern match is requested. Once built, behaves like EAGER. Calling clearIndex discards the index; it will be rebuilt on demand the next time a pattern match is performed.
    • LAZY_PARALLEL

      public static final IndexingStrategy LAZY_PARALLEL
      Like LAZY, but the on-demand index build uses parallel processing for faster initialization on large graphs.
    • MANUAL

      public static final IndexingStrategy MANUAL
      The index is never built automatically. Pattern-match operations throw an UnsupportedOperationException until the index is initialized explicitly (e.g. via GraphMemIndexedSet.initializeIndex()). After initialization, behaves like EAGER.
    • MINIMAL

      public static final IndexingStrategy MINIMAL
      No index is built. Pattern-match operations are evaluated by linearly filtering the triple set, which is space-efficient but slower for large graphs. The index can be initialized explicitly to switch to eager behavior; calling clearIndex reverts to filtering again.
  • Method Details

    • values

      public static IndexingStrategy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static IndexingStrategy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null