Class Neo4jPatternExpander
java.lang.Object
org.evomaster.client.java.controller.neo4j.heuristics.Neo4jPatternExpander
Flattens a
MatchPattern into one with no variable-length relationships and no quantified
path patterns (QPPs), so the rest of the calculator only ever deals with plain nodes and edges.
Two independent expansions run in sequence, each to the construct's lower bound L (if the
lower bound is satisfied the query succeeds, so the upper bound is irrelevant):
expandQuantifiedPaths(org.evomaster.client.java.controller.neo4j.operations.MatchPattern, java.util.List<org.evomaster.client.java.controller.neo4j.conditions.CypherCondition>): every QPP (((a)-[]->(b)){1,3}) is replaced byLclones of its sub-pattern, chained end to end and spliced onto the outer nodes it sits between (seeQuantifiedPathPattern.getEntryVariable()/QuantifiedPathPattern.getExitVariable()). Runs first so its output — plain nodes/edges, some possibly still variable-length — feeds the next step.- The pre-existing variable-length-edge expansion (
*,+,*n..m): a lower boundL ≥ 2becomes a chain ofLcloned edges withL-1fresh intermediate nodes inheriting both endpoints' labels/properties;L == 1is a single ordinary edge;L == 0merges the two endpoints (a zero-length path identifies them) and drops the edge. This also expands variable-length edges that were themselves inside a QPP's sub-pattern, since step 1 clones them unchanged (min/max preserved) into the flat edge list.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Neo4jPatternExpander
public Neo4jPatternExpander()
-
-
Method Details
-
expand
-