add_relationship
Create a new ArchiMate relationship between existing elements by providing source ID, target ID, and relationship type. Optionally add name, description, properties, access type, or influence strength.
Instructions
Add a new ArchiMate relationship between two elements.
Both endpoints must already exist as elements in the active model.
Use `list_supported_types` to discover valid `relationship_type`,
`access_type`, and `influence_strength` values.
Args:
relationship_type: A supported pyArchimate relationship type,
without the `Relationship` suffix. Examples: `Assignment`,
`Serving`, `Composition`, `Aggregation`, `Realization`,
`Triggering`, `Flow`, `Access`, `Influence`,
`Specialization`, `Association`. Note: Archi's "Used By"
concept maps to `Serving`.
source_id: ID of the source element.
target_id: ID of the target element.
name: Optional relationship name.
description: Optional documentation text.
properties: Optional custom property key-value pairs (string
values).
access_type: Required only for `Access` relationships. One of
`Access`, `Read`, `Write`, `ReadWrite`.
influence_strength: Required only for `Influence` relationships.
One of `+`, `++`, `-`, `--`, or `0`-`10`.
relationship_id: Optional stable relationship ID. When omitted a
UUID is generated. Must be unique across the
*entire* active model — not just within this call, this
batch, or this concept type. An id already used by any
element, relationship, view, node or connection is
rejected. When generating ids across several batches,
namespace them (`bp-`, `ac-`, `tech-`) so batches cannot
collide.
Returns:
Success envelope with `data` shaped like a `RelationshipDetail`:
`{id, name, type, description, properties, access_type,
influence_strength, source_element_id, target_element_id}`.
Errors:
`InvalidRelationshipTypeError` for an unknown
`relationship_type`.
`ElementNotFoundError` when `source_id` or `target_id` is
unknown.
`ModelNotFoundError` if no model is active.
`ModelOperationError` for invalid relationship combinations,
duplicate `relationship_id`, or unsupported access/influence
values.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| source_id | Yes | ||
| target_id | Yes | ||
| properties | No | ||
| access_type | No | ||
| description | No | ||
| is_directed | No | ||
| relationship_id | No | ||
| relationship_type | Yes | ||
| influence_strength | No | ||
| semantic_validation | No | warn |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||