Cypher to AQL Translation Service
Translate Cypher queries to AQL for use with ArangoDB using the arango-cypher2aql service, available for the Arango Contextual Data Platform
The arango-cypher2aql service translates Cypher
queries into AQL (ArangoDB Query Language).
You send a Cypher query to the service and receive the equivalent AQL query,
which you can then run against your ArangoDB deployment.
This service uses a deterministic parser and translation pipeline. It does not use a Large Language Model (LLM).
Purpose
- Bridge to AQL: Get executable AQL that runs on ArangoDB, so you can reuse existing Cypher knowledge or scripts without rewriting them manually.
- Single read-query flow: The service focuses on read-only query translation
(e.g.
MATCH ... RETURN). It does not execute the query; you run the returned AQL yourself against ArangoDB. - API use only: The translation service can be used via an HTTP API but not the web interface of the Contextual Data Platform.
High-level workflow
- Start the service:
Use the Arango Control Plane (ACP) to start an instance of the Cypher to AQL service (arango-cypher2aql) in your data platform deployment. - Determine the API path:
The platform exposes the service at a base URL (/cypher2aql/<SERVICE_ID>/v1). - Send a Cypher query:
Send aPOSTrequest to the translate endpoint (/cypher2aql) with a JSON body containing your Cypher query string - Receive AQL query:
The response contains both the original Cypher query as well as the translated AQL query in thecypherandAQLattributes when translation succeeds. If the Cypher is unsupported or invalid, the response includes an error flag and message. - Validate the query:
Review the generated AQL query and adjust it if needed. - Run the query:
Execute the returned AQL query against your ArangoDB database.
HTTP API
The service exposes a small HTTP API under the versioned path /v1/. In the
examples, replace <EXTERNAL_ENDPOINT> with your data platform endpoint
(e.g. data-platform.example.org).
All requests and responses use JSON and the application/json content type.
-k or --insecure option of cURL.Deploy an arango-cypher2aql service
Use the ACP service to create a generic service.
Example
curl -s "https://<EXTERNAL_ENDPOINT>:8529/_platform/acp/v1/service" \
-H "Authorization: bearer <YOUR_TOKEN>" \
-d '{"service_name":"arango-cypher2aql"}'
Show output
{
"serviceInfo": {
"serviceId": "arango-cypher2aql-z8fue",
"description": "Install complete",
"status": "DEPLOYED",
"namespace": "arango",
"managingEntity": "ACP"
}
}
Translate Cypher to AQL
200 OK
Translation result. When translation succeeds,
errorisfalse. When the Cypher query is invalid or uses unsupported features, the service still returns the HTTP status code200but setserrortotrue,errorCodeto 422, anderrorMessageto an explanation of the problem.Response Body application/json object
Example: successful translation
curl -s -X POST "https://<EXTERNAL_ENDPOINT>:8529/cypher2aql/<SERVICE_ID>/v1/cypher2aql" \
-H "Content-Type: application/json" \
-H "Authorization: bearer <YOUR_TOKEN>" \
-d '{"cypher":"MATCH (n:Person) RETURN n"}'
Show output
{
"cypher": "MATCH (n:Person) RETURN n",
"AQL": "FOR n IN person FILTER n != null RETURN n",
"error": false,
"errorMessage": "",
"errorCode": 0
}
Get the service version
Example
curl -s "https://<EXTERNAL_ENDPOINT>:8529/cypher2aql/<SERVICE_ID>/v1/version" \
-H "Authorization: bearer <YOUR_TOKEN>"
Show output
{
"version": "0.9.5"
}
Check the service health
Example
curl -s "https://<EXTERNAL_ENDPOINT>:8529/cypher2aql/<SERVICE_ID>/v1/health" \
-H "Authorization: bearer <YOUR_TOKEN>"
Show output
{
"status": "ok"
}
Uninstall a arango-cypher2aql service
Use the ACP service to delete the service.
Example
curl -s -X DELETE "https://<EXTERNAL_ENDPOINT>:8529/_platform/acp/v1/service/<SERVICE_ID>" \
-H "Authorization: bearer <YOUR_TOKEN>"
Show output
{
"serviceInfo": {
"serviceId": "arango-cypher2aql-z8fue",
"description": "Uninstallation complete",
"status": "UNINSTALLED",
"namespace": "arango",
"managingEntity": "ACP"
}
}
Supported Cypher subset and limitations
The translator supports a subset of Cypher focused on read-only query patterns:
Supported:
- Single-statement queries with
MATCH, optionallyWHERE,ORDER BY,SKIP,LIMIT,WITH, andRETURN. - Node and relationship patterns are constrained (e.g. no variable-length
relationships, no
OPTIONAL MATCH). - The pattern graph must be connected and acyclic.
- Only simple label expressions for nodes and relationship types (no union/intersection-style expressions).
- Aggregations are limited to standard aggregation functions.
Not supported:
- Schema changes
- Write statements (
CREATE,DELETE, etc.) UNIONOPTIONAL MATCHSHORTEST_PATH- Variable-length relationships
- More complex label or type expressions
If you send unsupported or invalid Cypher, the service returns an errorMessage
describing the issue. Use that message to adjust your query or fall back to
writing AQL directly.
