Query Language Keywords & Reserved Words

The page lists the reserved words and non-reserved keywords used in the GSQL query language.

There is a separate list for DDL Keywords & Reserved Words. The compiler will reject the use of a Reserved Word as a user-defined identifier.

Reserved words

The following words are reserved for use by the GSQL query language. That is, a query may not use any of these words for a user-defined identifier, such as the name of a local variable or a local TUPLE type.

You should also not use words from this list to name vertex or edge types. While GSQL will not raise an error when you define the types, you will not be able to reference the types in a query.

Query Language Reserved Words
ACCUM               AND                 ANY                 API
AS                  ASC                 AVG                 BAG
BATCH               BETWEEN             BOOL                BOTH
BREAK               BY                  CASE                CATCH
COALESCE            COMPRESS            CONTINUE            COUNT
CREATE              DATETIME            DATETIME_ADD        DATETIME_SUB
DELETE              DESC                DISTRIBUTED         DO
DOUBLE              EDGE                ELSE                END
ESCAPE              EXCEPTION           FALSE               FILE
FILTER              FLOAT               FOR                 FOREACH
FROM                GRAPH               GROUP               GSQL_INT_MAX
GSQL_INT_MIN        GSQL_UINT_MAX       HAVING              IF
IN                  INSERT              INT                 INTERPRET
INTERSECT           INTERVAL            INTO                IS
ISEMPTY             JSONARRAY           JSONOBJECT          LASTHOP
LEADING             LIKE                LIMIT               LIST
LOAD_ACCUM          LOG                 MAP                 MATCH
MAX                 MIN                 MINUS               NOT
NOW                 NULL                OFFSET              OR
ORDER               PATH                PER                 PINNED
POST_ACCUM          POST-ACCUM          PRIMARY_ID          PRINT
QUERY               RAISE               RANGE               REPLACE
RESET_COLLECTION_ACCUM                  RETURN              RETURNS
RUN                 SAMPLE              SELECT              SELECT_VERTEX
SET                 SRC                 STATIC              STRING
SUM                 SYNTAX              TARGET              TAGS
TGT                 THEN                TO                  TO_CSV
TO_DATETIME         TRAILING            TRIM                TRUE
TRY                 TUPLE               TYPEDEF             UINT
UNION               UPDATE              VALUES              VERTEX
WHEN                WHERE               WHILE               WITH

Non-reserved keywords

These keywords in the language are non-reserved, so users may use them for user-defined identifiers.

Query language non-reserved keywords
LIST    MAP     LOG     NOW
TO_DATETIME     UPDATE  FILE
PER     PATH    REPLACE MATCH
SRC     TGT     LASTHOP GROUP
BY      COMMIT  ABORT   DISTINCT
INSERT