add_edge
Connect two nodes in a knowledge graph to build relationship networks, representing dependencies, associations, or other connections between entities.
Instructions
Add edges in the knowledge graph, connecting two nodes to build a relationship network. Edges represent relationship types between nodes, such as dependencies, containment, associations, etc. Prerequisites:
Must first create a graph (using create_graph)
Source and target nodes must already exist
Edge type must match the graph type
Usage recommendations:
First use list_graphs to get graph and node information
Confirm both source and target nodes exist and their types match
Choose appropriate edge type based on graph type
Add meaningful labels to edges to help understand relationships
If relationships have varying strengths, use the weight parameter
Return data:
data: Newly created edge information
id: Edge ID
type: Edge type
sourceId: Source node ID
targetId: Target node ID
label: Edge label
weight: Edge weight
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| graphId | Yes | ||
| type | Yes | Edge type. Topology diagram:depends_on/imports/extends/implements/calls/references/contains/associated_with, Timeline graph:precedes/leads_to/created_by/modified_by, Change log:precedes/transforms_to/created_by/modified_by/part_of, Requirements document:implements_req/depends_on/part_of/created_by/modified_by | |
| sourceId | Yes | ||
| targetId | Yes | ||
| label | No | ||
| weight | No |