Cypher is a declarative query language for finding and manipulating graph data. A natural-language question can be translated into Cypher, then executed by a graph database such as Neo4j. section 5.1 section 5.4.3
Simple Cypher queries combine two core operations:
- MATCH describes a node-and-relationship pattern to find and assigns matched elements to variables. section 5.4.3
- RETURN specifies the properties or calculated values produced from the matched pattern. section 5.4.3
- Patterns can constrain node labels, properties, relationship types, and relationship direction. section 5.4.3
Finding movies starring Tom Cruise
MATCH (p:Person {name: 'Tom Cruise'})-[:ACTED_IN]->(m:Movie) RETURN m.title The pattern finds a Person with the specified name, follows an ACTED_IN relationship to a Movie, and returns each movie title. Replacing the returned title with count(*) counts the matching movies. section 5.4.3
A language model needs the natural-language question, the target language, and the database structure—such as node labels, relationship types, and property keys—to generate a useful Cypher query. Generated queries still require checking because translation is not guaranteed to be correct. section 5.1 section 5.4.4
Figure 5.1 A natural language query interface translates questions in natural language into formal queries, taking into account the data structure. Formal queries are then processed on data by a specia- lized tool, generating a query result.
Follow the workflow from a natural-language question to a structure-aware Cypher query and then to a specialized query result. section 5.1



