Variable Binding in GQL
Retrieve all the teachers who liked a comment made by students who they know since 2021 or earlier::teacher-labelled node to the variable x and requiring there be a :likes-labelled edge to a node representing a comment. In GQL ASCII-art syntax, round brackets represent nodes, while square brackets represent edges. We then require this comment to have been made by a student (represented by an :author edge to a node with the label student). Finally, we require this student to have any edge to the original node bound to x, that this edge is labelled with :knows and that the value of its since attribute is greater than 2021
Shortest Path
Find shortest pathpath, from a user u1 to user u2 traversing :knows edges 1+ ({1,}) times.
Expressing complex queries using Multiple Paths
Find a pair of friends in the same city ((y.city = x.city)) who transfer money ((account_x)−[t1:transfer]−>(account_z)−[t2:transfer]−>(account_y)) to each other using a common friend who lives elsewhere ((x.city<>z.city)).