01_user_documentation:07_rgg_xl:02_xl:03_query:01_predicate:03_transitive_closure
Table of Contents
Transitive closure
Transitive closures of relations follow the well-known syntax of regular expressions where patterns to be repeated are enclosed in parentheses with a quantifier appended. The possible quantifiers are:
+: 1-to-n repetitions.*: 0-to-n repetitions.?: 0-to-1 repetitions.{n}: exactly n repetitions,{n,m}: n-to-m repetitions.{n,}: least n repetitions.
Transitive closures can be applied on combined path predicates. E.g. (-branch-> b:B (-successor->)*, (b.prod > 0))* matches all paths which traverse a branch edge and a possibly empty sequence of successor edges alternatingly. In addition, target nodes of branch edges have to be of type B and fulfill the condition b.prod > 0.
Note: Using transitive closure it is possible to find the same node several time.
Example
| query | description |
A (>)+ B | All B's that have a A above connected by one successor edges or more |
A (>)* +> B | All B's that have a A above connected by one or more successor edges and one branch-edge directly before the B |
A ((>)* +>)+ B | All B's conntected to A by one or more repetition of the pattern above |
A (>)* +> (>)* B | As many sucessors followed by a branch followed by as many successors |
A (-->)* C (-->)* B | All B' that have an ancestor of the type A and an ancestor of the type C with C between the A and the B |
A (>){2} B | All B's conntected to an A by two incoming successor edge |
01_user_documentation/07_rgg_xl/02_xl/03_query/01_predicate/03_transitive_closure.txt · Last modified: 2025/11/25 12:36 by gaetan
