Amazon Neptune Graph

2024/02/12 - Amazon Neptune Graph - 1 updated api methods

Changes  Adding a new option "parameters" for data plane api ExecuteQuery to support running parameterized query via SDK.

ExecuteQuery (updated) Link ΒΆ
Changes (request)
{'parameters': {'string': {}}}

Execute an openCypher query. Currently, the SDK does not support parameterized queries. If you want to make a parameterized query call, you can use an HTTP request.

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

See also: AWS API Documentation

Request Syntax

client.execute_query(
    graphIdentifier='string',
    queryString='string',
    language='OPEN_CYPHER',
    parameters={
        'string': {...}|[...]|123|123.4|'string'|True|None
    },
    planCache='ENABLED'|'DISABLED'|'AUTO',
    explainMode='STATIC'|'DETAILS',
    queryTimeoutMilliseconds=123
)
type graphIdentifier:

string

param graphIdentifier:

[REQUIRED]

The unique identifier of the Neptune Analytics graph.

type queryString:

string

param queryString:

[REQUIRED]

The query string to be executed.

type language:

string

param language:

[REQUIRED]

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

type parameters:

dict

param parameters:

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

  • (string) --

    • (:ref:`document<document>`) --

type planCache:

string

param 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 explainMode:

string

param explainMode:

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 queryTimeoutMilliseconds:

integer

param queryTimeoutMilliseconds:

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

rtype:

dict

returns:

Response Syntax

{
    'payload': StreamingBody()
}

Response Structure

  • (dict) --

    • payload (:class:`.StreamingBody`) --

      The query results.