Cypher Support

GraphQLite implements a substantial subset of the Cypher query language.

Overview

Cypher is a declarative graph query language originally developed by Neo4j. GraphQLite supports the core features needed for most graph operations.

Quick Reference

FeatureSupport
Node patterns✅ Full
Relationship patterns✅ Full
Variable-length paths✅ Full
shortestPath/allShortestPaths✅ Full
Parameterized queries✅ Full
MATCH/OPTIONAL MATCH✅ Full
CREATE/MERGE✅ Full
SET/REMOVE/DELETE✅ Full
WITH/UNWIND/FOREACH✅ Full
LOAD CSV✅ Full
UNION/UNION ALL✅ Full
RETURN with modifiers✅ Full
Aggregation functions✅ Full
CASE expressions✅ Full
List comprehensions✅ Full
Pattern comprehensions✅ Full
Map projections✅ Full
Multi-graph (FROM clause)✅ Full
Graph algorithms✅ 15+ built-in
CALL procedures❌ Not supported
CREATE INDEX/CONSTRAINT❌ Use SQLite

Pattern Syntax

Nodes

(n)                           -- Any node
(n:Person)                    -- Node with label
(n:Person {name: 'Alice'})    -- Node with properties
(:Person)                     -- Anonymous node with label

Relationships

-[r]->                        -- Outgoing relationship
<-[r]-                        -- Incoming relationship
-[r]-                         -- Either direction
-[:KNOWS]->                   -- Relationship with type
-[r:KNOWS {since: 2020}]->    -- With properties

Variable-Length Paths

-[*]->                        -- Any length
-[*2]->                       -- Exactly 2 hops
-[*1..3]->                    -- 1 to 3 hops
-[:KNOWS*1..5]->              -- Typed, 1 to 5 hops

Clauses

See Clauses Reference for detailed documentation.

Functions

See Functions Reference for the complete function list.

Operators

See Operators Reference for comparison and logical operators.

Implementation Notes

GraphQLite implements standard Cypher with some differences from full implementations:

  1. No CALL procedures - Use built-in graph algorithm functions instead (e.g., RETURN pageRank())
  2. No CREATE INDEX/CONSTRAINT - Use SQLite's indexing and constraint mechanisms directly
  3. EXPLAIN supported - Returns the generated SQL for debugging instead of a query plan
  4. Multi-graph support - Use the FROM clause to query specific graphs with GraphManager
  5. Substring indexing - Uses 0-based indexing (Cypher standard), automatically converted for SQLite