Patterns
This reference covers the usage of patterns in TypeQL.
Scopes and operations
Pattern comprise statements containing variables. Given a pattern, the scope of a variable is:
-
the block
{ … }
in which variable appears at top-level (i.e., not nested in further{…}
) but it does not appear outside of the block, -
or, the entire pattern itself if the variable appears at the top-level of the pattern itself.
A key principle of valid TypeQL pattern is:
Every variable must have a unique scope.
While a statement by itself is an (elementary) patterns, operations allow us to construct larger and more interesting patterns from smaller ones, and they create new scopes of variables.