Interface Traversal<T>

Type Parameters:
T - Final collected return type
All Known Implementing Classes:
DefaultTraversal

public interface Traversal<T>
Fluent Kleisli Frontier Traversal Pipeline.

Represents monadic frontier propagation <Domain, State> -> <Domain', State'>.

  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    Returns the name of the currently active node domain in this traversal pipeline.
    default Traversal<T>
    both(String relation)
    Traverses edges in both outgoing (CSR) and incoming (CSC) directions along the given relation.
    default Traversal<T>
    both(String... relations)
    Traverses both outgoing and incoming edges across the union of all given relations.
    Terminal step: executes the pipeline and collects into type T.
    long
    Terminal step: returns total cardinality of surviving target nodes.
    default Traversal<T>
    Set difference (this \ branch) with another traversal pipeline ending in the same domain.
    filter(String celPredicate)
    Filters active frontier nodes via CEL predicate expression.
    default Traversal<T>
    fixpointOut(String relation, int maxHops)
    Monotone transitive closure F_{t+1} = F_t U out(relation)(F_t) up to maxHops iterations, including F_0.
    in(String relation)
    Traverses incoming edges along the given relation (via CSC), defaulting to OR reduction.
    default Traversal<T>
    in(String... relations)
    Traverses incoming edges across the union of all given relations.
    default Traversal<T>
    in(String relation, String edgePredicate)
    Traverses incoming edges along the given relation, filtering edges via a CEL predicate.
    in(String relation, Reducer reducer)
    Traverses incoming edges along the given relation, reducing converging paths via the given monoid.
    default Traversal<T>
    Set intersection with another traversal pipeline ending in the same domain.
    default Traversal<T>
    inWhere(String relation, String edgeCelPredicate)
    Reverse edge-filtered traversal keeping only edges satisfying the given CEL edge predicate.
    max(String attrOrCelExpr)
    Scalar maximum reduction over attrOrCelExpr across active nodes in the final domain, skipping NULL values.
    min(String attrOrCelExpr)
    Scalar minimum reduction over attrOrCelExpr across active nodes in the final domain, skipping NULL values.
    out(String relation)
    Traverses outgoing edges along the given relation, defaulting to OR reduction.
    default Traversal<T>
    out(String... relations)
    Traverses outgoing edges across the union of all given relations.
    default Traversal<T>
    out(String relation, String edgePredicate)
    Traverses outgoing edges along the given relation, filtering edges via a CEL predicate (e.g.
    out(String relation, Reducer reducer)
    Traverses outgoing edges along the given relation, reducing converging paths via the given monoid.
    default Traversal<T>
    outWhere(String relation, String edgeCelPredicate)
    Forward edge-filtered traversal keeping only edges satisfying the given CEL edge predicate.
    outWithState(String relation, String stateProjections)
    Traverses outgoing edges, applying state projections and reducers to converging paths.
    default Traversal<T>
    outWithState(String relation, String edgePredicate, String stateProjections)
    Traverses outgoing edges, applying a filter and state projections.
    project(String projectionExpr)
    Projects or mutates attached state vector values on active nodes.
    default Traversal<T>
    repeat(int iterations, String relation)
    Repeats outgoing edge walk across relation up to iterations times.
    default Traversal<T>
    repeat(int iterations, String relation, String edgePredicate)
    Repeats filtered outgoing edge walk across relation up to iterations times.
    Repeats step exactly n times.
    default Traversal<T>
    repeatOut(String relation, int hops)
    Exact hops-step forward composition along relation without intermediate union accumulation.
    default Traversal<T>
    Fixed-point loop: repeats outgoing edge walk across relation until the frontier set converges (Frontier_{t+1} == Frontier_t).
    default Traversal<T>
    repeatUntilStable(String relation, String edgePredicate)
    Fixed-point loop: repeats filtered outgoing edge walk across relation until the frontier set converges (Frontier_{t+1} == Frontier_t).
    Fixed-point loop: repeats step until frontier set converges (Frontier_{t+1} == Frontier_t).
    default Traversal<T>
    rerank(float[] queryVector)
    Reranks the active frontier using dot-product similarity against the default embedding attribute.
    default Traversal<T>
    rerank(float[] queryVector, String attrName, int metric)
    Reranks the active frontier using exact SIMD vector similarity (`0xCB` `OP_VECTOR_RERANK_DOT`).
    default double
    sum(String attrOrCelExpr)
    Scalar sum reduction over attrOrCelExpr across active nodes in the final domain, skipping NULL values (returns 0.0 when empty).
    Terminal step: returns target frontier as a zero-copy off-heap ImpulseBitSet.
    Disassembles the traversal pipeline into human-readable ImpAsm bytecode assembly.
    Terminal step: returns target frontier nodes resolved to external business key strings in the active domain.
    Terminal step: returns target frontier nodes resolved to unique external business key strings in the active domain.
    Terminal step: returns target dense IDs as a List of Longs.
    default List<ScoredNode>
    topK(int k)
    Terminal step: returns the top-K highest-scoring nodes from a reranked frontier (or first K active nodes if unreranked).
    default List<ScoredKey>
    topKKeys(int k)
    Terminal step: returns the top-K highest-scoring nodes resolved to external business keys.
    Terminal step: returns target dense IDs as a Set of Longs.
    default Traversal<T>
    Set union with another traversal pipeline ending in the same domain.
    default Traversal<T>
    withParam(String key, int[] value)
    Binds a named dynamic parameter array (primitive 32-bit node IDs) for CEL expressions.
    default Traversal<T>
    withParam(String key, long[] value)
    Binds a named dynamic parameter array (primitive 64-bit node IDs) for CEL expressions.
    withParam(String key, Object value)
    Binds a named dynamic parameter for CEL filter expressions.
    default Traversal<T>
    withParam(String key, List<String> value)
    Binds a named dynamic parameter list of strings for CEL expressions.
  • Method Details

    • filter

      Traversal<T> filter(String celPredicate)
      Filters active frontier nodes via CEL predicate expression.
    • project

      Traversal<T> project(String projectionExpr)
      Projects or mutates attached state vector values on active nodes.
    • out

      Traversal<T> out(String relation)
      Traverses outgoing edges along the given relation, defaulting to OR reduction.
    • out

      default Traversal<T> out(String relation, String edgePredicate)
      Traverses outgoing edges along the given relation, filtering edges via a CEL predicate (e.g. "edge.timestamp >= 1700000000").
    • out

      Traversal<T> out(String relation, Reducer reducer)
      Traverses outgoing edges along the given relation, reducing converging paths via the given monoid.
    • outWithState

      Traversal<T> outWithState(String relation, String stateProjections)
      Traverses outgoing edges, applying state projections and reducers to converging paths.
    • outWithState

      default Traversal<T> outWithState(String relation, String edgePredicate, String stateProjections)
      Traverses outgoing edges, applying a filter and state projections.
    • in

      Traversal<T> in(String relation)
      Traverses incoming edges along the given relation (via CSC), defaulting to OR reduction.
    • in

      default Traversal<T> in(String relation, String edgePredicate)
      Traverses incoming edges along the given relation, filtering edges via a CEL predicate.
    • in

      Traversal<T> in(String relation, Reducer reducer)
      Traverses incoming edges along the given relation, reducing converging paths via the given monoid.
    • both

      default Traversal<T> both(String relation)
      Traverses edges in both outgoing (CSR) and incoming (CSC) directions along the given relation.
    • out

      default Traversal<T> out(String... relations)
      Traverses outgoing edges across the union of all given relations.
    • in

      default Traversal<T> in(String... relations)
      Traverses incoming edges across the union of all given relations.
    • both

      default Traversal<T> both(String... relations)
      Traverses both outgoing and incoming edges across the union of all given relations.
    • rerank

      default Traversal<T> rerank(float[] queryVector, String attrName, int metric)
      Reranks the active frontier using exact SIMD vector similarity (`0xCB` `OP_VECTOR_RERANK_DOT`).
    • rerank

      default Traversal<T> rerank(float[] queryVector)
      Reranks the active frontier using dot-product similarity against the default embedding attribute.
    • topK

      default List<ScoredNode> topK(int k)
      Terminal step: returns the top-K highest-scoring nodes from a reranked frontier (or first K active nodes if unreranked).
    • topKKeys

      default List<ScoredKey> topKKeys(int k)
      Terminal step: returns the top-K highest-scoring nodes resolved to external business keys.
    • withParam

      Traversal<T> withParam(String key, Object value)
      Binds a named dynamic parameter for CEL filter expressions.
    • withParam

      default Traversal<T> withParam(String key, long[] value)
      Binds a named dynamic parameter array (primitive 64-bit node IDs) for CEL expressions.
    • withParam

      default Traversal<T> withParam(String key, int[] value)
      Binds a named dynamic parameter array (primitive 32-bit node IDs) for CEL expressions.
    • withParam

      default Traversal<T> withParam(String key, List<String> value)
      Binds a named dynamic parameter list of strings for CEL expressions.
    • repeatUntilStable

      default Traversal<T> repeatUntilStable(String relation)
      Fixed-point loop: repeats outgoing edge walk across relation until the frontier set converges (Frontier_{t+1} == Frontier_t).
    • repeatUntilStable

      default Traversal<T> repeatUntilStable(String relation, String edgePredicate)
      Fixed-point loop: repeats filtered outgoing edge walk across relation until the frontier set converges (Frontier_{t+1} == Frontier_t).
    • repeatUntilStable

      Fixed-point loop: repeats step until frontier set converges (Frontier_{t+1} == Frontier_t).
    • repeat

      default Traversal<T> repeat(int iterations, String relation)
      Repeats outgoing edge walk across relation up to iterations times.
    • repeat

      default Traversal<T> repeat(int iterations, String relation, String edgePredicate)
      Repeats filtered outgoing edge walk across relation up to iterations times.
    • repeat

      Traversal<T> repeat(int iterations, Function<Traversal<ImpulseBitSet>, Traversal<ImpulseBitSet>> step)
      Repeats step exactly n times.
    • collect

      T collect()
      Terminal step: executes the pipeline and collects into type T.
    • count

      long count()
      Terminal step: returns total cardinality of surviving target nodes.
    • toList

      List<Long> toList()
      Terminal step: returns target dense IDs as a List of Longs.
    • toSet

      Set<Long> toSet()
      Terminal step: returns target dense IDs as a Set of Longs.
    • toKeyList

      List<String> toKeyList()
      Terminal step: returns target frontier nodes resolved to external business key strings in the active domain.
    • toKeySet

      Set<String> toKeySet()
      Terminal step: returns target frontier nodes resolved to unique external business key strings in the active domain.
    • toBitSet

      ImpulseBitSet toBitSet()
      Terminal step: returns target frontier as a zero-copy off-heap ImpulseBitSet.
    • activeDomain

      default String activeDomain()
      Returns the name of the currently active node domain in this traversal pipeline.
    • outWhere

      default Traversal<T> outWhere(String relation, String edgeCelPredicate)
      Forward edge-filtered traversal keeping only edges satisfying the given CEL edge predicate.
    • inWhere

      default Traversal<T> inWhere(String relation, String edgeCelPredicate)
      Reverse edge-filtered traversal keeping only edges satisfying the given CEL edge predicate.
    • repeatOut

      default Traversal<T> repeatOut(String relation, int hops)
      Exact hops-step forward composition along relation without intermediate union accumulation.
    • fixpointOut

      default Traversal<T> fixpointOut(String relation, int maxHops)
      Monotone transitive closure F_{t+1} = F_t U out(relation)(F_t) up to maxHops iterations, including F_0.
    • union

      default Traversal<T> union(Traversal<ImpulseBitSet> branch)
      Set union with another traversal pipeline ending in the same domain.
    • intersect

      default Traversal<T> intersect(Traversal<ImpulseBitSet> branch)
      Set intersection with another traversal pipeline ending in the same domain.
    • difference

      default Traversal<T> difference(Traversal<ImpulseBitSet> branch)
      Set difference (this \ branch) with another traversal pipeline ending in the same domain.
    • sum

      default double sum(String attrOrCelExpr)
      Scalar sum reduction over attrOrCelExpr across active nodes in the final domain, skipping NULL values (returns 0.0 when empty).
    • min

      default OptionalDouble min(String attrOrCelExpr)
      Scalar minimum reduction over attrOrCelExpr across active nodes in the final domain, skipping NULL values.
    • max

      default OptionalDouble max(String attrOrCelExpr)
      Scalar maximum reduction over attrOrCelExpr across active nodes in the final domain, skipping NULL values.
    • toImpAsm

      String toImpAsm()
      Disassembles the traversal pipeline into human-readable ImpAsm bytecode assembly.