Cypher Query Language
Cypher is Neo4j’s graph query language that lets you retrieve data from the graph. It is like SQL for graphs, and was inspired by SQL so it lets you focus on what data you want out of the graph (not how to go get it). It is the easist graph language to learn by far because of its similarity to other languages, and intuitiveness.
Cypher is unique because it provides a visual way of matching patterns and relationships.
Cypher uses an ASCII-art type of syntax where (nodes)-[:ARE_CONNECTED_TO]->(otherNodes)
using rounded brackets for circular
(nodes)
, and -[:ARROWS]->
for relationships.
When you write a query, you draw a graph pattern through your data.
Neo4j users use Cypher to construct expressive and efficient queries to do any kind of create, read, update, or delete (CRUD) on their graph, and Cypher is the primary interface for Neo4j.
Like Neo4j itself, Cypher is open source! The openCypher project provides all of the specs needed. Cypher is backed by a number of companies all of which benefit from cypher. |
Introduction to Cypher
Once you have an AuraDB database, you can use the :play cypher
command inside of Neo4j Browser to get started.
Neo4j’s developer pages cover the basics of the language, which you can explore by topic area below, starting with basic material, and building up towards more complex material.
Learn what cypher is, and important concepts for graph |
|
How to write Cypher code to query the graph |
|
How to change data in a graph |
|
Trim results by criteria, focusing only on the data you want. |
|
Counting results, grouping data by values, finding minimum, maximums, and aggregations. |
|
Working with temporal information |
|
Running queries within queries for more accurate and focused results |
|
Recommended style for writing easy to read, easy to maintain Cypher queries |
|
Similarities and Differences between SQL and Cypher |
|
User-Defined Procedures and Functions |
Extending Cypher with powerful additional functionality for special scenarios |
Tutorial: Build a Recommendation Engine
With Cypher structure and syntax covered in the sections above, you can dive into building your own recommendation engine to use graph data and Cypher to recommend movies, colleagues, cuisines, and more.
Tutorial: Build a Recommendation Engine will walk through using queries and filtering that takes advantage of the relationships in a graph in order to lend insight into habits and hidden connections and provide valuable recommendations.
Community Help
If you have any questions, the Neo4j Community is the place to go to ask. Join a group of professionals using graphs to solve all kinds of interesting problems!
Cypher Resources
Find out where else you can learn Cypher or increase your depth of knowledge from experts and solutions. There are a variety of training opportunities, blogs, videos, and more for taking the next steps in your Cypher (and Neo4j) journey!
Learn with GraphAcademy
Cypher Fundamentals
This course teaches you the essentials of using Cypher, Neo4j’s powerful query language, in as little time as possible, with videos, quizzes and hands-on exercises.
Was this page helpful?