ExecuteQuery - NeptuneAnalyticsAPI

ExecuteQuery

Execute an openCypher query.

When invoking this operation in a Neptune Analytics cluster, the IAM user or role making the request must have a policy attached that allows one of the following IAM actions in that cluster, depending on the query:

  • neptune-graph:ReadDataViaQuery

  • neptune-graph:WriteDataViaQuery

  • neptune-graph:DeleteDataViaQuery

Request Syntax

POST /queries HTTP/1.1 graphIdentifier: graphIdentifier Content-type: application/json { "explain": "string", "language": "string", "parameters": { "string" : JSON value }, "planCache": "string", "query": "string", "queryTimeoutMilliseconds": number }

URI Request Parameters

The request uses the following URI parameters.

graphIdentifier

The unique identifier of the Neptune Analytics graph.

Pattern: g-[a-z0-9]{10}

Required: Yes

Request Body

The request accepts the following data in JSON format.

explain

The explain mode parameter returns a query explain instead of the actual query results. A query explain can be used to gather insights about the query execution such as planning decisions, time spent on each operator, solutions flowing etc.

Type: String

Valid Values: STATIC | DETAILS

Required: No

language

The query language the query is written in. Currently only openCypher is supported.

Type: String

Valid Values: OPEN_CYPHER

Required: Yes

parameters

The data parameters the query can use in JSON format. For example: {"name": "john", "age": 20}. (optional)

Type: String to JSON value map

Required: No

planCache

Query plan cache is a feature that saves the query plan and reuses it on successive executions of the same query. This reduces query latency, and works for both READ and UPDATE queries. The plan cache is an LRU cache with a 5 minute TTL and a capacity of 1000.

Type: String

Valid Values: ENABLED | DISABLED | AUTO

Required: No

query

The query string to be executed.

Type: String

Required: Yes

queryTimeoutMilliseconds

Specifies the query timeout duration, in milliseconds. (optional)

Type: Integer

Required: No

Response Syntax

HTTP/1.1 200 payload

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The response returns the following as the HTTP body.

payload

The query results.

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

Raised in case of an authentication or authorization failure.

HTTP Status Code: 403

ConflictException

Raised when a conflict is encountered.

HTTP Status Code: 409

InternalServerException

A failure occurred on the server.

HTTP Status Code: 500

ThrottlingException

The exception was interrupted by throttling.

HTTP Status Code: 429

UnprocessableException

Request cannot be processed due to known reasons. Eg. partition full.

HTTP Status Code: 422

ValidationException

A resource could not be validated.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: