Search in sources :

Example 1 with TupleExprAndNodes

use of org.apache.rya.indexing.external.matching.QueryNodesToTupleExpr.TupleExprAndNodes 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);
            }
        }
    }
}
Also used : TupleExprAndNodes(org.apache.rya.indexing.external.matching.QueryNodesToTupleExpr.TupleExprAndNodes) UnaryTupleOperator(org.openrdf.query.algebra.UnaryTupleOperator) BinaryTupleOperator(org.openrdf.query.algebra.BinaryTupleOperator) QueryModelNode(org.openrdf.query.algebra.QueryModelNode) TupleExpr(org.openrdf.query.algebra.TupleExpr)

Aggregations

TupleExprAndNodes (org.apache.rya.indexing.external.matching.QueryNodesToTupleExpr.TupleExprAndNodes)1 BinaryTupleOperator (org.openrdf.query.algebra.BinaryTupleOperator)1 QueryModelNode (org.openrdf.query.algebra.QueryModelNode)1 TupleExpr (org.openrdf.query.algebra.TupleExpr)1 UnaryTupleOperator (org.openrdf.query.algebra.UnaryTupleOperator)1