executeOpenCypherQuery method
Executes an openCypher query. See Accessing the Neptune Graph with openCypher for more information.
Neptune supports building graph applications using openCypher, which is currently one of the most popular query languages among developers working with graph databases. Developers, business analysts, and data scientists like openCypher's declarative, SQL-inspired syntax because it provides a familiar structure in which to querying property graphs.
The openCypher language was originally developed by Neo4j, then open-sourced in 2015 and contributed to the openCypher project under an Apache 2 open-source license.
Note that when invoking this operation in a Neptune cluster that has IAM authentication enabled, 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:
Note also that the neptune-db:QueryLanguage:OpenCypher IAM condition key can be used in the policy document to restrict the use of openCypher queries (see Condition keys available in Neptune IAM data-access policy statements).May throw BadRequestException.
May throw CancelledByUserException.
May throw ClientTimeoutException.
May throw ConcurrentModificationException.
May throw ConstraintViolationException.
May throw FailureByQueryException.
May throw IllegalArgumentException.
May throw InvalidArgumentException.
May throw InvalidNumericDataException.
May throw InvalidParameterException.
May throw MalformedQueryException.
May throw MemoryLimitExceededException.
May throw MissingParameterException.
May throw ParsingException.
May throw PreconditionsFailedException.
May throw QueryLimitExceededException.
May throw QueryLimitException.
May throw QueryTooLargeException.
May throw TimeLimitExceededException.
May throw TooManyRequestsException.
May throw UnsupportedOperationException.
Parameter openCypherQuery :
The openCypher query string to be executed.
Parameter parameters :
The openCypher query parameters for query execution. See Examples
of openCypher parameterized queries for more information.
Implementation
Future<ExecuteOpenCypherQueryOutput> executeOpenCypherQuery({
required String openCypherQuery,
String? parameters,
}) async {
final $payload = <String, dynamic>{
'query': openCypherQuery,
if (parameters != null) 'parameters': parameters,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/opencypher',
exceptionFnMap: _exceptionFns,
);
return ExecuteOpenCypherQueryOutput.fromJson(response);
}