use of org.openrdf.query.algebra.UnaryTupleOperator in project incubator-rya by apache.
the class SparqlFluoQueryBuilder method getConstructGraphVarOrder.
private static VariableOrder getConstructGraphVarOrder(final Reduced node) {
// get child node
final QueryModelNode child = node.getArg();
Preconditions.checkArgument(child instanceof Projection || child instanceof MultiProjection);
final UnaryTupleOperator unary = (UnaryTupleOperator) child;
// get ProjectionElemList to build ConstructGraph
final List<ProjectionElemList> projections = new ArrayList<>();
if (unary instanceof Projection) {
projections.add(((Projection) unary).getProjectionElemList());
} else {
projections.addAll(((MultiProjection) unary).getProjections());
}
return getConstructGraphVarOrder(projections);
}
use of org.openrdf.query.algebra.UnaryTupleOperator in project incubator-rya by apache.
the class AbstractExternalSetMatcher method updateTupleAndNodes.
protected void updateTupleAndNodes() {
segmentNodeList = segment.getOrderedNodes();
final TupleExprAndNodes tupAndNodes = segment.getQuery();
tuple = tupAndNodes.getTupleExpr();
filters = tupAndNodes.getFilters();
unmatched = new HashSet<>();
final List<QueryModelNode> nodes = tupAndNodes.getNodes();
for (final QueryModelNode q : nodes) {
if (q instanceof UnaryTupleOperator || q instanceof BinaryTupleOperator) {
unmatched.add((TupleExpr) q);
} else if (q instanceof FlattenedOptional) {
final FlattenedOptional opt = (FlattenedOptional) q;
final TupleExpr rightArg = opt.getRightArg();
if (rightArg instanceof UnaryTupleOperator || rightArg instanceof BinaryTupleOperator) {
unmatched.add(rightArg);
}
}
}
}
Aggregations