Class QuantifiedPathPattern

java.lang.Object
org.evomaster.client.java.controller.neo4j.operations.QuantifiedPathPattern

public class QuantifiedPathPattern extends Object
A quantified path pattern (QPP), i.e. a sub-pattern repeated a number of times, such as ((a)-[:KNOWS]->(b)){1,3}.
Unlike a variable-length relationship (*1..3), which repeats a single edge, a QPP repeats an entire MatchPattern (multiple nodes and edges, and possibly nested QPPs). The repetition bounds are [min, max], where a null max means unbounded (+ or *).
The labels, relationship types, properties and inline WHERE that constrain the sub-pattern are kept in getConditions(), scoped to this QPP rather than mixed into the outer operation's list — so when the calculator expands the repetition it can clone the sub-pattern's conditions per hop.
getEntryVariable() and getExitVariable() are the outer pattern variables this QPP splices between (e.g. a and b in (a) ((x)-[]->(y)){1,3} (b)), so the calculator can bind the first/last repetition's boundary node to the surrounding pattern. Either is null when there is no outer node on that side (the QPP opens or closes the pattern). When two QPPs are directly adjacent with no node between them, the parser binds them to the same synthesized variable, so this is never null because two QPPs happen to touch.
  • Constructor Details

  • Method Details

    • getSubPattern

      public MatchPattern getSubPattern()
    • getConditions

      public List<CypherCondition> getConditions()
      Returns the conditions scoped to this sub-pattern (labels, relationship types, properties, inline WHERE), in source order. Empty when the sub-pattern is purely structural.
    • getMin

      public int getMin()
    • getMax

      public Integer getMax()
    • isUnboundedMax

      public boolean isUnboundedMax()
    • getEntryVariable

      public String getEntryVariable()
      The outer variable immediately before this QPP, or null if it opens the pattern.
    • getExitVariable

      public String getExitVariable()
      The outer variable immediately after this QPP, or null if it closes the pattern.
    • withBoundary

      public QuantifiedPathPattern withBoundary(String newEntryVariable, String newExitVariable)
      Returns a copy of this QPP with its entry/exit variables replaced.
    • toString

      public String toString()
      Overrides:
      toString in class Object