Data pipelines
This reference covers the usage of data pipelines in TypeQL. Data pipeline read and modify data in stages.
Pipeline kinds
-
A write pipeline may comprise stages that modify data in the database (such as
insertordelete). -
A read pipeline only comprises stages that read data from the database but do not modify it.
Combining stages
Each stage receives the stream of rows output by the previous stage, and only the variables in those rows are available to it.
Stages may be chained in any order permitted by their kind, and a stage kind may appear more than once — for instance, a match may follow a reduce:
match
$user isa user;
friendship($user, $friend);
reduce $friend-count = count groupby $user;
match
$friend-count >= 2;
$user has username $username;
select $username, $friend-count;
Here the second match sees only $user and $friend-count, the output of the reduce.
See Using reduced values in later stages.