apache age MATCH

apache

In Apache AGE (Approximate Graph Engine), the MATCH clause is used to specify a pattern of nodes and edges that should be searched for in the graph. It is similar to the MATCH clause in Cypher, the query language used by Neo4j.

Here is an example of how you might use the MATCH clause in an AGE query:

MATCH (n1:Person)-[:FRIEND]->(n2:Person)
WHERE n1.name = 'Alice' AND n2.name = 'Bob'
RETURN n1, n2

In this example, the MATCH clause specifies a pattern of two nodes labeled Person, connected by an edge labeled FRIEND. The WHERE clause then filters the results to only include nodes with the names Alice and Bob. The RETURN clause specifies that the resulting nodes should be returned.

The MATCH clause is typically used in conjunction with other clauses, such as WHERE and RETURN, to specify more complex queries. It is an important part of the AGE query language, and is used to specify the patterns of nodes and edges that should be searched for in the graph.