neo4j-cypher-guide
Comprehensive guide for writing modern Neo4j Cypher read queries. Essential for text2cypher MCP tools and LLMs generating Cypher queries. Covers removed/deprecated syntax, modern replacements, CALL subqueries for reads, COLLECT patterns, sorting best practices, and Quantified Path Patterns (QPP) for efficient graph traversal.
Security Assessment
About neo4j-cypher-guide
The 'neo4j-cypher-guide' skill provides a comprehensive guide for writing modern Neo4j Cypher read queries. It helps developers transition from deprecated or removed Cypher syntax to more efficient, modern query patterns. This skill is crucial for those working with Cypher queries in tools like text2cypher MCP or LLMs, ensuring that the generated queries follow best practices for performance and readability. It emphasizes the use of modern syntax patterns, optimized traversal techniques, and efficient query structures.
FAQ
How do I avoid deprecated features when writing Cypher queries?
The skill highlights deprecated features such as the 'id()' function, implicit grouping keys, and pattern expressions for lists. It recommends modern replacements like 'elementId()', explicit 'WITH' clauses, and 'COLLECT' subqueries.
What are some best practices for sorting queries?
When sorting Cypher queries, always filter out NULL values before sorting. The guide shows the correct pattern using 'WHERE property IS NOT NULL' to ensure consistent sorting behavior.
What is Quantified Path Patterns (QPP) and when should I use it?
QPP is a modern approach to handling variable-length paths in Cypher queries. It is especially useful for improving query performance when dealing with complex traversals and paths longer than a few hops.
Can I use CALL subqueries for complex reads?
Yes, CALL subqueries are recommended for complex data retrieval. The skill demonstrates how to use them for sophisticated operations, such as ordering and limiting results within subqueries.
Where can I find additional resources for deprecated syntax or advanced query features?
You can load additional reference documentation such as 'deprecated-syntax.md', 'subqueries.md', or 'qpp.md' for detailed guidance on handling deprecated features, working with subqueries, and optimizing variable-length path queries.
Install neo4j-cypher-guide
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
tomasonjo/blogs