Relationship Constraints Reference
Pair-Wise Constraints
Section titled “Pair-Wise Constraints”Constraints restrict which element types a relationship type can connect. They are defined as a list of valid pairs — each specifying a source element type and a target element type.
Constraint structure
Section titled “Constraint structure”"constraints": { "validPairs": [ { "source": "application-component", "target": "application-service" }, { "source": "application-component", "target": "application-component" } ]}Each pair references element types by their $id.
Enforcement
Section titled “Enforcement”- When drawing a relationship on the Canvas, only valid source/target pairs are allowed
- The relationship type picker only shows types that have a valid pair for the selected source and target
- Invalid attempts are silently prevented — no relationship is created
Unconstrained Relationships
Section titled “Unconstrained Relationships”A relationship type with no constraints (empty validPairs or omitted constraints) can connect any two elements. This is useful for general-purpose relationships like Association.
"constraints": {}Wildcard Constraints
Section titled “Wildcard Constraints”Some built-in relationship types use "*" as a wildcard for one end:
{ "source": "note", "target": "*" }This means the source must be a Note, but the target can be any element type.
Constraint Validation
Section titled “Constraint Validation”The integrity checker can detect M1 relationships that violate their M2 type’s constraints. This can happen when:
- An M2 constraint is added or tightened after M1 relationships were already created
- A .farki file is imported with relationships that don’t match the available M2 constraints
Violations are reported as warnings — existing relationships are not automatically deleted.