Skip to content

Nebula Graph Query Language (nGQL)

This document gives an introduction to the query language of Nebula Graph, nGQL.

What is nGQL

nGQL is a declarative graph query language for Nebula Graph. It allows expressive and efficient graph patterns. nGQL is designed for both developers and operations professionals. nGQL is an SQL-like query language, so it's easy to learn. nGQL is a project in progress. New features and optimizations are done steadily. There can be differences between syntax and implementation. Nebula Graph 2.0 or later version support openCypher 9.

What can nGQL do

  • Supports graph traverse
  • Supports pattern match
  • Supports aggregation
  • Supports graph mutation
  • Supports access control
  • Supports composite queries
  • Supports index
  • Supports most openCypher 9 graph query syntax (but mutations and controls syntax are not supported).

Example Data

The example data in Nebula Graph document statements can be downloaded here. After downloading the example data, you can import it to Nebula Graph by using the -f option in Nebula Graph Console.

Placeholder Identifiers and Values

Refer to the following standards in nGQL:

  • ISO/IEC 10646
  • ISO/IEC 39075
  • ISO/IEC NP 39075 (Draft)
  • OpenCypher 9

In template code, any token that is not a keyword, a literal value, or punctuation is a placeholder identifier or a placeholder value.

For details of the symbols in nGQL, see the following table:

Token Meaning
< > name of a syntactic element
::= formula that defines an element
[ ] optional elements
{ } explicitly specified elements
| complete alternative elements
... may be repeated any number of times

Last update: April 13, 2021
Back to top