Topic: Translation and interoperation between graph database query languages: Cypher and Gremlin

My background: Dmitry Novikov, Neueda Technologies. Developer of Cypher for Gremlin [1] project.

Abstract:

Cypher for Gremlin is an open source project, a contribution to the openCypher initiative. It targets to bridge the gap between different graph database systems (both cloud and traditional) by creating a tool that translates the Cypher query language (supported by Neo4j, RedisGraph, Memgraph and Spark [2]) to Apache Tinkerpop Gremlin query language (supported by JanusGraph, Cosmos DB, AWS Neptune, etc.).

The translation process uses a reasonably sophisticated and flexible approach. Cypher query is parsed by the openCypher Frontend [3] and translated to an internal representation by the Cypher for Gremlin. The internal representation is transformed by a set of rewriters to adapt the query for system specifics of different Gremlin implementations (JanusGraph, Cosmos DB, AWS Neptune), then converted to one of Gremlin representations (Gremlin Groovy string, Traversal object or Gremlin bytecode).

In addition to integration tests, correctness of translation is verified by the Cypher Technology Compatibility Kit (TCK). The TCK is an openCypher artifact [4] and contains a comprehensive set of test scenarios validating different features of the Cypher language. In its current version, Cypher for Gremlin covers 70% of the TCK M10 and an additional 15% with specific extensions installed on the corresponding Gremlin Server. 

In Cypher for Gremlin, it becomes possible to combine Gremlin and translated Cypher, hence Cypher for Gremlin is an ideal platform for experiments with language interoperation.

Part of our study is to find the best approach to define syntax and data flow and to combine different paradigms, since Cypher is declarative, while Gremlin is imperative/declarative. As  Cypher for Gremlin could be ported to emerging GQL [5] standard, our work can provide input for foreign language syntax in GQL as well as to other investigations of query language interoperability.

Besides presenting our work, we like to to discuss different approaches to compose multi-language queries, benefits and possible use cases.

Links:

[1] https://github.com/opencypher/cypher-for-gremlin
[2] https://github.com/opencypher/cypher-for-apache-spark
[3] https://github.com/opencypher/front-end
[4] https://github.com/opencypher/openCypher/tree/master/tck
[5] https://www.gqlstandards.org/resources
