NeptuneGraph / Client / execute_query

execute_query#

NeptuneGraph.Client.execute_query(**kwargs)#

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.

Note

Non-parametrized queries are not considered for plan caching. You can force plan caching with planCache=enabled. The plan cache will be reused only for the same exact query. Slight variations in the query will not be able to reuse the query plan cache.

See also: AWS API Documentation

Request Syntax

response = client.execute_query(
    graphIdentifier='string',
    queryString='string',
    language='OPEN_CYPHER',
    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.

  • 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

  • (dict) –

    • payload (StreamingBody) –

      The query results.

Exceptions

  • NeptuneGraph.Client.exceptions.UnprocessableException

  • NeptuneGraph.Client.exceptions.ThrottlingException

  • NeptuneGraph.Client.exceptions.ValidationException

  • NeptuneGraph.Client.exceptions.ConflictException

  • NeptuneGraph.Client.exceptions.AccessDeniedException

  • NeptuneGraph.Client.exceptions.InternalServerException