Skip to content

Locy Syntax Cheatsheet

Rule

CREATE RULE name [PRIORITY n] AS
MATCH ...
[WHERE ...]
[ALONG x = expr]
[FOLD agg = SUM(expr)]
[BEST BY expr ASC|DESC]
YIELD KEY a, ...

Goal Query

QUERY name [WHERE ...] [RETURN ...]

Derive Command

DERIVE name [WHERE ...]

Explain

EXPLAIN RULE name [WHERE ...]

Assume

ASSUME { <cypher mutations> } THEN { <locy/cypher body> }

Abduce

ABDUCE [NOT] name [WHERE ...] [RETURN ...]

Modules

MODULE my.module
USE shared.rules