public class NestedSequenceMerger
extends NodeVisitor
Merge nested Sequence nodes into one Sequence node.
This is here to avoid the following case:
document A B C D
#before(#before("A" d1 "C") d #before("B" d2 "D")) -> returns a false positive in index6
Therefore we merge it in:
#before("A" d1 "C" d "B" d2 "D")
We also want to avoid unconnected nesting:
#before
/ \
#or #alpha
/ \
#alpha #before
/ \
#alpha #alpha
This setting would also result in false positives.
In this case, a QueryProcessingException is thrown.
->Except for tight sequences (#seq in ELLQL)
Also ensures that all Sequence nodes are BEFORE Sequence nodes (positive distances)