Relationship Types vs Relationships
BeginnerRelationship Types vs Relationships
Relationship Type (Metamodel / M2)
A Relationship Type defines a kind of connection between elements.
- Created in the metamodel layer
- Has a name (e.g., "runs_on", "manages", "depends_on")
- Can have properties (e.g., a "manages" relationship might have a "since" date property)
- Needs Allowed Connections to specify which Node Types it can connect
- Found under Relationship Types in the Tree View
Relationship (Model / M1)
A Relationship is a concrete connection between two specific nodes.
- Created in the model layer
- Connects a source node to a target node
- Follows the rules set by Allowed Connections
- Has specific property values
- Shown as arrows/lines on the canvas
- Found under Relationships in the Tree View
How to Create Each
Creating a Relationship Type:
- In the Tree View, find the Relationship Types section
- Click the + button
- Give it a name (e.g., "runs_on")
- Add properties if needed in the Properties Panel
- Important: Set up Allowed Connections to define which Node Types this relationship can connect
Creating a Relationship (Instance):
- On the canvas, hover over a node to see connection handles (small circles)
- Click and drag from a handle on the source node
- Drop on the target node
- If multiple relationship types are allowed, a popup lets you choose which one
- The relationship appears as a line/arrow between the nodes
Example
| Relationship Type (M2) | Relationships (M1) |
|---|---|
| runs_on | payment-service → web-server-01 |
| manages | Alice → Bob |
| depends_on | auth-service → database-service |