Amazon Neptune
User Guide (API Version 2017-11-29)

Accessing the Neptune Graph with Gremlin

Amazon Neptune is compatible with Apache TinkerPop3 and Gremlin 3.3.2. This means that you can connect to a Neptune DB instance and use the Gremlin traversal language to query the graph.

A traversal in Gremlin is a series of chained steps. It starts at a vertex (or edge) and walks the graph by following the outgoing edges of each vertex and then the outgoing edges of those vertices. Each step is an operation in the traversal. For more information, see The Traversal in the TinkerPop3 documentation.

There are Gremlin language variants and support for Gremlin access in various programming languages. For more information, see On Gremlin Language Variants in the TinkerPop3 documentation.

This documentation describes how to access Neptune with the following variants and programming languages.


The Gremlin Console and HTTP REST examples in this section use the Gremlin-Groovy variant. The Gremlin Console and Amazon Neptune are covered in the Using Gremlin to Access the Graph section of the Quick Start.


The Java sample is written with the official TinkerPop3 Java implementation and uses the Gremlin-Java variant.


The Python sample is written with the official TinkerPop3 Python implementation and uses the Gremlin-Python variant.

The following sections walk you through how to use the Gremlin Console, REST over HTTP, and various programming languages to connect to a Neptune DB instance.

Before you begin, you must have the following:

  • A Neptune DB instance. For information about creating a Neptune DB instance, see Getting Started with Neptune.

  • An Amazon EC2 instance in the same virtual private cloud (VPC) as your Neptune DB instance.

For more information about loading data into Neptune, including prerequisites, loading formats, and load parameters, see Loading Data into Amazon Neptune.