Repeated relations in derived relations
You can use the repeated relations tool in the derived relation type editor to manage hierarchies where the same relation type repeats at variable depths.
Some models connect assets of the same type in a continuous chain, always using the same relation type between the assets. This is common when there is a containment relation between assets of the same type. The repeated relations tool allows you to define a chain of identical relation types up to the number of times you decide. Instead of defining separate relation paths for every possible depth, you define the relation type once and automatically apply it across a chain of identical relation types, up to the maximum number of repetitions you set.
Problem: Hierarchies of varying depths
Defining a derived relation type is straightforward when your model uses a fixed number of repetitions. Consider an organization with a rigid supervisory hierarchy:
Executive → Director → Manager → Individual Contributor
In this case, navigating from the Executive level to the Individual Contributor level always requires exactly three relations using the "Employee supervises / reports to Employee" relation type:
- An Executive supervises a Director.
- That Director supervises a Manager.
- That Manager supervises an Individual Contributor.
Because the depth is fixed, you can capture this chain by adding the same relation type, "Employee supervises / reports to Employee", to your relation path three times in a row.
The challenge arises when the depth of the hierarchy varies. Consider a file system where directories are nested within other directories. You can model this using the out-of-the-box relation type "Directory contains / is part of Directory". As shown in the following image, the path from the Root directory to leaf AAA contains three relations, whereas the path to leaf B contains only one, forming a hierarchy of variable depth.
To collect the hierarchy leaves or other assets connected to them, you need to consider the variable depth of the hierarchy. Because this depth isn't fixed, you can't simply build a single, straight relation path. Instead, you would have to build every possible path manually: you would add one path that is one relation deep, add a second path that is two relations deep, add a third path that is three relations deep, and so on.
While you can use the JSON editor to build a slightly more optimized version of the paths, the process remains tedious, and maintaining such a massive, branching path becomes difficult.
Solution: Repeated relations
The repeated relations tool allows you to define a relation type once and set the maximum number of times the relation can repeat. To use it, in the derived relation type editor, on the Relation type builder tab, click → Add repetition next to the relation type you want to repeat, and set the maximum repetition limit. The tool then traverses any chain between one repetition and your maximum, finding all matching assets regardless of their exact depth.
You can simplify the Directory hierarchy explored above. Instead of defining all the complex branching paths manually, you simply add the "Directory contains / is part of Directory" relation type once and set the repetition limit to 3. Once this is configured, Collibra automatically selects all the directories up to three levels deep, finding all leaf assets, such as AAA, AAB, ABA, AC, and B.
Behavior
- Setting a maximum repetition limit increases the depth of that specific relation path, which counts toward two system limits: the longest straight path in your derived relation type (maximum 10 explicit relation types) and the total number of nodes across your entire derived relation type (maximum 50 explicit relation types).
- Any path deeper than your maximum repetition limit is ignored.
- By default, Collibra accepts chains of any depth from 1 up to your maximum repetition limit. To enforce a higher minimum, add the relation type twice: once without repetition, and once with a repetition limit set to your maximum minus 1. For example, to accept a chain between 2 and 5 repetitions, add the relation type once without repetition, then add it again with a repetition limit of 4 (1 fixed + 4 repeated = 5 total). Together, these ensure a minimum of 2 and a maximum of 5 repetitions.