define_relation
Define and validate a new user relation for a Markdown knowledge graph, appending it to relation-dictionary-user.yaml while checking name collisions and inverse or symmetric rules.
Instructions
Define a new user relation and append it to relation-dictionary-user.yaml. Returns {"defined": true, "name": str, "warnings": [...]} on success, or {"defined": false, "errors": [...], "warnings": [...]} if validation fails.
Rules enforced before writing:
name must not collide with any canonical or existing user relation
If inverse_of is provided and names an unknown relation, a warning is returned (not an error) — the inverse may be defined in a subsequent call.
Every relation needs an inverse or must be symmetric, or lint_vault warns. If inverse_of names a user relation with no inverse, that relation is updated to name this one back. A relation cannot be both symmetric and have inverse_of.
Args: name: New relation name (lowercase, hyphenated) description: What this relation means; include directionality in the wording group: Optional group label (e.g. "entity", "semantic", "custom") inverse_of: Optional name of the inverse relation symmetric: True when the relation is its own inverse (A relates B means B relates A)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| group | No | ||
| symmetric | No | ||
| inverse_of | No | ||
| description | Yes |