Cypher

Summary: A declarative query language for the property graph model, created for the Neo4j graph database.

Sources: raw/chapter2

Last updated: 2026-04-15


Cypher uses an arrow notation to represent relationships between vertices in a graph (source: chapter2, p. 52).

Example Syntax

MATCH (person) -[:BORN_IN]-> () -[:WITHIN*0..]-> (us:Location {name:'United States'}),
      (person) -[:LIVES_IN]-> () -[:WITHIN*0..]-> (eu:Location {name:'Europe'})
RETURN person.name

The :WITHIN*0.. syntax concisely expresses a variable-length traversal path, following a relationship zero or more times (source: chapter2, p. 54).