Install
openclaw skills install knowledge-graph-tigergraph-connectorConnect to TigerGraph distributed graph database to query, load, and manage large-scale knowledge graph data using GSQL and REST++ APIs
openclaw skills install knowledge-graph-tigergraph-connectorThis skill enables comprehensive interaction with TigerGraph graph database for storing, querying, analyzing, and managing large-scale knowledge graph data.
TigerGraph is a high-performance distributed graph database platform optimized for:
Use this skill when:
{
"host": "http://localhost",
"restpp_port": 9000,
"graph_name": "MyGraph",
"api_token": "your-api-token",
"timeout": 30,
"retry_count": 3
}
| Parameter | Type | Default | Description |
|---|---|---|---|
| host | string | required | TigerGraph server URL |
| restpp_port | integer | 9000 | REST++ API port |
| graph_name | string | required | Graph name to work with |
| api_token | string | required | Authentication token |
| timeout | integer | 30 | Request timeout in seconds |
| retry_count | integer | 3 | Number of retries |
| username | string | optional | Alternative authentication |
| password | string | optional | Alternative authentication |
Example Query:
CREATE QUERY getNeighbors(VERTEX<Person> person) FOR GRAPH MyGraph {
Start = {person};
Result = SELECT t
FROM Start:s -(KNOWS:e)-> Person:t;
PRINT Result;
}
CREATE QUERY queryName(PARAMETERS) FOR GRAPH graphName {
// Variable declarations
// Pattern matching
// Aggregations
// Output
}
Start = {Person.*};
Result = SELECT * FROM Start;
Start = {Person.* UNION Company.*};
Result = SELECT * FROM Start;
Result = SELECT t
FROM Start:s -(KNOWS:e)-> Person:t;
Result = SELECT t
FROM Start:s -(KNOWS:e)-> Person:t -(WORKS_AT:e2)-> Company:c;
Result = SELECT t
FROM Start:s -(KNOWS:e)->* Person:t;
Result = SELECT COUNT(DISTINCT t)
FROM Start:s -(KNOWS:e)-> Person:t;
Result = SELECT s.name, COUNT(DISTINCT t)
FROM Start:s -(KNOWS:e)-> Person:t
GROUP BY s.name;
Result = SELECT *
FROM Start
WHERE age > 25 AND status == "active";
Result = SELECT s.name, COUNT(DISTINCT t) as cnt
FROM Start:s -(KNOWS:e)-> Person:t
GROUP BY s.name
HAVING cnt > 5;
{
"vertices": {
"Person": {
"alice": {
"name": "Alice",
"age": 30,
"email": "alice@example.com"
},
"bob": {
"name": "Bob",
"age": 25,
"email": "bob@example.com"
}
}
}
}
{
"edges": {
"Person": {
"alice": {
"KNOWS": {
"Person": {
"bob": {
"since": "2020-01-15"
}
}
}
}
}
}
}
connector.load_from_csv(
file_path="data.csv",
vertex_type="Person",
mapping={"name": "Name", "age": "Age"}
)
RUN QUERY pagerank(max_iterations=100, damping_factor=0.85)
Measures vertex importance in the graph.
RUN QUERY shortest_path(source_vertex, target_vertex)
Finds shortest path between two vertices.
RUN QUERY louvain_community(resolution=1.0)
Detects communities/clusters in graph.
RUN QUERY betweenness_centrality()
Measures vertex betweenness centrality.
Can be defined using GSQL for specific use cases.
result = connector.run_query(
query_name="getNeighbors",
parameters={"person": "Alice"}
)
result = connector.run_query(
query_name="complexQuery",
parameters={...},
timeout=60
)
results = connector.batch_query(
queries=[
{"name": "query1", "params": {...}},
{"name": "query2", "params": {...}}
]
)
| Error | Cause | Solution |
|---|---|---|
| Connection refused | Server not running | Start TigerGraph server |
| Unauthorized | Invalid token | Regenerate API token |
| Query not found | Query not installed | Install query definition |
| Timeout | Query too slow | Optimize query, increase timeout |
| Graph not found | Wrong graph name | Verify graph name |
✅ Use installed queries for performance
✅ Pre-compile queries instead of dynamic ones
✅ Optimize pattern matching
✅ Use appropriate graph traversal depth
✅ Leverage built-in algorithms
✅ Use batch loading for bulk data
✅ Validate data before loading
✅ Use atomic transactions
✅ Monitor loading progress
✅ Handle duplicates appropriately
✅ Create indexes on frequently queried properties
✅ Monitor query execution plans
✅ Use result streaming for large datasets
✅ Cache frequently accessed data
✅ Distribute computation across nodes
✅ Design schema for query patterns
✅ Use appropriate data types
✅ Maintain referential integrity
✅ Document schema changes
✅ Version schema updates
✅ Use built-in graph algorithms
✅ Tune algorithm parameters
✅ Monitor resource usage
✅ Implement incremental updates
✅ Cache algorithm results
✅ Partition data appropriately
✅ Use distributed loading
✅ Monitor cluster health
✅ Balance load across nodes
✅ Plan capacity growth
✅ Protect API tokens
✅ Use HTTPS connections
✅ Implement access control
✅ Audit all operations
✅ Encrypt sensitive data
✅ Monitor database health
✅ Regular backups
✅ Update software regularly
✅ Archive old data
✅ Clean up temporary data
| Library | Purpose |
|---|---|
| pyTigerGraph | Official Python SDK |
| requests | HTTP client |
| json | JSON handling |
pip install pyTigerGraph requests
Using this skill enables:
✅ Performance - High-speed graph processing at scale
✅ Analytics - Advanced graph algorithms and analytics
✅ Scalability - Enterprise-scale knowledge graph processing
✅ Real-Time - Real-time graph computations
✅ Flexibility - Support for complex graph patterns
✅ Reliability - Enterprise-grade reliability and backup
✅ Integration - Easy integration with applications
connector = TigerGraphConnector()
connector.connect(config)
result = connector.run_query("queryName", params)
connector.close()
# Insert vertices
connector.insert_vertices(vertex_type, vertices)
# Insert edges
connector.insert_edges(edge_type, edges)
# Run algorithm
connector.run_algorithm("pagerank", params)
# Get statistics
stats = connector.get_statistics()
connector.load_from_csv(file_path, vertex_type, mapping)
connector.batch_insert(vertices, edges)
Version: 1.0.0
Last Updated: April 12, 2026