Skip to main content
Version: 4.0

2.5.2 Relationships

Relationships define the connections between Target Entities in the knowledge graph. Where Target Entities become the nodes, Relationships become the edges that link them.

A Relationship connects a from entity to a to entity through one property on each side: rows are linked where the from-property value matches the to-property value. Each Relationship has a type (the label the edge carries in the graph, for example PLACED or BELONGS_TO) and a separator for splitting many-to-many values.

Once processed through the Build operation, Relationships become navigable in the Exploration module. To open an existing Relationship, switch to the Relationships tab in the Model and double-click it; its details open in a panel on the right. The panel has a Setup tab with the definition and a Metadata tab.

The Relationship detail panel: the From and To entities and their properties, the Type, and the Separator

Defining a Relationship​

A Relationship is defined by:

  • Name: the Relationship's name in the Model. Required.
  • From entity and From property: the source node and the property that starts the edge.
  • To entity and To property: the target node and the matching property.
  • Type: the edge label in the graph (see Relationship type).
  • Separator: a split character for many-to-many relationships (see Separator). Required, ; by default.

There are two ways to create one:

  • From the list: choose Add new › Relationship, enter a name, then pick the from/to entities and properties.
  • On the canvas: drag a connection line from one Target Entity node to another. The side panel opens with both entities filled in; pick the properties and enter a name.

Choose Save to create the Relationship. Save stays disabled until the name, both entities, both properties and the separator are set.

Relationship type​

The type is the label the relationship carries in the knowledge graph, how it is named when queried or explored. When you enter the name, DCH fills in the type for you in upper case; you can then edit it. Changing the name again overwrites the type.

Types follow Neo4j relationship-type conventions:

  • Written in upper case, with underscores between words (BELONGS_TO, HAS_PARENT).
  • No whitespace and no special characters.

DCH converts the type to upper case, but does not check the other conventions, so keep to them yourself.

Examples: PLACED, CONTAINS, BELONGS_TO, CREATED_BY.

note

Two Relationships cannot use the same from property, to property and type.

Separator​

The separator resolves many-to-many relationships. When a source property holds several values in one field (for example "123;456;789"), the separator is the character used to split them, and DCH creates one relationship per value.

Common separators are ; (semicolon, the default), , (comma) and | (pipe). With the value "123;456;789" and separator ;, three separate relationships are created, one for each ID.

Actions​

  • Reverse relationship swaps the two sides: the From entity/property and the To entity/property are exchanged, while the type and separator are kept. Use it when the direction was set the wrong way round, then choose Save.
  • Delete relationship removes the Relationship after you confirm.