tigergraph__create_graph
Create a new graph in TigerGraph, defining its vertex and edge types for a custom schema.
Instructions
Create a new graph in the TigerGraph database with its schema (vertex types and edge types). Each graph has its own independent schema.
Use When: • Creating a new graph from scratch • Setting up a graph with specific vertex and edge types • Initializing a new project or data model • Defining the structure before loading data
Quick Start:
{
"graph_name": "SocialNetwork",
"vertex_types": [
{
"name": "Person",
"primary_id": "id",
"primary_id_type": "STRING",
"attributes": [
{"name": "name", "type": "STRING"},
{"name": "age", "type": "INT"}
]
}
],
"edge_types": [
{
"name": "FOLLOWS",
"from_vertex": "Person",
"to_vertex": "Person",
"directed": true,
"attributes": [
{"name": "since", "type": "STRING"}
]
}
]
}Common Workflow:
Use 'list_graphs' to check if graph name is available
Design your vertex types and edge types
Call 'create_graph' with the schema
Use 'show_graph_details' to verify it was created correctly
Start loading data with 'add_node' and 'add_edge'
Vertex Primary Key Options:
• Default: auto-generates PRIMARY_ID id STRING with primary_id_as_attribute
• Explicit PRIMARY_ID: set primary_id (string) and primary_id_type on vertex type
• PRIMARY KEY mode: set primary_key: true on one attribute (not GraphStudio compatible)
• Composite key: set primary_id to a list of attribute names, e.g. ["title", "year"]
All listed attributes must exist in the attribute list (not GraphStudio compatible)
• The key is always queryable as a regular attribute
Tips: • Define all vertex types before edge types • Edge types reference vertex types by name • Set 'directed': false on edge types for undirected edges (default: directed) • Consider using 'get_workflow' for step-by-step guidance
Related Tools: list_graphs, show_graph_details, drop_graph
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| profile | No | Connection profile name. Omit to use the active default profile. Use 'list_connections' to see available profiles. | |
| edge_types | No | List of edge type definitions for this graph. | |
| graph_name | Yes | Name of the new graph to create. | |
| vertex_types | Yes | List of vertex type definitions for this graph. |