Class DefaultTraversal<T>

java.lang.Object
org.impulsegraph.vm.traversal.DefaultTraversal<T>
All Implemented Interfaces:
Traversal<T>

public class DefaultTraversal<T> extends Object implements Traversal<T>
High-performance Kleisli Frontier Traversal Pipeline implementation.
  • Constructor Details

  • Method Details

    • activeDomain

      public String activeDomain()
      Description copied from interface: Traversal
      Returns the name of the currently active node domain in this traversal pipeline.
      Specified by:
      activeDomain in interface Traversal<T>
    • filter

      public Traversal<T> filter(String celPredicate)
      Description copied from interface: Traversal
      Filters active frontier nodes via CEL predicate expression.
      Specified by:
      filter in interface Traversal<T>
    • project

      public Traversal<T> project(String projectionExpr)
      Description copied from interface: Traversal
      Projects or mutates attached state vector values on active nodes.
      Specified by:
      project in interface Traversal<T>
    • out

      public Traversal<T> out(String relation)
      Description copied from interface: Traversal
      Traverses outgoing edges along the given relation, defaulting to OR reduction.
      Specified by:
      out in interface Traversal<T>
    • out

      public Traversal<T> out(String relation, String secondRelationOrEdgePredicate)
      Description copied from interface: Traversal
      Traverses outgoing edges along the given relation, filtering edges via a CEL predicate (e.g. "edge.timestamp >= 1700000000").
      Specified by:
      out in interface Traversal<T>
    • out

      public Traversal<T> out(String relation, Reducer reducer)
      Description copied from interface: Traversal
      Traverses outgoing edges along the given relation, reducing converging paths via the given monoid.
      Specified by:
      out in interface Traversal<T>
    • out

      public Traversal<T> out(String... relations)
      Description copied from interface: Traversal
      Traverses outgoing edges across the union of all given relations.
      Specified by:
      out in interface Traversal<T>
    • outWhere

      public Traversal<T> outWhere(String relation, String edgeCelPredicate)
      Description copied from interface: Traversal
      Forward edge-filtered traversal keeping only edges satisfying the given CEL edge predicate.
      Specified by:
      outWhere in interface Traversal<T>
    • outWithState

      public Traversal<T> outWithState(String relation, String stateProjections)
      Description copied from interface: Traversal
      Traverses outgoing edges, applying state projections and reducers to converging paths.
      Specified by:
      outWithState in interface Traversal<T>
    • in

      public Traversal<T> in(String relation)
      Description copied from interface: Traversal
      Traverses incoming edges along the given relation (via CSC), defaulting to OR reduction.
      Specified by:
      in in interface Traversal<T>
    • in

      public Traversal<T> in(String relation, String secondRelationOrEdgePredicate)
      Description copied from interface: Traversal
      Traverses incoming edges along the given relation, filtering edges via a CEL predicate.
      Specified by:
      in in interface Traversal<T>
    • in

      public Traversal<T> in(String relation, Reducer reducer)
      Description copied from interface: Traversal
      Traverses incoming edges along the given relation, reducing converging paths via the given monoid.
      Specified by:
      in in interface Traversal<T>
    • in

      public Traversal<T> in(String... relations)
      Description copied from interface: Traversal
      Traverses incoming edges across the union of all given relations.
      Specified by:
      in in interface Traversal<T>
    • inWhere

      public Traversal<T> inWhere(String relation, String edgeCelPredicate)
      Description copied from interface: Traversal
      Reverse edge-filtered traversal keeping only edges satisfying the given CEL edge predicate.
      Specified by:
      inWhere in interface Traversal<T>
    • both

      public Traversal<T> both(String relation)
      Description copied from interface: Traversal
      Traverses edges in both outgoing (CSR) and incoming (CSC) directions along the given relation.
      Specified by:
      both in interface Traversal<T>
    • both

      public Traversal<T> both(String... relations)
      Description copied from interface: Traversal
      Traverses both outgoing and incoming edges across the union of all given relations.
      Specified by:
      both in interface Traversal<T>
    • repeatOut

      public Traversal<T> repeatOut(String relation, int hops)
      Description copied from interface: Traversal
      Exact hops-step forward composition along relation without intermediate union accumulation.
      Specified by:
      repeatOut in interface Traversal<T>
    • fixpointOut

      public Traversal<T> fixpointOut(String relation, int maxHops)
      Description copied from interface: Traversal
      Monotone transitive closure F_{t+1} = F_t U out(relation)(F_t) up to maxHops iterations, including F_0.
      Specified by:
      fixpointOut in interface Traversal<T>
    • union

      public Traversal<T> union(Traversal<ImpulseBitSet> branch)
      Description copied from interface: Traversal
      Set union with another traversal pipeline ending in the same domain.
      Specified by:
      union in interface Traversal<T>
    • intersect

      public Traversal<T> intersect(Traversal<ImpulseBitSet> branch)
      Description copied from interface: Traversal
      Set intersection with another traversal pipeline ending in the same domain.
      Specified by:
      intersect in interface Traversal<T>
    • difference

      public Traversal<T> difference(Traversal<ImpulseBitSet> branch)
      Description copied from interface: Traversal
      Set difference (this \ branch) with another traversal pipeline ending in the same domain.
      Specified by:
      difference in interface Traversal<T>
    • sum

      public double sum(String attrOrExpr)
      Description copied from interface: Traversal
      Scalar sum reduction over attrOrCelExpr across active nodes in the final domain, skipping NULL values (returns 0.0 when empty).
      Specified by:
      sum in interface Traversal<T>
    • min

      public OptionalDouble min(String attrOrExpr)
      Description copied from interface: Traversal
      Scalar minimum reduction over attrOrCelExpr across active nodes in the final domain, skipping NULL values.
      Specified by:
      min in interface Traversal<T>
    • max

      public OptionalDouble max(String attrOrExpr)
      Description copied from interface: Traversal
      Scalar maximum reduction over attrOrCelExpr across active nodes in the final domain, skipping NULL values.
      Specified by:
      max in interface Traversal<T>
    • rerank

      public Traversal<T> rerank(float[] queryVector, String attrName, int metric)
      Description copied from interface: Traversal
      Reranks the active frontier using exact SIMD vector similarity (`0xCB` `OP_VECTOR_RERANK_DOT`).
      Specified by:
      rerank in interface Traversal<T>
    • topK

      public List<ScoredNode> topK(int k)
      Description copied from interface: Traversal
      Terminal step: returns the top-K highest-scoring nodes from a reranked frontier (or first K active nodes if unreranked).
      Specified by:
      topK in interface Traversal<T>
    • topKKeys

      public List<ScoredKey> topKKeys(int k)
      Description copied from interface: Traversal
      Terminal step: returns the top-K highest-scoring nodes resolved to external business keys.
      Specified by:
      topKKeys in interface Traversal<T>
    • withParam

      public Traversal<T> withParam(String key, Object value)
      Description copied from interface: Traversal
      Binds a named dynamic parameter for CEL filter expressions.
      Specified by:
      withParam in interface Traversal<T>
    • repeatUntilStable

      public Traversal<T> repeatUntilStable(Function<Traversal<ImpulseBitSet>, Traversal<ImpulseBitSet>> step)
      Description copied from interface: Traversal
      Fixed-point loop: repeats step until frontier set converges (Frontier_{t+1} == Frontier_t).
      Specified by:
      repeatUntilStable in interface Traversal<T>
    • repeat

      public Traversal<T> repeat(int iterations, Function<Traversal<ImpulseBitSet>, Traversal<ImpulseBitSet>> step)
      Description copied from interface: Traversal
      Repeats step exactly n times.
      Specified by:
      repeat in interface Traversal<T>
    • collect

      public T collect()
      Description copied from interface: Traversal
      Terminal step: executes the pipeline and collects into type T.
      Specified by:
      collect in interface Traversal<T>
    • count

      public long count()
      Description copied from interface: Traversal
      Terminal step: returns total cardinality of surviving target nodes.
      Specified by:
      count in interface Traversal<T>
    • toList

      public List<Long> toList()
      Description copied from interface: Traversal
      Terminal step: returns target dense IDs as a List of Longs.
      Specified by:
      toList in interface Traversal<T>
    • toSet

      public Set<Long> toSet()
      Description copied from interface: Traversal
      Terminal step: returns target dense IDs as a Set of Longs.
      Specified by:
      toSet in interface Traversal<T>
    • toKeyList

      public List<String> toKeyList()
      Description copied from interface: Traversal
      Terminal step: returns target frontier nodes resolved to external business key strings in the active domain.
      Specified by:
      toKeyList in interface Traversal<T>
    • toKeySet

      public Set<String> toKeySet()
      Description copied from interface: Traversal
      Terminal step: returns target frontier nodes resolved to unique external business key strings in the active domain.
      Specified by:
      toKeySet in interface Traversal<T>
    • toBitSet

      public ImpulseBitSet toBitSet()
      Description copied from interface: Traversal
      Terminal step: returns target frontier as a zero-copy off-heap ImpulseBitSet.
      Specified by:
      toBitSet in interface Traversal<T>
    • toImpAsm

      public String toImpAsm()
      Description copied from interface: Traversal
      Disassembles the traversal pipeline into human-readable ImpAsm bytecode assembly.
      Specified by:
      toImpAsm in interface Traversal<T>