This section contains a summary of all functions supported in GQL.
Function Naming Convention
For function names that follow the camelCase convention (e.g., pedgeUuids()
), the name must be used exactly as defined, preserving the original capitalization.
For function names that do not follow camelCase, it is acceptable to use either all uppercase or all lowercase when referencing them (e.g., path_length()
or PATH_LENGTH()
).
Scalar Functions
Function |
Description |
---|---|
cardinality() | Returns the cardinality of a path, a list, or a record. |
cast() | Specifies a data conversion. |
element_id() | Gets the unique identifier _uuid of a graph element. |
labels() | Gets the label of a graph element. |
Path Functions
Function |
Description |
---|---|
path_length() | Returns the number of edges in a path. |
pedges() | Collects edges in a path into a list. |
pedgeUuids() | Collects the _uuid values of edges in a path into a list. |
pnodes() | Collects nodes in a path into a list. |
pnodeIds() | Collects the _id values of nodes in a path into a list. |
Aggregate Functions
Function |
Description |
---|---|
avg() | Computes the average of a set of numeric values. |
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. |
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. |
sum() | Computes the sum 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. |
exp() | Computes the value of Euler's number 𝑒 raised to the power of a given number. |
floor() | Rounds a given number down to the nearest integer. |
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. |
mod() | Computes the modulus, or the remainder when one number is divided by another. |
pi() | Returns the mathematical constant π (pi). |
power() | Raises a number to the power of another number. |
round() | Returns the nearest value of a given number, rounded to a specified position of digits. |
sqrt() | Computes the square root of a given number. |
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 |
---|---|
btrim() | Removes characters from both ends of a given string until encountering a character that is not contained in the specified set of characters. |
char_length() | Returns the number of characters in a string. |
left() | Returns a substring of the given string containing the specified number of leftmost characters. |
lower() | Converts all the characters in a given string to lowercase. |
ltrim() | Removes characters from the begining of a given string until encountering a character that is not contained in the specified set of characters. |
normalize() | Converts a string into a consistent format based on the normalization form specified. |
right() | Returns a substring of the given string containing the specified number of rightmost characters. |
rtrim() | Removes characters from the end of a given string until encountering a character that is not contained in the specified set of characters. |
trim() | Removes all the occurrences of the specified single character from either the leftmost, rightmost, or both ends of a given string. |
upper() | Converts all the characters in a given string to uppercase. |
List Functions
Function |
Description |
---|---|
append() | Adds an element to the end of a list and returns the new list. |
difference() | Returns the difference between two lists. |
elements() | Returns a list containing the nodes and edges that make up a path. |
head() | Returns the first element in a list. |
intersection() | Returns the intersection of two lists. |
listContains() | Checks whether a specified element exists in a list. |
listUnion() | Returns the union of two lists. |
reduce() | Performs a calculation iteratively using each element in a list. |
size() | Returns the number of elements in a list. |
trim() | Removes a specified number of elements from the right end of the list. |
Temporal Functions
Function |
Description |
---|---|
dateAdd() | Adds a specified time interval to a given date. |
dateDiff() | Computes the difference between two dates and returns the result as a specified unit of time. |
dateFormat() | Prints a given date in the specific format. |
dayOfWeek() | Returns a number representing the day of the week for a given date. |
now() | Returns the current date and time in Coordinated Universal Time (UTC). |
Spatial Functions
Function |
Description |
---|---|
distance() | Computes the straight-line distance between two points. |
point() | Combines two numbers representing latitude and longitude into a point. |
Table Functions
Function |
Description |
---|---|
table() | Constructs a table. |
Predicate Functions
Function |
Description |
---|---|
all_different() | Determines whether all graph elements bound to a list of element variables are pairwise different from one another. |
exists() | Determines if a referenced graph element has a property. |
property_exists() | Determines if a referenced graph element has a property. |
same() | Determines whether all element variables bind to the same graph element. |