SPARQL Property Path query on Dataset with multiple contexts fails to return all results


I have a small extension to the property paths tests added for that is still causing my application to break consistently for some queries.

I found a minimal extension to the current tests that is what I think is causing my application to break. If I add a single context to each of the statements from the minimal test, then the test still succeeds, but if I add two or three contexts to each of the statements, then the test fails with the same results for two contexts as it does for three.

In my application I rely on multiple contexts for each query. Inside of my application I set these up for each Query by creating a new DatasetImpl and adding the contexts using DatasetImpl.addDefaultGraph() for each graph. I could trigger the issue in the test suite by simply loading the same statements into two contexts, where loading them into only one context passed. In my application the statements may be duplicated across contexts, as I have not intentionally deduplicated the contexts.

I was able to make the test pass when the statements were loaded into multiple graphs by creating a DatasetImpl and adding only one default graph. In the case where I tried to add two of the three graphs to the DatasetImpl the test started to fail again in the same way.

Note that the new tests all fail before setBinding, so it is a slightly broader issue than the SES-1091, and the tests may need to be fine tuned or retargeted when the actual issue becomes apparent. When the tests do not fail before getting to setBinding, they all work still.

The 5 new tests for this issue, two passing and three failing in the same way, are on a branch at:





Jeen Broekstra


Peter Ansell




Fix versions

Affects versions