Cypher is a vendor-neutral open graph query language employed across the graph ecosystem. Cypher’s ASCII-art style syntax provides a familiar, readable way to match patterns of nodes and relationships within graph datasets.
Like SQL, Cypher is a declarative query language that allows users to state what actions they want performed (such as match, insert, update or delete) upon their graph data without requiring them to describe (or program) exactly how to do it.
In 2015, Neo4j, Inc. decided to open source the Cypher language and make the most popular graph query language available to any technology provider with the aim that Cypher become the "SQL for graphs." Thus, the openCypher project was born.
Since 2017, the openCypher Implementers Group (oCIG) – composed of a community of Cypher vendors, researchers and users – has convened online to discuss and propose features and improvements to the Cypher query language. The oCIG governs change suggestions in the language by consensus, thereby transforming Cypher from a Neo4j-only language into an industry-wide query language.
Cypher is easy to learn.
It is inspired by SQL with the concept of pattern matching taken from SPARQL.
Cypher describes nodes, relationships and properties as ASCII art directly in the language, making queries easy to read and recognize as part of your graph data. Since it is highly legible, Cypher is also easy to maintain, simplifying application maintenance.
Cypher serves a prominent role in the Neo4j Graph Platform, allowing you to use this simple-yet-powerful query language to integrate your work with all of the various tools and facets of the Graph Platform.
In particular, the Neo4j Graph Database features a newly refactored Cypher compiler and runtime which continues to make the language faster release after release. For more information on the mechanics of Cypher in the Neo4j Graph Database, check out our Developer pages on the Cypher query language.
Only available in Neo4j Enterprise Edition, the Cypher query compiler creates high performance query packages for popular query operations.
Cypher for Apache Spark first distills graph datasets from the depths of your data lake. Then, it adds that data to graphs projected out of Neo4j, allowing you to save or snapshot the results as either a (new) real-time graph in Neo4j or as files back in HDFS – or both. The analytic possibilities of these combinations are endless.
Additionally, the Cypher for Apache Spark library introduces many new features in Cypher, including:
- Compositional Graph Queries allow users to save graph query results as graphs in addition to Cypher’s default of returning returning a tabular (scalar) representation. This functionality allows for compositional queries that can be linked together in a function chain of graph algorithms, and it provides the building blocks for multiple graph-handling queries. Multiple graph support allows queries to return identifiable graphs that contain data for a particular domain, application-defined partitions or logical "databases."
- Multiple Named Graphs allow Cypher to identify specific graph datasets upon which to operate.
Lastly, the following features are in progress with the openCyper community, planned for future versions of Cypher implementations, including the Neo4j server and Spark editions of the language.
- Path Control gives user control over path uniqueness while defining traversal types like "walks," "trails" and "paths" as specific patterns.
- Regular Path Expressions apply regular expression syntax in concisely stating complex path patterns when extracting sub-graphs. It applies a powerful path expression language based on the leading-edge GXPath research language.