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

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


        OpGraph op = new OpGraph(quadPattern.getGraphNode(), opBGP) ;
        return execute(op, input) ;
    }
   
    protected QueryIterator execute(OpQuadBlock quadBlock, QueryIterator input) {
        Op op = quadBlock.convertOp() ;
        return exec(op, input) ;
    }
View Full Code Here


    // Pass iterator from one step directly into the next.
    protected QueryIterator execute(OpSequence opSequence, QueryIterator input) {
        QueryIterator qIter = input ;

        for (Iterator<Op> iter = opSequence.iterator(); iter.hasNext();) {
            Op sub = iter.next() ;
            qIter = exec(sub, qIter) ;
        }
        return qIter ;
    }
View Full Code Here

        QueryIterator right = exec(opDiff.getRight(), root()) ;
        return new QueryIterDiff(left, right, execCxt) ;
    }

    protected QueryIterator execute(OpMinus opMinus, QueryIterator input) {
        Op lhsOp = opMinus.getLeft() ;
        Op rhsOp = opMinus.getRight() ;

        QueryIterator left = exec(lhsOp, input) ;
        QueryIterator right = exec(rhsOp, root()) ;

        Set<Var> commonVars = OpVars.visibleVars(lhsOp) ;
View Full Code Here

    }

    protected QueryIterator execute(OpFilter opFilter, QueryIterator input) {
        ExprList exprs = opFilter.getExprs() ;

        Op base = opFilter.getSubOp() ;
        QueryIterator qIter = exec(base, input) ;

        for (Expr expr : exprs)
            qIter = new QueryIterFilterExpr(qIter, expr, execCxt) ;
        return qIter ;
View Full Code Here

    public Op transform(OpFilter opFilter, Op x) {
        // Destructive use of exprs - copy it.
        ExprList exprs = ExprList.copy(opFilter.getExprs());
        Set<Var> varsScope = new HashSet<Var>();

        Op op = transform(exprs, varsScope, x);
        if (op == x)
            // Didn't do anything.
            return super.transform(opFilter, x);

        // Remaining exprs
View Full Code Here

    }

    // Mutates exprs
    private static Op transformFilterBGP(ExprList exprs, Set<Var> patternVarsScope, BasicPattern pattern) {
        // Any filters that depend on no variables.
        Op op = insertAnyFilter(exprs, patternVarsScope, null);

        for (Triple triple : pattern) {
            OpBGP opBGP = getBGP(op);
            if (opBGP == null) {
                // Last thing was not a BGP (so it likely to be a filter)
View Full Code Here

        if (op instanceof OpSequence) {
            // Is last in OpSequence an BGP?
            OpSequence opSeq = (OpSequence) op;
            List<Op> x = opSeq.getElements();
            if (x.size() > 0) {
                Op opTop = x.get(x.size() - 1);
                if (opTop instanceof OpBGP)
                    return (OpBGP) opTop;
                // Drop through
            }
        }
View Full Code Here

        return transformFilterQuadPattern(exprs, patternVarsScope, pattern.getGraphNode(), pattern.getBasicPattern());
    }

    private static Op transformFilterQuadPattern(ExprList exprs, Set<Var> patternVarsScope, Node graphNode, BasicPattern pattern) {
        // Any filters that depend on no variables.
        Op op = insertAnyFilter(exprs, patternVarsScope, null);
        if (Var.isVar(graphNode)) {
            // Add in the graph node of the quad block.
            // It's picked up after the first triple is processed.
            VarUtils.addVar(patternVarsScope, Var.alloc(graphNode));
        }
View Full Code Here

        if (op instanceof OpSequence) {
            // Is last in OpSequence an BGP?
            OpSequence opSeq = (OpSequence) op;
            List<Op> x = opSeq.getElements();
            if (x.size() > 0) {
                Op opTop = x.get(x.size() - 1);
                if (opTop instanceof OpQuadPattern)
                    return (OpQuadPattern) opTop;
                // Drop through
            }
        }
View Full Code Here

    private static Op transformFilterSequence(ExprList exprs, Set<Var> varScope, OpSequence opSequence) {
        List<Op> ops = opSequence.getElements();

        // Any filters that depend on no variables.
        Op op = insertAnyFilter(exprs, varScope, null);

        for (Iterator<Op> iter = ops.iterator(); iter.hasNext();) {
            Op seqElt = iter.next();
            // Process the sequence element. This may insert filters (sequence
            // or BGP)
            seqElt = transform(exprs, varScope, seqElt);
            // Merge into sequence.
            op = OpSequence.create(op, seqElt);
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.