TerminusDB allows path regular expressions as a way to describe multi-hop searches in a concise fashion. When you need to follow a link repeatedly for shortest path queries or to find all linked documents meeting some specification you can often use a path query.

For guidance on back-links and path queries using GraphQL visit the GraphQL reference guide

The syntax of path expressions, for expressions A, B and fields F is as follows:

ExpressionExampleNameDescription
A,Bfriend,nameSequenceFirst follow expression A, then from that node expression B
A|Bfriend|foeChoiceFollow expression A or expression B
F+friend+PlusFollow the field F any number of times, but at least once
F*friend*StarFollow the field F any number of times, including zero
..AnyFollow the field F any number of times, including zero
..AnyFollow any field F regardless of name
FfriendFieldFollow the field F
F{n,m}friend{1,3}TimesFollow the field F between n and m times
(A)(friend|foe)GroupGroup the expression for inclusion in a larger expression
F>friend>ForwardFollow the field F forward. This is the same as F.
<F<friendBackwardFollow the field F backward (who is linked to this node by F https://assets.terminusdb.com/docs/technical-documentation-terminuscms-og.png media: []