create_relationship
Create typed relationships (e.g., PART_OF, EMBEDS) between entities. Use EMBEDS to link container entities like posts to assets such as images, with optional metadata for caption and order.
Instructions
Create a typed relationship between two entities. relationship_type: PART_OF, CORRECTS, REFERS_TO, SETTLES, DUPLICATE_OF, DEPENDS_ON, SUPERSEDES, or EMBEDS. Use EMBEDS when a container entity (e.g. blog post, document) embeds an asset entity (e.g. image, attachment): source_entity_id = container, target_entity_id = asset. For images/files stored in Neotoma: store the file via store (get source_id), create an image/media entity with source_id, then create_relationship(EMBEDS, post_entity_id, image_entity_id). Optional metadata: caption, order.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| relationship_type | Yes | Typed relationship category. Canonical structural types are `PART_OF`, `CORRECTS`, `REFERS_TO`, `SETTLES`, `DUPLICATE_OF`, `DEPENDS_ON`, `SUPERSEDES`, `EMBEDS`. Domain types (e.g. `works_at`, `owns`, `manages`) are also accepted. | |
| source_entity_id | Yes | Existing entity id at the source end of the edge. | |
| target_entity_id | Yes | Existing entity id at the target end of the edge. | |
| source_id | No | Optional `sources` row id stamped as provenance on the relationship observation. | |
| metadata | No | Optional metadata attached to the relationship (e.g. `caption`, `order` for `EMBEDS` edges). | |
| user_id | No | Optional explicit user id; inferred from authentication when omitted. |