Updated on 2025-08-22 GMT+08:00

GQL Compatibility

For details about the GQL standard, refer to the GQL document published by ISO. GES provides minimal support for GQL (GQL minimum conformance) as follows:

  1. Supports features GG02 "Graph with a closed graph type" and GG20 "Explicit element type names".
  2. Supports Unicode 13.
  3. Supports basic data types, including: STRING, BOOLEAN, INT, and FLOAT.
  4. Supports a range of features. See the Supported Features for details.

Supported Features

The following table lists the GQL features supported by GES:

Chapter

Section

Syntax/Feature

Associated ID

Example

9 Procedure specification

9.1

<next statement>

GQ20

match (n:user) return n union all match (n:movie) return n next yield n as b match (b)-->(m) return m

13 Data-modifying statements (supported only by the database edition)

13.2

<insert statement>

-

insert (n:movie{_ID_:'1a', genres: 'Comedy|Drama'}) return n

13.3

<set statement>

GD02

match (n) where element_id(n) = '1a' set n.movieid=1 return n

13.4

<remove statement>

GD02

match (n) where element_id(n) = '1a' remove n.movieid return n

13.5

<delete statement>

-

match (n) where element_id(n) = '1a' delete n

14 Query statement

14.2

union

GQ03

return 1 as a union return 2 as a

14.4

<simple match statement>

-

match (n) return n

<optional match statement>

-

match (n) where id(n)= '1a' optional match (n)-->(m) return count(*)

14.6

<filter statement>

GQ08

match (n) where element_id(n) = '1a' return n

14.7

<let statement>

GQ09

let a=1, value b::long=2 return a,b

14.8

<for statement>

GQ10

for a in [1,2,3] return a

14.11

<return statement>

-

match (n) return n.name as name, n.age

15 Procedure calling

15.3

<named procedure call>

GP04

call db.schema()

16 Comment elements

16.4

<graph pattern>

G004

For details, see Pattern Matching.

16.5

<insert graph pattern>

-

insert (n:movie{_ID_:'1a', genres: 'Comedy|Drama'}) return n

16.7

<quantified path primary>

G036

match p=(n)-[r]->{1,3}(m) where element_id(n)= 'xx' return p

Non-local element pattern predicates

G041

let a = 'Jaws (1975) ' match (n:movie where n.title=a) return n

<full edge pattern>

G043

match (n),(m) where element_id(n)= '100' and element_id(m)= '120' optional match (n)-[r]->(m) with n,r,m optional match (n)-[r1]-(m) with n,r,r1,m optional match (n)<-[r2]-(m) return r,r1,r2

16.8

<label expression>

-

match (n:movie) return count(*)

<label disjunction>

-

match (n:movie|user) return n limit 10

<label negation>

-

match (n:!movie) return count(*)

<parenthesized label expression>

-

match (n:(!movie&!default)|user) return count(*)

16.11

<fixed quantifier>

-

For details, see "Variable-length path" in Pattern Matching.

<general quantifier>

-

match p=(n)-[r]->{,3}(m) where element_id(n)= 'xx' return p

16.13

<where clause>

-

Refer to sections 14.4 and 14.6.

16.16

<order by clause>

-

match (n:movie) return n order by n.genres asc

16.18

<limit clause>

GQ13

match (n:movie) return n skip 10 limit 10

16.19

<offset clause>

GQ12

19 Predicate

19.3

<comparison predicate>

-

let a=1,b=2 return a=b,a<>b,a<b,a>b,a<=b,a>=b

19.5

<null predicate>

-

let value a::long=1 return a is null

19.9

<label predicate>

G111

match (n) where element_id(n)= '0' return n:movie

20 Value expressions and specifications

20.4

<dynamic parameter specification>

-

See Basic Operations and Compatibility and 2.

20.7

<simple case>

-

let a =2 return case a when 1 then a+1 else a+2 end

<searched case>

-

let a =2 return case when a=1 then a+1 else a+2 end

20.9

Hrizontal Aggregation

GE09

match (n) return labels(n),count(distinct n),avg(n.age), max(n.age),min(n.age),sum(n.age)

20.10

<element_id function>

G100

match (n) where element_id(n) = '1a' return n

20.11

<property reference>

-

match (n) where element_id(n) = '1a' return n.movieid

record property

-

return {name: 'Jay',age:1}.name

20.15

<list concatenation>

-

return [1,2,3,4]||[5,6,7,8]

20.17

<list value constructor>

-

return [1,2,3,4]

20.18

<record constructor>

GV45

return {name: 'Jay', age:10, details:{salary:1}}

20.20

<boolean value expression>

-

return (true and false) or false

Boolean Xor

GE07

return true xor false

20.21

<numeric value expression>

-

return 1+2,1-2,1*2,1/2,-2

20.22

<char length expression>

-

let value s::STRING = 'hello_world' return character_length(s)

<path length expression>

GF04

match p=TRAIL (n)--{1,2}(m) where id(n)= '0' return path_length(p)

size function

GF13

let list = [1,2,3,4] return size(list)

Supported GQL Optional Features

For optional GQL features, the GQL standard provides feature IDs and names. Currently, GES supports the following features:

Feature ID

Feature Name

G004

Path variables

G011

Advanced path modes: TRAIL

G036

Quantified edges

G041

Non-local element pattern predicates

G043

Complete full edge patterns

G060

Bounded graph pattern quantifiers

G100

ELEMENT_ID function

G111

IS LABELED predicate

GD01

Updatable graphs

GD02

Graph label set changes

GE07

Boolean XOR

GE09

Horizontal aggregation

GF01

Enhanced numeric functions

GF02

Trigonometric functions

GF11

Advanced aggregate functions: binary set functions

GF13

SIZE function

GG02

Graph with a closed graph type

GG20

Explicit element type names

GP04

Named procedure calls

GQ03

Composite query: UNION

GQ08

Filter statement

GQ09

LET statement

GQ10

FOR statement: list value support

GQ12

ORDER BY and page statement: OFFSET clause

GQ13

ORDER BY and page statement: LIMIT clause

GQ20

Advanced linear composition with NEXT

GV45

Record types

GV47

Open record type

GV48

Nested record types

GV50

List value types

GV55

Path value types