Package com.hp.hpl.jena.sparql.algebra

Examples of com.hp.hpl.jena.sparql.algebra.Op


    }

    // Modularize.
    private static Op transformFilterConditional(ExprList exprs, Set<Var> varScope, OpConditional opConditional) {
        // Any filters that depend on no variables.
        Op op = insertAnyFilter(exprs, varScope, null);
        Op left = opConditional.getLeft();
        left = transform(exprs, varScope, left);
        Op right = opConditional.getRight();
        op = new OpConditional(left, right);
        op = insertAnyFilter(exprs, varScope, op);
        return op;
    }
View Full Code Here


    }
   
    @Override
    protected QueryIterator nextStage(Binding outerBinding)
    {
        Op op = QC.substitute(opService, outerBinding) ;
        boolean silent = opService.getSilent() ;
        QueryIterator qIter ;
        try {
            qIter = Service.exec((OpService)op, getExecContext().getContext()) ;
            // This iterator is materialized already otherwise we may end up
View Full Code Here

    /** Compress multiple filters:  (filter (filter (filter op)))) into one (filter op) */
    public static OpFilter tidy(OpFilter base)
    {
        ExprList exprs = new ExprList() ;
       
        Op op = base ;
        while ( op instanceof OpFilter )
        {
            OpFilter f = (OpFilter)op ;
            exprs.addAll(f.getExprs()) ;
            op = f.getSubOp() ;
View Full Code Here

                // e.g. variable bound to a literal or blank node.
                throw new ARQInternalErrorException("QueryIterGraphInner.buildIterator: Not a URI or balnk node: "+graphNode) ;
           
            // Think about avoiding substitution.
            // If the subpattern does not involve the vars from the binding, avoid the substitute. 
            Op op = QC.substitute(opGraph.getSubOp(), binding) ;
           
            // We can't just use DatasetGraph.getGraph because it may "auto-create" graphs.
            // Use the containsGraph function.
           
            boolean syntheticGraph = ( Quad.isDefaultGraph(graphNode) || Quad.isUnionGraph(graphNode) ) ;
View Full Code Here

*/
public class TransformFilterImplicitJoin extends TransformCopy {

    @Override
    public Op transform(OpFilter opFilter, Op subOp) {
        Op op = apply(opFilter.getExprs(), subOp);
        if (op == null)
            return super.transform(opFilter, subOp);
        return op;
    }
View Full Code Here

        // enhancement to this optimizer
        if (varsMentioned.size() != joins.size() * 2)
            return null;

        // ---- Check if the subOp is the right shape to transform.
        Op op = subOp;

        // Special case : deduce that the filter will always "eval unbound"
        // hence eliminate all rows. Return the empty table.
        if (testSpecialCaseUnused(subOp, joins, remaining))
            return OpTable.empty();
View Full Code Here

            // If the varsLeft are disjoint from assigned vars,
            // we may be able to push assign down right
            // (this generalises the unit table case specialcase1)
            // Needs more investigation.

            Op opLeft = opleftjoin.getLeft();
            Set<Var> varsLeft = OpVars.visibleVars(opLeft);
            if (varsLeft.containsAll(varsEquality))
                return true;
            return false;
        }
View Full Code Here

    private static List<Op> processSpecialCaseOptional(List<Op> ops, List<Pair<Var, Var>> joins) {
        List<Op> ops2 = new ArrayList<Op>();
        Collection<Var> vars = varsMentionedInImplictJoins(joins);

        for (Op op : ops) {
            Op op2 = op;
            if (safeToTransform(joins, vars, op)) {
                for (Pair<Var, Var> p : joins)
                    op2 = processFilterWorker(op, p.getLeft(), p.getRight());
            }
            ops2.add(op2);
View Full Code Here

        }
        return ops2;
    }

    private static Op rebuild(Op2 subOp, List<Op> ops) {
        Op chain = OpTable.unit();
        for (Op op : ops) {
            chain = subOp.copy(chain, op);
        }
        return chain;
    }
View Full Code Here

    private static Op processFilterWorker(Op op, Var find, Var replace) {
        return subst(op, find, replace);
    }

    private static Op subst(Op subOp, Var find, Var replace) {
        Op op = Substitute.substitute(subOp, find, replace);
        return OpAssign.assign(op, find, new ExprVar(replace));
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sparql.algebra.Op

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.