GQL Essentials / What Is GQL? Graph Query Language Explained
PDF ↗

GQL learning guide · Dominik Tomaszuk

What Is GQL? Graph Query Language Explained

GQL stands for Graph Query Language. It is a database language for property graphs, standardized as ISO/IEC 39075:2024. A property graph stores entities as nodes and connections as edges; both can carry labels and properties.

A graph represents relationships directly

In a library, a loan can connect to a book through an INCLUDES edge. The book node stores its title and ISBN. The edge can store a due date and a late fee, because these describe a particular borrowing rather than the book itself.

GQL lets a query describe this connection as a pattern. Parentheses describe nodes, brackets describe edges, and arrows describe their direction.

GQL
MATCH (l:Loan)-[i:INCLUDES]->(b:Book)
WHERE i.late_fee > 0.0
RETURN l.loanid AS loan, b.title AS title

For each matching loan-to-book connection with a positive late fee, this query returns the loan identifier and book title. It assumes the library graph is already selected. The names l, i and b bind the matched elements so later clauses can access their properties.

What does GQL cover?

Its scope includes querying and changing graph data, defining graph structures and controlling access. Query results can be binding tables: rows whose columns contain the values bound during evaluation. Learn the structure in the data model chapter and the matching rules in Patterns and Matching.

GQL, Cypher and GraphQL

Cypher and GQL share familiar pattern syntax, but compatibility depends on the implementation and feature. Compare GQL and Cypher before moving queries between systems. GraphQL is a separate API query language; this book concerns the database language GQL.

Where to start

Follow the beginner tutorial for a guided query, or read GQL by Example for the complete library setup. The ISO standard record identifies the specification; GQL Essentials is an independent explanation of its concepts.

Learn GQL

Start with a short guide, then follow links to the relevant chapters.

Search chapters, definitions and examples.