java.lang.Object
org.evomaster.client.java.controller.neo4j.heuristics.Neo4jMapping

public class Neo4jMapping extends Object
A single structural mapping m = (μ, ε) from a query pattern P_s onto a graph G: it binds each pattern node variable to a graph node (μ) and each pattern edge variable to a graph relationship (ε). Bindings are keyed by the variable name the parser assigned (a real name like n, or an anonymous _anon_node_0 / _anon_rel_0), which is shared between the PatternEdge/PatternNode and the conditions that refer to it, so condition valuation can resolve a variable to its bound graph element.
  • Constructor Details

    • Neo4jMapping

      public Neo4jMapping()
  • Method Details

    • copy

      public Neo4jMapping copy()
    • getNode

      public Neo4jNode getNode(String variable)
      The graph node bound to the given pattern variable, or null if this mapping does not bind one. A null return is a normal outcome, not an error: it is how resolveProperty tells a node variable from a relationship variable, and how a condition on an unbound variable is detected (it yields no ρ, and the aggregation skips it).

      The variable itself is never null: the parser names every pattern element, and every condition, operand and edge endpoint guards its variable name at construction. Guarding it here keeps a null name, which would be a bug, from silently looking like an unbound variable.

    • getEdge

      public Neo4jEdge getEdge(String variable)
      The graph relationship bound to the given pattern variable, or null when this mapping does not bind it. Same contract as getNode(String).
    • isNodeBound

      public boolean isNodeBound(String variable)
    • bindNode

      public void bindNode(String variable, Neo4jNode node)
    • bindEdge

      public void bindEdge(String variable, Neo4jEdge edge)
    • usesEdge

      public boolean usesEdge(Neo4jEdge edge)
      True when this graph edge is already used by some pattern edge in this mapping. Cypher enforces relationship uniqueness within a single MATCH, so the enumerator avoids reusing one.
    • toString

      public String toString()
      Overrides:
      toString in class Object