Install
openclaw skills install janusgraph-connectorConnect to JanusGraph distributed graph database to query, manage, and analyze graph data using Apache TinkerPop Gremlin traversal language
openclaw skills install janusgraph-connectorThis skill enables interaction with a JanusGraph distributed graph database for querying, storing, managing, and analyzing knowledge graph data at scale.
JanusGraph is a highly scalable, distributed graph database built on the Apache TinkerPop stack that uses Gremlin as its graph traversal language. It supports multiple backend storage systems and is designed for enterprise-grade graph operations.
Use this skill when:
{
"host": "localhost",
"port": 8182,
"protocol": "ws",
"traversal_source": "g",
"timeout": 30,
"max_pool_size": 10
}
| Parameter | Type | Default | Description |
|---|---|---|---|
| host | string | localhost | JanusGraph/Gremlin Server hostname |
| port | integer | 8182 | Gremlin Server port |
| protocol | string | ws | Protocol (ws for WebSocket) |
| traversal_source | string | g | Graph traversal source name |
| timeout | integer | 30 | Connection timeout in seconds |
| max_pool_size | integer | 10 | Maximum connection pool size |
| username | string | optional | Authentication username |
| password | string | optional | Authentication password |
Person("Alice", age: 30, email: "alice@example.com")Person -> KNOWS -> Personname: "Alice", age: 30, since: "2020-01-15"Gremlin is a graph traversal language that:
g.V()
g.V().hasLabel("Person")
g.V().has("name", "Alice")
g.V().has("name", "Alice").has("age", gt(25))
g.addV("Person")
.property("name", "Alice")
.property("age", 30)
.property("email", "alice@example.com")
g.V().has("name", "Alice").addE("KNOWS")
.to(g.V().has("name", "Bob"))
.property("since", "2020-01-15")
g.addV("Person").property("name", "Alice")
g.addV("Person").property("name", "Bob")
g.addV("Person").property("name", "Charlie")
g.V().has("name", "Alice").out("KNOWS")
g.V().has("name", "Alice").repeat(out()).times(3)
g.V().has("name", "Alice").both("KNOWS")
g.V().has("name", "Alice").repeat(out()).until(has("name", "Bob"))
g.V().count()
g.V().group().by("age")
g.V().values("age").mean()
g.V().has("age", gt(25)) // greater than
g.V().has("age", gte(25)) // greater than or equal
g.V().has("age", lt(30)) // less than
g.V().has("age", lte(30)) // less than or equal
g.V().has("age", neq(25)) // not equal
g.V().has("name", startingWith("Al"))
g.V().has("email", endingWith("@example.com"))
g.V().has("name", containing("ice"))
g.V().has("status", within("active", "pending"))
g.V().has("status", without("deleted", "archived"))
g.V().values("name")
g.V().values("age").dedup()
g.V().values("name").fold()
g.V().order().by("name")
g.V().order().by("age", desc)
g.V().limit(10)
g.V().skip(20).limit(10)
g.V().has("name", "Alice").drop()
g.V().has("name", "Alice").outE("KNOWS").drop()
g.V().hasLabel("Temporary").drop()
g.V().has("name", "Alice").property("age", 31)
g.V().has("name", "Alice")
.property("age", 31)
.property("updated_at", 1681305600)
connector.begin_transaction()
connector.commit_transaction()
connector.rollback_transaction()
graph.index("Person_Name")
.onType(Person.class)
.add("name")
.buildCompositeIndex()
graph.index("Person_Search")
.onType(Person.class)
.add("name", Mapping.TEXT.asParameter())
.add("age", Mapping.DEFAULT.asParameter())
.buildMixedIndex("search")
graph.index("KnowsIndex")
.onType(KnowsEdge.class)
.add("since")
.buildCompositeIndex()
graph.index("OutKnows")
.onType(Person.class)
.direction(Direction.OUT)
.label("knows")
.buildCompositeIndex()
connector.batch_update_vertices(
vertices=['v1', 'v2', 'v3'],
properties={'status': 'processed'}
)
vertices = [
{'label': 'Person', 'properties': {'name': 'Alice', 'age': 30}},
{'label': 'Person', 'properties': {'name': 'Bob', 'age': 25}},
]
connector.batch_create_vertices(vertices)
class Vertex:
id: str
label: str
properties: Dict[str, Any]
class Edge:
id: str
label: str
from_id: str
to_id: str
properties: Dict[str, Any]
class Path:
vertices: List[Vertex]
edges: List[Edge]
length: int
| Error | Cause | Solution |
|---|---|---|
| Connection refused | JanusGraph server not running | Start JanusGraph server |
| Query syntax error | Invalid Gremlin syntax | Validate query syntax |
| Timeout exception | Query too slow | Add indexes, limit traversal depth |
| Property not found | Incorrect property name | Verify property exists |
| Vertex not found | ID doesn't exist | Check vertex exists before operation |
| Transaction conflict | Concurrent modification | Simplify or retry transaction |
| Index not found | Index name incorrect | Create index or fix name |
✅ Reuse connections via connection pooling
✅ Close connections properly when done
✅ Set appropriate timeouts
✅ Monitor connection health
✅ Use indexes on filtered properties
✅ Avoid unbounded traversals
✅ Limit result sets explicitly
✅ Use parameterized queries
✅ Use meaningful labels and property names
✅ Maintain referential integrity
✅ Batch operations for bulk loads
✅ Clean up temporary data
✅ Keep transactions short and focused
✅ Commit frequently for better concurrency
✅ Handle rollback scenarios
✅ Use appropriate isolation levels
✅ Create indexes on high-cardinality properties
✅ Monitor query execution time
✅ Use vertex-centric indexes for edge traversals
✅ Limit traversal depth in long-running queries
✅ Distribute data across multiple servers
✅ Use appropriate backend storage (Cassandra for large scale)
✅ Partition data by domain when possible
✅ Monitor resource utilization
✅ Authenticate connections properly
✅ Encrypt sensitive data
✅ Use prepared statements/parameter binding
✅ Apply principle of least privilege
✅ Regularly backup graph data
✅ Monitor index efficiency
✅ Clean up unused vertices/edges
✅ Monitor transaction logs
| Library | Purpose |
|---|---|
| gremlin-python | Gremlin language bindings for Python |
| python-websocket | WebSocket client for Gremlin Server |
| pydantic | Data validation and typing |
| Library | Purpose |
|---|---|
| pandas | Data transformation and analysis |
| networkx | Additional graph analysis |
| tinkerpop-core | TinkerPop framework (for embedding) |
pip install gremlin-python pydantic
Using this skill enables:
✅ Scalability - Manage graphs at enterprise scale
✅ Flexibility - Multiple backend storage options
✅ Performance - Optimized graph traversals
✅ ACID Compliance - Reliable transactions
✅ Distributed Deployment - High availability
✅ Advanced Analytics - Complex graph algorithms
✅ Vendor Independence - TinkerPop abstraction layer
connector = JanusGraphConnector()
connector.connect(config)
result = connector.execute_query(query)
connector.close()
# Get all vertices of a type
g.V().hasLabel('Person')
# Find specific vertex
g.V().has('name', 'Alice')
# Get neighbors
g.V().has('name', 'Alice').out('KNOWS')
# Create vertex
g.addV('Person').property('name', 'Alice')
# Create edge
g.V().has('name', 'Alice').addE('KNOWS').to(...)
connector.create_index(
name='PersonName',
properties=['name'],
index_type='composite'
)
connector.begin_transaction()
# ... operations ...
connector.commit_transaction()
Version: 1.0.0
Last Updated: April 12, 2026