Neo4j is a native graph database built on a property graph model where nodes, relationships, properties, and labels form the foundation of data representation. Unlike relational databases that rely on joins, Neo4j uses index-free adjacency where each node directly references its connected relationships, enabling constant-time traversals regardless of database size. Cypher®, Neo4j's declarative query language, combines SQL-like familiarity with ASCII-art pattern syntax to express graph patterns intuitively—making complex multi-hop queries readable and performant through pattern matching. Understanding Cypher's clause composition model (where clauses chain together like Unix pipes) is essential: each clause transforms the working set of data and passes it forward, allowing you to build sophisticated queries from simple building blocks.
What This Cheat Sheet Covers
This topic spans 16 focused tables and 134 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Graph Data Model Fundamentals
| Concept | Example | Description |
|---|---|---|
(n:Person {name: "Alice"}) | Represents an entity in the graph with optional labels and properties; nodes are enclosed in parentheses. | |
-[:KNOWS {since: 2020}]-> | Connects two nodes with a single type and optional properties; always has a direction but can be traversed bidirectionally. | |
(n:Person:Employee) | Categorizes nodes for grouping and indexing; nodes can have multiple labels separated by colons. | |
{name: "Alice", age: 30} | Key-value pair stored on nodes or relationships; supports primitive types, lists, and temporal/spatial values. |