Fully bound property paths like the following:
<X> rdfs:subPropertyOf+ <Y> .
Should run first within the join group. And even if they don't run first, they should not filter out incoming solutions unnecessarily.
Currently an arbitrary length path node like the one above will get pushed into last place in its group by the ASTPropertyPathOptimizer. That optimizer does not respect the original ordering of the group, because it expects other optimizers to get the ordering right later (they do not).
When a fully bound ALP node has incoming bindings, for some reason it just filters these incoming bindings down to one solution. This needs to be fixed. Once fixed, the query will product the right answer, but the execution will be terribly inefficient. A fully bound ALP node is extremely selective and really needs to be recognized and run first.
So there are two issues in one here:
1. ArbitraryLengthPathOp needs to be fixed to stop filtering in the above case.
2. Fully bound property paths need to be run first because of their great selectivity. This should also be done for fully bound filter exists and filter not exists.