Retrieving graph data
Having explored how to manage graphs and graph types, this section will teach you how to retrieve data from a graph using GQL. The MATCH
statement is central to querying the graph, enabling you to search for nodes, edges, paths, or subgraphs based on specific patterns.
The MATCH
statement will be explored in two parts in this book. This section will cover the fundamental aspects of the MATCH
statement, while an advanced discussion will be presented in Chapter 07, Delve into Advanced Clauses. This approach allows for a gradual and comprehensive understanding of the MATCH
statement’s capabilities within GQL.
The syntax of the MATCH
statement is as follows:
[OPTIONAL] MATCH <match mode> <path pattern list>
[OPTIONAL]
: This keyword enables theMATCH
statement to assign null values to results (binding variables) if no match is found, allowing the query to continue executing without interruption.<match...