While the GQL Standard incorporates a lot of capabilities in Cypher, Cypher contains additional features that are not part of GQL and no GQL alternatives currently exist for them. This page covers those Cypher features.
Cypher feature | Description |
---|---|
|
|
Used to create a list with the rows returned by a subquery. |
|
Used to count the number of rows returned by a subquery. |
|
Used to discover if a specified pattern exists at least once in the graph |
Cypher feature | Description |
---|---|
Spatial values. |
|
Map values - the GQL equivalent is Records. |
Cypher feature | Description |
---|---|
Syntactic construct for creating a |
|
Constructs |
|
Syntactic construct for creating a |
Node labels, relationship types, properties, and CSV columns can be referenced dynamically using Cypher. This allows for more flexible queries and mitigates the risk of Cypher injection. (For more information about Cypher injection, see Neo4j Knowledge Base → Protecting against Cypher injection).
Cypher feature | Description |
---|---|
MATCH (n:$($label)),
()-[r:$($type)]->() |
|
CREATE (n:$($label)),
()-[r:$($type)]->() |
|
MERGE (n:$($label)),
()-[r:$($type)]->() |
|
LOAD CSV WITH HEADERS FROM 'file:///artists-with-headers.csv' AS line
CREATE (n:$(line.label) {name: line.Name}) |
|
MATCH (n)
SET n[$key] = value |
|
MATCH (n:Label)
SET n:$(n.property) |
|
MATCH (n {name: 'Peter'})
REMOVE n:$($label) |
|
MATCH (n {name: 'Peter'})
REMOVE n:$($label) |
Cypher feature | Description |
---|---|
Resolves the database name for the given element id. |
Cypher feature | Description |
---|---|
Generates a vector embedding for a single value. |
Cypher feature | Description |
---|---|
Returns the graph reference with the given element id.
It is only supported in the |
|
Returns the graph reference of the given name. It is only supported in the |
|
Lists the names of graphs in the current database. |
|
Returns the |
Cypher feature | Description |
---|---|
Returns a |
|
Returns a |
|
Returns a |
|
Returns a |
|
Runs an expression against individual elements of a |
|
Returns a |
|
Returns a |
|
Returns all but the first element in a |
|
Converts a |
|
Converts a |
|
Converts a |
|
Converts an |
Cypher feature | Description |
---|---|
Returns the absolute path of the file that |
|
Returns the line number that |
Cypher feature | Description |
---|---|
Returns the base of the natural logarithm, e. |
Cypher feature | Description |
---|---|
Returns whether the given |
|
Returns a random |
|
Returns the value of a number rounded to the nearest |
|
Returns the signum of an |
Cypher feature | Description |
---|---|
Returns true if the predicate holds for all elements in the given |
|
Returns true if the predicate holds for at least one element in the given |
|
Checks whether a |
|
Returns true if the predicate holds for no element in the given |
|
Returns true if the predicate holds for exactly one of the elements in the given |
Cypher feature | Description |
---|---|
Returns the end |
|
Returns the first element in a |
|
Returns the last element in a |
|
Returns a |
|
Generates a random UUID. |
|
Returns the start |
|
Returns a |
|
Returns a |
Cypher feature | Description |
---|---|
Returns a 2D or 3D point object, given two or respectively three coordinate values in the Cartesian coordinate system or WGS 84 geographic coordinate system. |
|
Returns a |
|
Returns true if the provided point is within the bounding box defined by the two provided points. |
Cypher feature | Description |
---|---|
Returns a |
|
Returns a |
|
Returns a |
|
Returns a substring of the given |
Cypher feature | Description |
---|---|
Returns the arctangent2 of a set of coordinates in radians. |
|
Returns half the versine of a number. |
|
Returns the mathematical constant pi. |
Cypher feature | Description |
---|---|
Computes the |
|
Computes the |
|
Computes the |
Cypher feature | Description |
---|---|
Returns the current |
|
Returns the current |
|
Returns the current |
|
Returns the current |
|
Creates a |
|
Creates a |
|
Returns the current |
|
Returns the current |
|
Returns the current |
|
Truncates the given temporal value to a |
|
Returns the current |
|
Returns the current |
|
Returns the current |
|
Truncates the given temporal value to a |
|
Returns the current |
|
Returns the current |
|
Returns the current |
|
Truncates the given temporal value to a |
|
Returns the current |
|
Returns the current |
|
Returns the current |
|
Truncates the given temporal value to a |
Cypher feature | Description |
---|---|
Returns a |
|
Returns a |
Cypher feature | Description |
---|---|
Neo4j’s default index. Supports most types of predicates. |
|
Solves predicates operating on |
|
Solves predicates on spatial |
|
Only solves node label and relationship type predicates (i.e. they cannot solve any predicates filtering on properties). |
|
Enables searching within the content of |
|
Enables similarity searches and complex analytical queries by representing nodes or properties as vectors in a multidimensional space. |
|
Cypher allows for index hints to influence the planner when creating execution plans.
Index hints are specified with the |
GQL supports GRAPH TYPES
as a way of constraining a graph schema, but does not support individual constraints.
Cypher feature | Description |
---|---|
Ensures that the combined property values are unique for all nodes with a specific label or all relationships with a specific type. |
|
Ensures that a property exists either for all nodes with a specific label or for all relationships with a specific type. |
|
Ensures that a property has the required property type for all nodes with a specific label or for all relationships with a specific type. |
|
Ensures that all properties exist and that the combined property values are unique for all nodes with a specific label or all relationships with a specific type. |
Cypher feature | Description |
---|---|
|
|
|
Cypher feature | Description |
---|---|
Optionally prepended to queries to produce execution plans.
|
|
|
Cypher allows for setting the runtime of queries, determining how the query will be executed. The available Cypher runtimes are: slotted, pipelined, parallel. |
|
Cypher allows for setting numerous query options. For more information, see Query options. |
Note
|
The documentation for Cypher’s administration commands is located in Neo4j’s Operation Manual. |
Cypher feature | Description |
---|---|
Commands to |
|
Commands to |
|
Commands to administer servers in a cluster and the databases allocated to them. |
|
Commands to manage users, roles, and privileges. |