Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Data Model

patinaDB stores a labelled property graph.

Vertices (nodes)

A vertex has:

  • A stable UUID identity (assigned on creation, baked into the engram log so replays are deterministic).
  • A primary label plus zero or more secondary labels (multi-label nodes are supported; labels(n) returns all of them).
  • A set of properties — string keys mapped to typed values.
CREATE (a:Person:Employee {name: 'Ada', born: 1815})

Edges (relationships)

An edge is directed, has exactly one type (a label), connects two vertices, and may carry its own properties:

CREATE (a)-[:KNEW {since: 1833}]->(b)

Edges can be traversed in either direction, and patterns may be left-to-right, right-to-left, or undirected (-[:KNEW]-), in which case both directions are searched.

Property value types

The AttributeValue type covers:

TypeExample literalNotes
String'hello'Order-preserving in the value index.
Integer4264-bit signed.
Float3.14, 1.0e9, .564-bit IEEE-754.
Booleantrue, falseFirst-class (AttributeValue::Bool).
NullnullDrives three-valued logic (see below).
List[1, 2, 3]Heterogeneous; indexable, sliceable.
Map{a: 1, b: 'x'}Nested.
Temporaldate('2026-06-28'), datetime(...)Date / Time / LocalTime / DateTime / LocalDateTime / Duration.
Pathresult of a path patternSequence of nodes and edges.

Three-valued (Kleene) logic

Comparisons and boolean operators follow SQL-style three-valued logic. Any comparison involving null yields Unknown, not true or false:

RETURN 1 = null        // null (Unknown)
RETURN null AND false  // false  (false dominates)
RETURN null OR true    // true   (true dominates)

IS NULL / IS NOT NULL remain strictly two-valued, by specification. In a WHERE filter, Unknown collapses to “not matched”.

Storage internals (informational)

Properties are kept in a label-scoped, order-preserving value index, so a scan over :Person.born never returns :Robot nodes with the same value, and sorted pagination over a property is O(limit) rather than a full scan. Compound indexes over several fields accelerate equality-prefix + sort queries. You normally don’t manage these directly — they are maintained automatically on writes. To declare your own indexes and enforce data integrity, see Constraints and Query Planning; Limitations lists the current DDL gaps.