Patterns

This reference covers the usage of patterns in TypeQL.

Combining patterns

TypeQL allows us to construct larger and more interesting patterns from smaller ones, allowing us to express more than simple conjunctions.

Use of conjunctions to join patterns into a single query pattern that combines all given constraints.

Use of disjunctions to allow for several branches in a query to be executed in parallel.

Use of negations to exclude patterns from your query results.

Use of optionals for optionally matching subpatterns.

Conditionally inserting or deleting data.

Variables

Pattern comprise statements containing variables. The principles behind variable scoping, typing and optionality merit a page of its own.

The rules behind scoping of variable names, optionality and whether it’s an input to a pattern or bound by it.