Using command-line tools to access Amazon Neptune
You can use the AWS CLI, AWS SDKs, and HTTP tools such as curl and
awscurl to submit queries to your Neptune DB cluster. The following
sections show how to set up each tool and run basic Gremlin and openCypher queries.
Using the AWS CLI
The aws neptunedata commands let you run Gremlin and openCypher
queries, check engine status, manage bulk loads, and more. For the full command
reference, see neptunedata
in the AWS CLI Command Reference.
The following examples show how to run a basic query:
Using the AWS SDK
You can use the Neptune Data API through the AWS SDKs to run queries programmatically. The following Python examples show how to run a basic query:
Using curl and awscurl
The curlcurl 7.75.0+ with the --aws-sigv4 option to sign requests.
For more information, see
Using awscurl with temporary credentials to securely connect to a DB cluster with IAM authentication enabled.
Setting up curl for HTTPS
To connect using HTTPS (as Neptune requires in most Regions),
curl needs access to appropriate certificates. For information
about how to obtain certificates and format them into a certificate authority (CA)
store, see SSL Certificate Verificationcurl documentation.
You can specify the location of this CA certificate store using the
CURL_CA_BUNDLE environment variable. On Windows, curl
automatically looks for it in a file named curl-ca-bundle.crt. It looks first in
the same directory as curl.exe and then elsewhere on the path. For more
information, see SSL Certificate
Verification
As long as curl can locate the appropriate certificates,
it handles HTTPS connections just like HTTP connections, without extra
parameters. Examples in this documentation are based on that scenario.
For more information about the tool, see the curl man page
Query examples
The following examples show how to run a basic query using curl
and awscurl:
For more Gremlin HTTP examples, see HTTPS REST. For more openCypher HTTP examples, see HTTPS endpoint.