Cypher And openCypher Compatibility

ShrikeDB implements a growing set of Cypher and openCypher-style query features, plus its own multimodal and analytics extensions. Use this reference when adapting queries from another Cypher database. Clause restrictions and relationship identity can change which queries execute and how many rows they return.

See Cypher for read-query recipes and Cypher Writes And Schema for governed writes and schema commands.

Clauses And Expressions

Surface Implemented scope Boundary

MATCH, WHERE, RETURN

Node/relationship patterns, labels, property filters, projections and aliases; multiple MATCH clauses.

Execution depends on the admitted pattern shape. Relationship identity uses the set-edge model described below.

Standalone RETURN

Scalar, list and map expressions without a graph scan.

Function names and argument types must be supported by the function registry.

WITH, WITH DISTINCT

Projection, aliases, scope reset and post-projection WHERE; top-level aggregation in WITH.

Start with a row-producing clause. WITH DISTINCT combined with aggregates and nested aggregate expressions are rejected.

OPTIONAL MATCH

Left-join lowering over an existing row stream, with null extension for missing matches and optional-side predicates.

A leading OPTIONAL MATCH without a preceding row stream is rejected by the general planner.

UNWIND

List expressions produce one row per element; supports list/aggregate pipelines.

A configurable row cap bounds expansion. Use ORDER BY when output order matters.

Aggregation and DISTINCT

count, sum, avg, min, max, collect; supported aggregate DISTINCT arguments and row-level RETURN DISTINCT.

Aggregates must be top-level projection items. count(DISTINCT *) is rejected; project an aggregate alias before further arithmetic.

ORDER BY, SKIP, LIMIT

Ordering and pagination of supported row and aggregate projections.

Pagination without an explicit ordering is not a stable page-selection contract.

UNION, UNION ALL

Duplicate-eliminating and duplicate-preserving branch unions.

Branches must have compatible output column names. Mixing the two union modes in one query and unions inside subqueries are rejected.

Null-aware predicates and CASE

IS NULL, IS NOT NULL, IN, comparisons, boolean logic, simple/searched CASE, and coalesce.

Null is an unknown value, not an ordinary equality key. See the null rules below.

Lists, maps and strings

List/map literals, indexing, list slicing, string predicates and supported utility/scalar functions.

Invalid non-null argument types are errors; a function name present in another Cypher implementation is not automatically supported here.

List comprehensions and quantifiers

[x IN values WHERE predicate | expression]; any, all, none, single.

Null-aware evaluation and bounded result construction; loop variables have local scope.

Pattern comprehensions

Read-only fixed-pattern branches with an optional filter and mapped result.

Variable-length pattern comprehensions are rejected; nested output is bounded.

Read-only subqueries

CALL { …​ }, explicit imports with CALL (x) { …​ }, and top-level WHERE EXISTS { …​ } / WHERE NOT EXISTS { …​ }.

No mutation, schema commands or UNION inside subqueries. Do not assume every Neo4j import syntax or arbitrary nesting of EXISTS in boolean expressions is supported.

COUNT { …​ }, COLLECT { …​ }

Bounded read-only subquery expressions.

COLLECT { …​ } requires exactly one visible output column. These are distinct from the aggregate functions count(expr) and collect(expr).

Bounded relationship paths and named paths

Finite lower/upper bounds, zero-hop matches and supported MATCH p = …​ materialization.

Unbounded paths and unsupported relationship-variable bindings in bounded clauses are rejected; resource limits apply.

Graph writes and MERGE

Governed CREATE, node-property SET/REMOVE, node DELETE/DETACH DELETE, deterministic node and directed single-hop MERGE.

Default-off governed executor, legacy fast-path exceptions, single-label creation guidance and explicit unsupported forms: Cypher Writes And Schema.

Schema and inspection

Scoped index/constraint commands, SHOW, EXPLAIN, and PROFILE.

Index creation builds and maintains an exact label/property map. Uniqueness and property-existence constraints validate current data and guard subsequent node writes. PROFILE executes its child query.

Nulls And Empty Aggregates

  • Missing node properties and unmatched optional bindings evaluate to NULL; a missing graph node can still be an error.

  • NULL = NULL evaluates to NULL. Use IS NULL to test for null.

  • WHERE keeps true predicates; false and null predicates do not pass.

  • false AND NULL is false, true OR NULL is true, and NOT NULL is null.

  • 2 IN [1, NULL] is null because no definite match was found and one candidate is unknown.

  • count(*) counts rows, including a null-extended optional row. count(expr) counts non-null values; collect(expr) omits null values.

  • Empty global aggregation returns one row: zero counts, an empty collection, zero sum, and null average/minimum/maximum. Grouped aggregation over no input groups returns no rows.

Path And Relationship Semantics

For bounded MATCH clauses, traversal enforces relationship uniqueness across fixed segments, variable-length segments and comma-separated paths in that clause. Separate MATCH clauses may reuse an edge. A node can be revisited through different relationships; path matching is not restricted to simple node paths.

ShrikeDB’s canonical relationship identity is (source, type, target). Parallel relationships with identical endpoints and type are not independent identities as they can be in Neo4j. Account for this difference when importing a graph or comparing multiplicities.

*..3 has an omitted lower bound of one; use *0..3 to include zero hops. Endpoint bindings, labels and property filters are checked against the published snapshot. Limits stop excessive path/candidate expansion with an error rather than returning a silently truncated count.

Extensions

SEARCH, RANK rerank_v3, vector.knn, kv.get, and the supported gds.*.stream procedures are separate ShrikeDB capabilities. Their presence does not imply the full Neo4j procedure ecosystem, APOC library, or GDS API is available. EMBED and FULLTEXT MATCH remain planned concept syntax.