Interface MatchClause

All Superinterfaces:
CypherExpression
All Known Implementing Classes:
EdgeMatchClause, NodeMatchClause, PathMatchClause

public interface MatchClause extends CypherExpression
Represents path matching statements of Cypher queries For example, MATCH (x), MATCH (x)-[e]->(y)
  • Method Summary

    Modifier and Type
    Method
    Description
    Obtains the set of variables defined in the pattern
    boolean
    Checks if two match statements are redundant.

    Methods inherited from interface se.liu.ida.hefquin.engine.wrappers.lpg.query.CypherExpression

    visit
  • Method Details

    • isRedundantWith

      boolean isRedundantWith(MatchClause match)
      Checks if two match statements are redundant. This can happen if they are exactly the same pattern, or if one is a node pattern and the other a path pattern that contains it. For instance, MATCH (x) is redundant with MATCH (x)-[y]->(z), MATCH (x), and MATCH (v)-[w]->(x). Note that this is not symmetric.
      Parameters:
      match - the other match clause to test
      Returns:
      true if the clauses are redundant, i.e., if both patterns share nodes
    • getVars

      Set<CypherVar> getVars()
      Obtains the set of variables defined in the pattern
      Specified by:
      getVars in interface CypherExpression
      Returns:
      a set of CypherVar with the variables defined in the pattern For example, the object that represents the pattern MATCH (x)-[e]->(y) returns the set {x, e, y}.