In GQL, Graph Pattern Matching (GPM) is the fundamental operation used to query graph databases. GPM is the process of declaratively searching for nodes, edges, and paths within a graph that conform to a specified structural pattern.
The matching operation is performed using the MATCH statement. This statement instructs the database engine to traverse the graph and retrieve all instances of the data structure defined by your pattern.
A graph pattern is an assembly of smaller components. A graph pattern is a list of one or more path patterns, and a path pattern is built from individual node and edge patterns.
You may follow the sequence below to learn how to write graph patterns in GQL: