The maze of graph query languages can be difficult as there are a number of similarly named languages with subtle differences. This document contains a very brief description of popular graph query languages.

Languages

Property graphs

A number of languages exist for defining graph queries over property graphs. Here’s a list of 10 popular languages:

  • Cypher: The declarative graph query language used by the Neo4j graph database. Cypher popularized the ASCII art syntax for defining graph patterns.
  • openCypher: A subset of the Cypher language with a permissive license and a test kit (Technology Compatibility Kit), released in 2016. (repository)
  • PGQL: The SQL-based declarative graph query language introduced by Oracle and used in Oracle PGX. (repository)
  • G-CORE: A composable graph language designed by members of the Linked Data Benchmark Council, published in 2018. (paper)
  • GQL: A composable graph query language that combines the traits of openCypher, PGQL, and G-CORE. ISO standardization is in progress and to be completed around 2022.
  • SQL/PGQ: A property graph query extension to the SQL standard that uses similar syntax for graph patterns as GQL. To be released in 2022.
  • GraphQL: A query language designed for REST and other web APIs. GraphQL is not a fully featured graph query language – its expressive power is more limited than that of the previous ones.
  • DQL: The GraphQL-based language used by the Dgraph graph database with extensions for transactions, aggregation, etc. Similarly to GraphQL, DQL’s experssive power is more limited than that of other graph query languages. (DQL was previously called GraphQL+-.)
  • GSQL: The mixed imperative/declarative query language used in the TigerGraph database.
  • Gremlin: A largely imperative graph query language focusing on traversal operations (graph navigation). Gremlin is a part of the Apache TinkerPop framework which is implemented by the JanusGraph database.

Semantic web

In the semantic web space, SPARQL is fairly ubiquitous due to its early standardization. That said, other languages (such as Graql) have been gaining traction in recent years.

  • SPARQL: The W3C standard query language for RDF data.
  • SPARQL-star: An extension to SPARQL introducing nested triples on the RDF-star data model.
  • TypeQL (formerly Graql): The query language used by the Vaticle TypeDB (formerly: Grakn) knowledge graph database which has advanced graph schema modelling capabilities (based on the ER model).

There are numerous extensions to SPARQL, e.g. G-SPARQL (which introduces attributes) and SPARQAL (which adds capabilities for analytics).

Surveys