private void lift(IntermediateQueryBuilder builder, QueryNode bufferNode,
Optional<QueryNode> parentInBuilder,
IntermediateQuery sourceQuery, QueryNode sourceQueryNode,
DistinctVariableOnlyDataAtom projectionAtom) {
if (bufferNode instanceof ConstructionNode) {
liftCn(
builder,
(ConstructionNode) bufferNode,
parentInBuilder,
sourceQuery,
sourceQuery.getChildren(sourceQueryNode).iterator().next(),
projectionAtom
);
} else {
append(builder, parentInBuilder, bufferNode, projectionAtom);
sourceQuery.getChildren(sourceQueryNode)
.forEach(n -> lift(
builder,
n,
Optional.of(bufferNode),
sourceQuery,
n,
projectionAtom
));
}
}