Graph Reference

Cinch graph databases use Ladybug (a fork of Kuzu), which speaks a Cypher dialect that is mostly compatible with Neo4j but has important differences. Standard Neo4j drivers work out of the box over Bolt.

Schema-first: the biggest difference

Neo4j lets you create nodes on the fly without declaring a schema. Cinch requires you to define node and relationship tables before inserting data. Every node table must have a PRIMARY KEY column.

-- Define node tables
CREATE NODE TABLE Person(name STRING PRIMARY KEY, age INT64)
CREATE NODE TABLE City(name STRING PRIMARY KEY, population INT64)

-- Define relationship tables (must specify FROM and TO)
CREATE REL TABLE KNOWS(FROM Person TO Person, since INT64)
CREATE REL TABLE LIVES_IN(FROM Person TO City)

-- Now you can insert data
CREATE (a:Person {name: 'Alice', age: 30})
CREATE (b:Person {name: 'Bob', age: 25})

-- SERIAL for auto-incrementing IDs
CREATE NODE TABLE Event(id SERIAL PRIMARY KEY, title STRING, date DATE)

IF NOT EXISTS

Use CREATE NODE TABLE IF NOT EXISTS to make schema setup idempotent. Safe to run on every connection.

Differences from Neo4j

FeatureNeo4jCinch (Ladybug/Kuzu)
SchemaSchema-free. Create nodes on the fly.Schema-first. CREATE NODE TABLE / CREATE REL TABLE before inserting.
Primary keysOptional. Internal IDs used by default.Required. Every node table needs a PRIMARY KEY column.
Multiple labelsNodes can have multiple labels.Nodes have exactly one label (their table name).
Relationship tablesRelationships created inline.Must declare with CREATE REL TABLE(FROM X TO Y).
REMOVE clauseREMOVE n.propNot supported. Use SET n.prop = NULL instead.
WHERE in patternsMATCH (n:Person WHERE n.name = 'Alice')Not supported. Use MATCH (n:Person) WHERE n.name = 'Alice'
Label in WHEREWHERE n:PersonNot supported. Use MATCH (n:Person) or WHERE label(n) = 'Person'
Variable-length pathsTrail semantics (no repeated edges)Walk semantics by default (allows repeated edges). Use TRAIL modifier for Neo4j behavior.
Type systemFlexible lists and mapsStricter: LIST elements must be same type, MAP keys must be same type.

Variable-length paths

By default, variable-length path queries use walk semantics, which allows repeated nodes and edges. This differs from Neo4j's default trail semantics. Use the TRAIL or ACYCLIC modifiers to change this:

-- Default: walk semantics (allows repeated edges)
MATCH (a:Person)-[e:KNOWS*1..4]->(b:Person) RETURN a.name, b.name

-- Trail: no repeated edges (Neo4j default behavior)
MATCH (a:Person)-[e:KNOWS* TRAIL 1..4]->(b:Person) RETURN a.name, b.name

-- Acyclic: no repeated nodes
MATCH (a:Person)-[e:KNOWS* ACYCLIC 1..4]->(b:Person) RETURN a.name, b.name

-- Shortest path
MATCH (a:Person)-[e:KNOWS* SHORTEST 1..10]->(b:Person) RETURN a.name, b.name

Supported Cypher

  • Schema: CREATE NODE TABLE, CREATE REL TABLE, DROP TABLE, ALTER TABLE
  • Node operations: CREATE, MERGE, MATCH, DELETE, DETACH DELETE, SET
  • Relationship operations: CREATE, MATCH, DELETE with typed and directional relationships
  • Pattern matching: variable-length paths, shortest path, path expressions
  • Clauses: WITH, UNWIND, OPTIONAL MATCH, UNION, CALL
  • Aggregations: COUNT, SUM, AVG, MIN, MAX, COLLECT
  • Filtering: WHERE, AND, OR, NOT, IN, STARTS WITH, CONTAINS, regular expressions
  • Ordering: ORDER BY, SKIP, LIMIT
  • Indexes: CREATE INDEX, DROP INDEX
  • Constraints: uniqueness constraints
  • Parameters: $paramName syntax
  • Transactions: BEGIN, COMMIT, ROLLBACK (via driver API)

Bolt protocol

FeatureDetails
Bolt versions4.4, 5.0 through 5.7
AuthBasic auth (username: neo4j, password: your token)
Concurrent connections256 per database
TransactionsAuto-commit and explicit (BEGIN/COMMIT/ROLLBACK)
BookmarksSupported for causal consistency

Not supported

  • APOC procedures
  • Graph Data Science (GDS) library. Use Cypher path-finding instead.
  • Multiple labels per node
  • REMOVE clause (use SET prop = NULL)
  • WHERE inside MATCH patterns
  • FINISH clause
  • USE graph (each database is a separate graph)

See Graph for connection examples.