GSQL Query Language
The GSQL ® Query Language is a language for the exploration and analysis of large scale graphs. The high-level language makes it easy to perform powerful graph traversal queries in the TigerGraph system. By combining features familiar to database users and programmers with highly expressive new capabilities, the GSQL query language offers both easy authoring and powerful execution.
A GSQL query is a sequence of data retrieval-and-computation statements executed as a single operation. Users can write queries to explore a data graph however they like, to read and make computations on the graph data along the way, to update the graph, and to deliver resulting data. A query is analogous to a user-defined procedure or function: it can have one or more input parameters, and it can produce output in two ways: by returning a value or by printing.
Though GSQL is SQL-like, an important distinction between SQL and GSQL queries is that a GSQL query is a sequence of statements defined as a single operation, while a SQL query tends to be a single statement that executes directly against a database.
The current default syntax version for GSQL queries is Syntax V2. Most documentation in this section describes the language in Syntax V2. To see the different between the legacy version and V2, see Query Language Syntax Versions.
The following pages describes the syntax of the GSQL Query Language:
It includes example queries that demonstrate the language, each of which works on one of the following six graphs:
The data sets are small so that you can understand the result of each query example.
The following file
gsql_ref_examples_2.0.tar.gz) contains all graph schemas, data files, and queries.