Data stream describes the data rows produced during the execution of UQL, which are then called and enter the next statement interatively.
Data derived from the result of a same query are homologous. Homologous data always have the same number of rows with data in the same row correlated.
In the image below, aliases path, tail and length are homologous, they all have 5 rows of data:
In most cases when an expression calls homologous data, each data in the same row are called and calculated, and this is done row by row.
The nodes.score1 and nodes.score2 in below image are homologous, they are calculated and yield another homologous data mean:
Deduplicating data in WITH clause will affect its homologous data, while deduplicating data in RETURN clause will not. The (a) and (b) in below image demonstrates this difference.
Data coming from completely independent queries are heterologous, or non-homologous. Rows in heterologous data usually have no correlations.
The a and b in below image are heterologous, they each has 3, 2 rows:
When an operation calls heterologous data, in WITH clause the data will perform Cartesian Product (be multiplied), otherwise the data will be trimmed to the minimum length. The (a) and (b) in below image demonstrates this difference.
No matter which is the case, heterologous data that enter the same statement will then become homologous.
When data enters a chain statement for insert/update/delete/query, the number of executions of the chain statement equals the number of rows of data, and each execution uses one row from the data (system may apply optimizations based on the actual situation).
The 'number of rows of data' denotes its literal meaning for homologous data, but denotes the number of rows of the shortest data for heterologous data.
The n in below image enters a delete command, which is executed 4 times and deletes 1 node each time:
If the data enters a chain statement for query, then each execution of this query is called a subquery.
In the image below, the red and blue nodes in n trigger two subqueries of
find().nodes(), the first subquery finds 3 red nodes, and the second subquery finds 2 blue nodes, which are 5 rows of data in total:
To operate on the result of each subquery independently, some methods are supported such as clause CALL, prefix OPTIONAL or parameter
limit(). The rest of functions or clauses all perform operations on the whole result of a query. The (a) and (b) in below image demonstrate the difference between operations on each subquery result and the whole query result, using
limit() and LIMIT: