NeptuneGraph / Client / execute_query

execute_query#

NeptuneGraph.Client.execute_query(**kwargs)#

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

See also: AWS API Documentation

Request Syntax

response = 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
)
Parameters:
  • graphIdentifier (string) –

    [REQUIRED]

    The unique identifier of the Neptune Analytics graph.

  • queryString (string) –

    [REQUIRED]

    The query string to be executed.

  • language (string) –

    [REQUIRED]

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

  • parameters (dict) –

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

  • planCache (string) – 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.

  • explainMode (string) – 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.

  • queryTimeoutMilliseconds (integer) – Specifies the query timeout duration, in milliseconds. (optional)

Return type:

dict

Returns:

Response Syntax

{
    'payload': StreamingBody()
}

Response Structure

Exceptions