- Newest
- Most votes
- Most comments
Hi Dennis,
you are right - the automated re:Post Agent's response just reiterated your findings without offering a functional workaround.... .
Since you confirmed this exact query worked in 1.4.7.0 and now triggers an OOM in 1.4.8.0, this strongly points to a regression in how the DFE (Deep Graph Evaluation) engine plans the memory allocation for arbitrary-length grouped alternations.
Instead of changing your SPARQL semantics (which, as you noted, fundamentally alters the query logic), the most reliable, non-destructive workaround is to disable the DFE engine exclusively for this query. This forces Neptune to fall back to the alternative execution engine, bypassing the planner bug while keeping your original SPARQL 1.1 syntax intact.
I think you can do this by injecting the useDFE query hint:
PREFIX hint: <http://aws.amazon.com/neptune/vocab/v01/QueryHints#> PREFIX ebu: <http://www.ebu.ch/metadata/ontologies/ebucoreplus#> SELECT ?entity ?type ?ancestor WHERE { hint:Query hint:useDFE false . BIND(<http://metadatahub.bijnpo.nl/ace63a06-00de-4284-b0d3-c177dd17a624> AS ?startNode) ?startNode (ebu:promotes | ebu:isEpisodeOfSeason | ebu:isSeasonOf)* ?ancestor . ?entity (ebu:promotes | ebu:isEpisodeOfSeason | ebu:isSeasonOf)? ?ancestor . ?entity a ?type . }
For your open support case:
To help the AWS engineering team isolate the regression faster, I highly recommend running your original (failing) query against the /sparql/explain endpoint on your 1.4.8.0 instance and attaching the output to your ticket. If you still have a 1.4.7.0 instance running, attaching that explain plan for comparison will be even better.
curl -X POST --data-binary 'query=<YOUR_ORIGINAL_QUERY>' http://<your-neptune-endpoint>:8182/sparql/explain
Hope this keeps your application running smoothly while support works on the patch.
Hello Florian, thank you for your reply. Unfortunately, I already tried both with and without DFE enabled, the results are the same. This query used to be super fast before the last update, even on large graphs.
As suggested by @AWS-KRL via email. There is a workaround which was to add a query hint for the joinOrder to enforce the Engine to follow the query ordering as written:
PREFIX hint: <http://aws.amazon.com/neptune/vocab/v01/QueryHints#>
WHERE {
hint:Query hint:joinOrder "Ordered" .
This fixed our queries, however, it also exposed another problem with v1.4.8.0 - only the direct parent and child are matched. Path traversal using the zeroOrMore/zeroOrOne path operator is not working for alternative paths at this moment.
Based on the symptoms you're describing, this appears to be a memory management regression in Neptune engine version 1.4.8.0 related to how the query planner handles grouped property path alternations with arbitrary-length operators. The pattern (p1|p2|p3)* should be semantically equivalent to exploring all possible paths using any combination of those predicates, but the engine appears to be consuming excessive memory during query planning or execution for this construct.
Neptune has previously addressed similar memory issues in complex query planning scenarios. Earlier releases fixed memory explosion problems when planning complex queries with property access and multiple hops with bi-directional relationships. The fact that moving the repetition operator inside the alternation—changing to (p1*|p2*|p3*)—avoids the OOM suggests the issue is specifically in how the query planner expands and evaluates the grouped alternation pattern before applying the Kleene star operator.
You're correct that these two forms are not semantically equivalent under SPARQL 1.1. The original form (p1|p2|p3)* allows arbitrary interleaving of the three predicates in any order and combination, while (p1*|p2*|p3*) only allows paths that use exclusively one predicate type at a time. This is an important distinction for your query results.
Since you've already opened a support case, that's the appropriate path forward. The AWS Support team can investigate this regression between versions 1.4.7.0 and 1.4.8.0 and work with the Neptune engineering team on a fix. In the meantime, if the semantic difference is acceptable for your use case, the workaround can serve as a temporary solution, but I understand this may not meet your requirements.
For immediate relief while awaiting a fix, you might also consider temporarily rolling back to version 1.4.7.0 if that version met your needs without this issue, though you should weigh this against any other improvements or fixes in 1.4.8.0 that you may need.
Sources
Amazon Neptune Engine version 1.3.2.0 (2024-06-10) - Amazon Neptune
Thank you for repeating what I said in other words.
Relevant content
asked 2 years ago
- AWS OFFICIALUpdated 2 years ago

Hi Dennis, Neptune service team member here - thanks for the detailed report. If you can please share the case number we can take a deeper look at what might be going on with your query and cluster. If you prefer not to put the case number here, you can contact us using the e-mail alias neptune-repost@amazon.com and share it that way.
Hello, I will send you an email.