All Functions
This section contains a summary of all functions supported in GQL.
Element Functions
| Function | Description |
|---|
| id() / element_id() | Gets the unique identifier _id of a graph element. |
| labels() | Gets the labels of a graph element. |
| type() | Gets the label of an edge. |
| keys() | Returns the property names of a node, edge, or the key names of a record. |
| values() | Returns the property values of a node, edge, or the values of a record. |
| properties() | Returns the properties of a node or edge as a record. |
| property_exists() | Checks whether a property exists on a node or edge. |
Path Functions
| Function | Description |
|---|
| path_length() | Returns the number of edges in a path. |
| elements() | Returns the nodes and edges of a path as a list. |
| pnodes() | Returns the nodes of a path as a list. |
| pedges() | Returns the edges of a path as a list. |
| pnodeIds() | Collects the _id values of nodes in a path into a list. |
| pedgeUuids() | Collects the _id values of edges in a path into a list. |
Aggregate Functions
| Function | Description |
|---|
| collect_list() | Collects a set of values into a list. |
| count() | Returns the number of rows in the input. |
| max() | Returns the maximum value in a set of values. |
| min() | Returns the minimum value in a set of values. |
| avg() | Computes the average of a set of numeric values. |
| sum() | Computes the sum of a set of numeric values. |
| percentile_cont() | Computes the continuous percentile value over a set of numeric values. |
| percentile_disc() | Computes the discrete percentile value over a set of numeric values. |
| stddev_pop() | Computes the population standard deviation of a set of numeric values. |
| stddev_samp() | Computes the sample standard deviation of a set of numeric values. |
Mathematical Functions
| Function | Description |
|---|
| abs() | Returns the absolute value of a given number. |
| ceil() | Rounds a given number up to the nearest integer. |
| floor() | Rounds a given number down to the nearest integer. |
| round() | Returns the nearest value of a given number, rounded to a specified position of digits. |
| mod() | Computes the modulus, or the remainder when one number is divided by another. |
| sqrt() | Computes the square root of a given number. |
| exp() | Computes the value of Euler's number 𝑒 raised to the power of a given number. |
| power() | Raises a number to the power of another number. |
| ln() | Computes the natural logarithm of a given number. |
| log() | Computes the logarithm of a specified number with respect to a given base. |
| log10() | Computes the base 10 logarithm of a given number. |
| pi() | Returns the mathematical constant π (pi). |
| random() | Returns a random floating-point number between 0 and 1. |
| sign() | Returns the sign of a number: -1, 0, or 1. |
Trigonometric Functions
Function | Description |
|---|
| acos() | Computes the angle in radians whose cosine is a given number. |
| asin() | Computes the angle in radians whose sine is a given number. |
| atan() | Computes the angle in radians whose tangent is a given number. |
| cos() | Computes the cosine of an angle expressed in radian. |
| cosh() | Computes the hyperbolic cosine of an angle expressed in radian. |
| cot() | Computes the cotangent of an angle expressed in radian. |
| degrees() | Converts an angle from radians to degrees. |
| radians() | Converts an angle from degrees to radians. |
| sin() | Computes the sine of an angle expressed in radian. |
| sinh() | Computes the hyperbolic sine of an angle expressed in radian. |
| tan() | Computes the tangent of an angle expressed in radian. |
| tanh() | Computes the angle in radians whose cosine is a given number. |
String Functions
| Function | Description |
|---|
| char_length() | Returns the number of characters in a string. |
| byte_length() | Returns the number of bytes in a string. |
| lower() | Converts all characters to lowercase. |
| upper() | Converts all characters to uppercase. |
| left() | Returns the specified number of leftmost characters. |
| right() | Returns the specified number of rightmost characters. |
| substring() | Returns a substring from the given string. |
| trim() | Removes characters from either end of a string. |
| ltrim() | Removes characters from the beginning of a string. |
| rtrim() | Removes characters from the end of a string. |
| btrim() | Removes characters from both ends of a string. |
| replace() | Replaces all occurrences of a substring with another string. |
| split() | Splits a string by a delimiter into a list. |
| contains() | Returns true if a string contains the specified substring. |
| starts_with() | Returns true if a string starts with the specified prefix. |
| ends_with() | Returns true if a string ends with the specified suffix. |
| normalize() | Converts a string to a Unicode normalization form. |
| hex() | Encodes a string to hexadecimal. |
| unhex() | Decodes a hexadecimal string to bytes. |
| base64() | Encodes a string to a Base64 string. |
| unbase64() | Decodes a Base64 string to bytes. |
List Functions
| Function | Description |
|---|
| head() | Returns the first element in a list. |
| last() | Returns the last element of a list. |
| tail() | Returns all elements except the first. |
| size() | Returns the number of elements in a list. |
| append() | Adds an element to the end of a list. |
| range() | Generates a list of integers. |
| list_contains() | Returns true if a value exists in a specified list. |
| list_union() | Returns the union of two lists. |
| intersection() | Returns the intersection of two lists. |
| difference() | Returns the difference between two lists. |
| list_sort() | Sorts a list. |
| list_filter() | Filters a list by a condition. |
| reduce() | Performs a calculation iteratively using each element in a list. |
Datetime Functions
Spatial Functions
Function | Description |
|---|
| point() | Creates a two-dimensional geographical coordinate. |
| point3d() | Creates a three-dimensional Cartesian coordinate. |
| distance() | Computes the distance between two points. |
| pointget() | Extracts a coordinate value from a point by index. |
Null Functions
| Function | Description |
|---|
| coalesce() | Returns the first non-null value from the argument list. |
| nullif() | Returns null if two arguments are equal; otherwise returns the first. |
Utility Functions
| Function | Description |
|---|
| cardinality() | Returns the size of a path, list, or record. |
| typeof() | Returns the type name of a value as a string. |
| all_different() | Returns true if all arguments are different graph elements. |
Type Conversion Functions
Table Functions
Function | Description |
|---|
| table() | Constructs a table. |
AI & Vector Functions
Database Functions