Creating relations
A relation is a connection between one or more fields from a source entity table to a target entity table or entity identifier (EID). When you create a relation, a join operation is performed between Elasticsearch indices.
To create a new relation, complete the following steps:
-
Go to the Data model app and select an entity table.
-
Go to the Relations tab and click Create a relation.
-
In the From section, select a field.
-
In the To section, select the search and field to create the relation to.
-
In Relation labels:
-
describe the relationship between the two entities, for guidance see Naming relations.
-
if the relationship is the same in both directions, switch off Directed relation.
-
select the operator which describes how the From and To fields relate, for supported field operators see Federate’s supported field types
-
-
When the relationship between entity tables is represented by multiple conditions, click Add a new condition and repeat the above steps.
-
Click Save relation.
-
To view samples of how the records appear in any of the relations, click Preview in the relations list.
The relation is displayed in the configuration screens of both entity tables. You can view a graphic representation of the related entities on the Data model graph.
You can create a self-relation between two entities of the same type, for example, companies are the main competitors of other companies. However, you can’t define a relationship between two entity identifiers. |
Naming relations
Naming is important when you are configuring a data model. Poor name choices make dashboards difficult to navigate and long names make the user interface difficult to read.
When choosing names, imagine yourself in the place of the user at the moment where the relational navigation is performed. In the companies example data, you could say that a company received an investment. However, for investments it’s more meaningful to say it’s secured by a company. Often, you can use active and passive descriptions, such as saw and seen by. Other times, the relationship is the same in both directions, such as sibling or spouse.
Setting preferred relation directions
By default, when you add or expand a node in the Graph Browser, relations are displayed from the perspective of that node. For example, if you expand a Company node, arrows with the label secured point towards Investment nodes. If you expand an Investment node, arrows with the label secured by point towards company nodes. However, you can set a preferred direction by clicking the star beside a relation label in the relation editor. When a preferred direction is set, the relation is always displayed with that direction in the Graph Browser.
For more information about navigation between relationally connected dashboards, see Relational Navigator.
Optional: Configuring advanced settings for relations
You can manually set the following join behavior:
-
Join types: Siren Federate automatically selects the best algorithm for a join. However, you can force the join selection. For a detailed description of each algorithm, see the Siren Federate plugin documentation.
-
Join timeout:
-1
sets the limit to the default specified in thesiren:joinTaskTimeout
setting of Management > Advanced Settings.0
removes the limit. See Advanced settings for relations. -
Count: Display or hide counts.
-
Hidden: Hide relation outside the data model.
-
Entity resolution types: Select the entity resolution types. These are used to group resolved records to mutually shared types defined by the
siren:entityResolutionTypes
setting of Management > Advanced Settings. See Advanced settings for relations.