GQL Specification Reference

Geode implements the ISO/IEC 39075:2024 Graph Query Language (GQL) 100% compliance. This reference documents the specification and links to Geode’s current conformance profile and implementation notes.

Standard Overview

ISO/IEC 39075:2024

The Graph Query Language (GQL) is an international standard for querying property graph databases. It provides:

  • Declarative graph pattern matching
  • Standard data types and operators
  • Transaction semantics
  • Error handling with standardized codes
  • Extensibility for implementations

Document Structure

The GQL standard comprises multiple parts:

PartTitleStatus in Geode
Part 1FrameworkImplemented
Part 2FoundationImplemented
Part 3GQL Query LanguageImplemented
Part 4BindingsImplemented

Conformance Profile

Geode Conformance Level

Geode publishes a conformance profile for ISO/IEC 39075:2024 compliance. The profile documents implementation-defined behavior and focuses on deterministic ordering, pagination, and diagnostics.

Profile highlights (non-exhaustive):

  • MATCH / OPTIONAL MATCH with bounded path expansions
  • WHERE, RETURN, ORDER BY
  • LIMIT / OFFSET (unordered pagination rejected per US001)
  • Set operations: UNION, INTERSECT, EXCEPT
  • Data modification statements (CREATE, INSERT, UPDATE, DELETE, MERGE)
  • Schema and type system behaviors (labels, property types, constraints, indexes)
  • Transactions, functions, and standardized error codes

See the conformance profile for authoritative scope, diagnostics, and implementation-defined behaviors.


Syntax Reference

Query Structure

<gql-query> ::=
    [ <graph-specification> ]
    <query-expression>

<query-expression> ::=
    <simple-query>
  | <composite-query>

<simple-query> ::=
    <match-statement>
  | <call-statement>
  | <return-statement>

<composite-query> ::=
    <simple-query> <set-operator> <simple-query>

Pattern Syntax

<pattern> ::=
    <node-pattern>
  | <path-pattern>

<node-pattern> ::=
    '(' [ <variable> ] [ <label-expression> ] [ <property-specification> ] ')'

<label-expression> ::=
    ':' <label-name> [ <label-expression> ]

<property-specification> ::=
    '{' <property-list> '}'

<property-list> ::=
    <property-setting> [ ',' <property-setting> ]*

<property-setting> ::=
    <property-name> ':' <expression>

Relationship Pattern

<relationship-pattern> ::=
    <left-arrow>? '-' [ <relationship-detail> ] '-' <right-arrow>?

<relationship-detail> ::=
    '[' [ <variable> ] [ <type-expression> ] [ <length-specification> ] [ <property-specification> ] ']'

<type-expression> ::=
    ':' <relationship-type>
  | ':' <relationship-type> '|' <type-expression>

<length-specification> ::=
    '*' [ <range> ]

<range> ::=
    <integer> [ '..' [ <integer> ] ]
  | '..' <integer>

Data Types (ISO Mapping)

Core Types

ISO TypeGQL SyntaxGeode TypeNotes
BooleanBOOLEANBOOLEANtrue/false
Signed IntegerINTEGERINT6464-bit default
Floating PointREALFLOAT64IEEE 754 double
Character StringSTRINGSTRINGUTF-8
Byte StringBYTESBYTESBinary data

Extended Types

ISO TypeGQL SyntaxGeode TypeNotes
DateDATEDATEISO 8601
TimeTIMETIMEWith/without TZ
TimestampTIMESTAMPTIMESTAMPISO 8601
DurationDURATIONDURATIONISO 8601
ListLIST<T>LISTOrdered collection
MapMAP<K,V>MAPKey-value pairs

Implementation-Defined Types

Geode extends the standard with additional types:

Geode TypeCategoryStandard Mapping
VECTOR_F32NumericImplementation-defined
LATLONGeographicImplementation-defined
JSONBStructuredSTRING with semantics
UUIDIdentitySTRING with semantics
IPADDRNetworkSTRING with semantics

Operators (ISO Mapping)

Comparison Operators

ISO OperatorSymbolGeode Support
Equals=Full
Not Equals<>Full
Less Than<Full
Greater Than>Full
Less Than or Equal<=Full
Greater Than or Equal>=Full
Is NullIS NULLFull
Is Not NullIS NOT NULLFull

Logical Operators

ISO OperatorSymbolGeode Support
AndANDFull
OrORFull
NotNOTFull
Exclusive OrXORFull

Arithmetic Operators

ISO OperatorSymbolGeode Support
Addition+Full
Subtraction-Full
Multiplication*Full
Division/Full
Modulo%Full
Unary Minus-Full
Unary Plus+Full

String Operators

ISO OperatorSyntaxGeode Support
Concatenation||Full
Starts WithSTARTS WITHFull
Ends WithENDS WITHFull
ContainsCONTAINSFull
LikeLIKEFull
Regex Match=~Full

Collection Operators

ISO OperatorSyntaxGeode Support
InINFull
Index Access[i]Full
Range Access[i..j]Full

Functions (ISO Mapping)

Aggregate Functions

ISO FunctionGeode SupportNotes
COUNT(*)FullRow count
COUNT(expr)FullNon-null count
COUNT(DISTINCT expr)FullDistinct count
SUM(expr)FullNumeric sum
AVG(expr)FullAverage
MIN(expr)FullMinimum
MAX(expr)FullMaximum
COLLECT(expr)FullCollect to list

Scalar Functions

ISO FunctionGeode SupportCategory
abs(x)FullNumeric
ceil(x)FullNumeric
floor(x)FullNumeric
round(x)FullNumeric
sign(x)FullNumeric
sqrt(x)FullNumeric
lower(s)FullString
upper(s)FullString
trim(s)FullString
ltrim(s)FullString
rtrim(s)FullString
substring(s, start, len)FullString
replace(s, from, to)FullString
length(s)FullString/List
size(list)FullList
head(list)FullList
tail(list)FullList
last(list)FullList
keys(map)FullMap
values(map)FullMap

Path Functions

ISO FunctionGeode SupportDescription
nodes(path)FullNodes in path
relationships(path)FullRelationships in path
length(path)FullPath length

Type Functions

ISO FunctionGeode SupportDescription
type(r)FullRelationship type
labels(n)FullNode labels
id(n)FullInternal ID
properties(n)FullProperty map

Error Handling

ISO Status Codes

Geode implements standard GQL status codes:

CodeCategoryDescription
00000SuccessSuccessful completion
01xxxWarningWarning condition
02xxxNo DataQuery returned empty
22xxxData ExceptionData error
23xxxIntegrity ViolationConstraint violation
42xxxSyntax/AccessSyntax error or access violation

Error Response Format

{
  "type": "ERROR",
  "code": "42000",
  "sqlstate": "42000",
  "message": "Syntax error at position 15",
  "detail": "Unexpected token 'METCH', did you mean 'MATCH'?",
  "position": {
    "line": 1,
    "column": 15
  }
}

Transaction Semantics

Isolation Levels

LevelISO SectionGeode Support
READ UNCOMMITTED9.5.1Not supported (minimum is READ COMMITTED)
READ COMMITTED9.5.2Full
REPEATABLE READ9.5.3Full
SERIALIZABLE9.5.4Full (default)

ACID Guarantees

PropertyImplementation
AtomicityAll-or-nothing via WAL
ConsistencyConstraint enforcement
IsolationMVCC with snapshot isolation
DurabilityWAL + checkpointing

Implementation-Defined Behavior

The ISO standard allows implementations to define certain behaviors:

Collation and Ordering

-- Geode's default collation is Unicode binary
MATCH (p:Person)
RETURN p.name
ORDER BY p.name;  -- Unicode code point order

-- Case-insensitive comparison
WHERE lower(p.name) = lower($search)

NULL Ordering

-- NULLs sort last by default (configurable)
ORDER BY p.age ASC NULLS LAST
ORDER BY p.age DESC NULLS FIRST

Identifier Length

ElementMaximum Length
Label name65,535 characters
Property name65,535 characters
Variable name65,535 characters
Index name65,535 characters

Numeric Precision

TypePrecision
INTEGER64-bit signed
FLOATIEEE 754 double (64-bit)
DECIMALArbitrary precision

Conformance Testing

Running Conformance Tests

cd geode
make test-gql-conformance

Test Categories

  1. Lexer Tests: Token recognition
  2. Parser Tests: Syntax validation
  3. Semantic Tests: Type checking, resolution
  4. Execution Tests: Correct results
  5. Error Tests: Proper error handling

Test Results Summary

Conformance tests are tracked against the published ISO/IEC 39075:2024 profile. For current status, diagnostics, and implementation-defined behaviors, see the conformance profile and the CI evidence linked there.


Extensions Beyond Standard

Geode provides extensions not in the ISO standard:

-- BM25 full-text search (Geode extension)
MATCH (d:Document)
WHERE fulltext_match(d.content, 'graph database')
RETURN d.title, bm25_score(d.content, 'graph database') AS score
ORDER BY score DESC;

Vector Similarity

-- Vector similarity search (Geode extension)
MATCH (d:Document)
RETURN d.title, vector_distance_cosine(d.embedding, $query_vector) AS distance
ORDER BY distance
LIMIT 10;

Geographic Functions

-- Geographic queries (Geode extension)
MATCH (s:Store)
WHERE geo_distance(s.location, $user_location) < 5000
RETURN s.name, geo_distance(s.location, $user_location) AS meters;

Query Hints

-- Index hints (Geode extension)
MATCH (p:Person)
USING INDEX p:Person(email)
WHERE p.email = $email
RETURN p;

Reserved Words

GQL reserved words that cannot be used as unquoted identifiers:

ALL, AND, ANY, AS, ASC, ASCENDING, BY, CALL, CASE, COMMIT, CONSTRAINT,
CONTAINS, COUNT, CREATE, DELETE, DESC, DESCENDING, DETACH, DISTINCT,
DROP, ELSE, END, ENDS, EXISTS, FALSE, FOR, FROM, GRAPH, GROUP, HAVING,
IN, INDEX, IS, LIMIT, MATCH, MERGE, NOT, NULL, ON, OPTIONAL, OR, ORDER,
REMOVE, RETURN, ROLLBACK, SESSION, SET, SKIP, START, STARTS, THEN, TO,
TRUE, UNION, UNIQUE, UNWIND, USE, USING, WHEN, WHERE, WITH, XOR, YIELD

Escaping reserved words:

-- Use backticks for reserved words as identifiers
MATCH (n:`ORDER`)
RETURN n.`LIMIT`;


Last Updated: January 28, 2026 Geode Version: v0.1.3+ ISO Standard: ISO/IEC 39075:2024 Conformance Profile: ISO/IEC 39075:2024 compliance (see conformance profile)