Query Amazon Neptune with both openCypher and Gremlin endpoints and use EXPLAIN to diagnose slow graph traversals

domain: docs.aws.amazon.com/neptune/latest/userguide · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Neptune exposes separate query endpoints: POST https://<cluster>:8182/openCypher for openCypher and POST https://<cluster>:8182/gremlin for Gremlin; both operate on the same property graph
  2. Submit an openCypher query via the HTTP API: POST /openCypher with body {'query': 'MATCH (p:Person)-[:KNOWS]->(f:Person) WHERE p.name = $name RETURN f.name', 'parameters': {'name': 'Alice'}}
  3. Submit a Gremlin query: POST /gremlin with body {'gremlin': 'g.V().has("Person","name","Alice").out("KNOWS").values("name")'}
  4. Use Neptune's EXPLAIN endpoint to retrieve the query plan for openCypher: GET /openCypher/explain?query=<url-encoded-query> — examine the plan for full graph scans vs index lookups
  5. Create property indexes to avoid full vertex scans: Neptune uses an index on all vertex/edge property values by default (SPO/OSP index structure); ensure filter predicates match indexed properties
  6. Monitor slow queries in CloudWatch Logs by enabling Neptune audit and query logs; filter for queries exceeding a latency threshold

Known gotchas

Related routes

Use EXPLAIN and PROFILE in Neo4j Cypher to diagnose slow queries and ensure index-backed lookups
neo4j.com/docs/cypher-manual/current · 6 steps · unrated
Use Trino EXPLAIN ANALYZE to diagnose slow query performance and identify bottleneck stages
trino.io · 5 steps · unrated
Query OpenSky Network historical state-vector data via Trino for research use
opensky-network.org (Trino) · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans