skills/core-openclaw/cypher/SKILL.md
Cypher query language: MATCH CREATE MERGE DELETE path expressions BFS/DFS aggregations graph algorithms
npx skillsauth add alphaonedev/openclaw-graph cypherInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill allows OpenClaw to execute Cypher queries for interacting with graph databases, specifically Neo4j, enabling operations like node matching, relationship creation, and graph traversals.
Use this skill when working with graph-structured data, such as social networks or recommendation systems. For example, query relationships in a user graph or perform BFS on a knowledge base. Avoid it for relational data; opt for SQL-based skills instead.
To execute a Cypher query, use cypher-shell or the Python neo4j driver. Neo4j Community Edition runs on bolt://localhost:7687 with no authentication by default.
Example 1: Match all nodes and return their labels.
MATCH (n) RETURN labels(n), count(n) LIMIT 10;
Via CLI: cypher-shell -a bolt://localhost:7687 --format plain "MATCH (n) RETURN labels(n), count(n) LIMIT 10"
Example 2: Create a relationship between two nodes.
MATCH (a:Person {name: 'Alice'}), (b:Person {name: 'Bob'})
CREATE (a)-[:KNOWS]->(b);
Use cypher-shell for interactive queries or the Python neo4j driver for programmatic access:
# CLI query
cypher-shell -a bolt://localhost:7687 --format plain "MATCH (n:Skill) RETURN n.name LIMIT 10"
# Python neo4j driver
from neo4j import GraphDatabase
driver = GraphDatabase.driver("bolt://localhost:7687")
with driver.session() as session:
result = session.run("MATCH (n:Skill) RETURN n.name LIMIT 10")
for record in result:
print(record["n.name"])
driver.close()
Config: Connection via bolt://localhost:7687, no auth. Use MERGE for upsert operations: MERGE (n:Person {name: 'Alice'}).
Integrate this skill in OpenClaw by ensuring Neo4j is running (brew services start neo4j on macOS, systemctl start neo4j on Linux). Connection defaults to bolt://localhost:7687 with no authentication. Override via NEO4J_URI environment variable if needed.
Common errors include syntax issues (e.g., missing semicolons) or connection failures. Check for "Neo4jError: Invalid input" by validating queries first. If connection fails, verify Neo4j is running. In code, wrap queries in try-catch blocks:
from neo4j import GraphDatabase
from neo4j.exceptions import ServiceUnavailable, CypherSyntaxError
driver = GraphDatabase.driver("bolt://localhost:7687")
try:
with driver.session() as session:
result = session.run("MATCH (n) RETURN n LIMIT 5")
records = list(result)
except ServiceUnavailable:
print("Error: Neo4j is not running. Start with: brew services start neo4j")
except CypherSyntaxError as e:
print(f"Cypher syntax error: {e}")
finally:
driver.close()
For graph-specific errors like missing nodes, use OPTIONAL MATCH. Always log errors with details for debugging.
tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui