MATCH: Pattern Matching
()→ Node[]→ Edge-→ Undirected edge- Labels:
:Label - Properties:
{key: 'value', age: 30}
CREATE: Add Nodes & Edges
- Labels required for node creation
- No
RETURNclause - Use commas to create multiple items at once
MATCH + CREATE and MATCH + CREATE + RETURN
SET: Update Properties
- Always used with
MATCH, notCREATE - Creates the property if it does not already exist
- Use
COMMITto persist changes
WHERE: Filter nodes and edges by properties
To filter on node label:SKIP and LIMIT
ORDER BY
Joins and Cartesian Products
- Comma
,separates independent patterns - Shared variables between patterns create joins
- Unrelated patterns create cartesian products (N × M rows)
Property Match Operators
:→ exact match using property filter in node directly=→ exact match using property filter in WHERE clause
Boolean operators
-
OR -
AND
Comparison operators
-
Equal:
= -
Inequal:
<> -
Less than:
< -
Less than or equal to:
<= -
Greater than:
> -
Greater than or equal to:
>= -
is null:
IS NULL -
is not null:
IS NOT NULL
Data Types
RETURN Clause
- Select fields with
RETURN n.prop, m.prop
Expression evaluation
LOAD graphs
Load TuringDB graph
Files have to be available ingraphs subdirectory of turing-dir.
Load external data into TuringDB graph
Files have to be available indata subdirectory of turing-dir.
Procedures (CALL)
Procedure outputs can be
YIELDed and chained: CALL db.labels() YIELD label MATCH (n) WHERE n.name = label RETURN n.

