tigergraph__add_edges
Add multiple edges to a TigerGraph graph in a single batch operation, specifying the edge type and a list of edges with source and target IDs.
Instructions
Add multiple edges (relationships) to a TigerGraph graph in a single batch operation. More efficient than calling 'add_edge' multiple times.
Use When: • Loading multiple relationships • Building graph connections in bulk • Importing relationship data from files • Initial graph construction
Quick Start:
{
"edge_type": "FOLLOWS",
"edges": [
{"from_type": "Person", "from_id": "u1", "to_type": "Person", "to_id": "u2"},
{"from_type": "Person", "from_id": "u2", "to_type": "Person", "to_id": "u3"}
]
}Common Workflow:
Add all vertices first with 'add_nodes'
Use 'add_edges' to create relationships
Verify with 'get_edge_count'
Tips: • All edges in one call must be same edge type • All referenced vertices must exist • Batch size: 1000-5000 edges per call is optimal • Much faster than individual 'add_edge' calls
Related Tools: add_edge, add_nodes, get_edge_count
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edges | Yes | List of edges. Each edge is a dict with source and target info. Must specify 'source_id' (or 'source_vertex_id') and 'target_id' (or 'target_vertex_id'). Can also optionally specify 'source_type' and 'target_type' per edge if different from defaults, though batch edges usually share types. All edges in one batch MUST have the same source/target types due to API limitations. Example: [{'source_id': 'u1', 'target_id': 'p1', 'date': '2023'}] | |
| profile | No | Connection profile name. Omit to use the active default profile. Use 'list_connections' to see available profiles. | |
| edge_type | Yes | Type of the edges. | |
| graph_name | No | Name of the graph. If not provided, uses default connection. |