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

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


            // 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) ;
            // Place any filters now ready.
View Full Code Here

   
    // 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

                // e.g. variable bound to a literal or blank node.
                throw new ARQInternalErrorException("QueryIterGraphInner.buildIterator") ;
           
            // 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

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

        return new QueryIterDiff(left, right, execCxt) ;
    }
   
    protected QueryIterator execute(OpMinus opMinus, QueryIterator input)
    {
      Op lhsOp = opMinus.getLeft();
      Op rhsOp = opMinus.getRight();
     
        QueryIterator left = executeOp(lhsOp, input) ;
        QueryIterator right = executeOp(rhsOp, root()) ;

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

   
    protected QueryIterator execute(OpFilter opFilter, QueryIterator input)
    {
        ExprList exprs = opFilter.getExprs() ;
       
        Op base = opFilter.getSubOp() ;
        QueryIterator qIter = executeOp(base, input) ;

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

    // Add all the operations from the list to the OpN
    final private void addOps(OpN op, ItemList list)
    {
        for ( int i = 1 ; i < list.size() ; i++ )
        {
            Op sub = build(list, i) ;
            op.add(sub) ;
        }
    }
View Full Code Here

        opSame(str, SSE.parseOp(str)) ;
    }
   
    private static void opSame(String str , Op other)
    {
        Op op = SSE.parseOp(str) ;
        assertEquals(op, other) ;
    }
View Full Code Here

   
    private static void check(String queryString, String opExpectedString)
    {
        queryString = "PREFIX : <http://example/>\n"+queryString ;
        Query query = QueryFactory.create(queryString) ;
        Op opQuery = Algebra.compile(query) ;
        check(opQuery, opExpectedString) ;
    }
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.