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

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

Accessing the Neptune Graph with Gremlin

Amazon Neptune is compatible with Apache TinkerPop3 and Gremlin 3.4.1. This means that you can connect to a Neptune DB instance and use the Gremlin traversal language to query the graph (see The Graph in the Apache TinkerPop3 documentation).

A traversal in Gremlin is a series of chained steps. It starts at a vertex (or edge). It 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.

As discussed in Encryption in Transit: Connecting to Neptune Using SSL/HTTPS, you can connect to Neptune using Transport Layer Security/Secure Sockets Layer (TLS/SSL) in all AWS Regions. And there are some Regions where you can only connect using TLS/SSL. Regardless of your Region, it is a best practice to use HTTPS instead of HTTP in your connections going forward.

Gremlin-Groovy

The Gremlin Console and HTTP REST examples in this section use the Gremlin-Groovy variant. For more information about the Gremlin Console and Amazon Neptune, see the Using Gremlin to Access the Graph section of the Quick Start.

Gremlin-Java

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

Gremlin-Python

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 HTTPS, 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.