Adding relations between entities

A relation is a connection between a field of one entity table and another field of a different entity table or entity identifier (EID). When you create a relation, a join operation is performed between two Elasticsearch indices.

Procedure

To create a new relation, complete the following steps:

  1. In the Data model app, select the entity table that you want to add relations to.

  2. Select the Relations tab.

  3. Click Add relation.

  4. In the Source Entity column, select a source field from the dropdown menu.

  5. In the Target Entity column, select a target field from the dropdown menu.

  6. Enter a labels for the relationship between the two entities. You must enter a label in the direction of source → target, and another label in the direction of target → source. For guidance about how to choose the labels, see How to name relations.

  7. Click Save.

  8. To view samples of how the records in any of the relations appear, click Show samples for this relation (the eye icon).

After it is saved, the relation will appear in the configuration screens of both the source and target entity tables.

On the Data model graph tab, you can view a graphical representation of the related entities where the currently-selected entity is highlighted.

A self-relation can be created between two entities of the same type. For example, when companies are the main competitors of other companies. However, it is not possible to define a relationship between two entity identifiers.

Configuring advanced settings for relations

To configure advanced settings for relations, click Edit (the pencil icon) next to the relation. For more information about the options that are available, see Advanced settings for relations.

How to name relations

Naming is an important consideration to make when you are configuring a data model.

In Siren Platform, naming entities and relationships incorrectly can result in dashboards that are difficult to navigate.

When naming things, imagine yourself in the place of the user at the moment where the relational navigation is performed. Say that you are looking at companies, how would you refer to investments?

A possibly natural way is to say that a company received an investment. However, if you are thinking of investment, you can say it has been secured by a company.

In the user interface, look at the directions of the arrows and think of X relationship Y and Y relationship X. For example:

How to name relations

In this case we are using two different verbs, but often the simple solution is to use active/passive, for example "saw and "seen by". Sometimes the inverse is the same property is the same, for example "brother of" or "spouse".

As a general rule, it is always best to keep things quite short. For example, source/is source of and so on.

For more information about the component that provides the navigation between relationally connected dashboards, see Relational Navigator.