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

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


        {
            // Use the reference query engine
            // Create a table for the input stream (so it uses working memory at this point,
            // which is why this is not the preferred way). 
            // Then join to expression for this stage.
            Table table = TableFactory.create(input) ;
            Op op2 = OpJoin.create(OpTable.create(table), filter) ;
            return Algebra.exec(op2, execCxt.getDataset()) ;
        }       
       
        // Use the default, optimizing query engine.
View Full Code Here


        this.right = right ;
        this.result = calc(left, right, joinType, exprs, execCxt) ;
    }

    private static QueryIterator calc(QueryIterator left, QueryIterator right, JoinType joinType, ExprList exprs, ExecutionContext execCxt) {
        Table tableRight = TableFactory.create(right) ;
        return TableJoin.joinWorker(left, tableRight, joinType, exprs, execCxt) ;

    }
View Full Code Here

   
    @Override public Op transform(OpTable opTable)
    {
        if ( opTable.isJoinIdentity() )
            return opTable ;
        Table table = opTable.getTable() ;
        if ( table.isEmpty() )
            return opTable ;
        if ( TableUnit.isTableUnit(table) )
            return opTable ;
        if ( table.getVars().size() == 0 )
            return opTable ;
        Table table2 = NodeTransformLib.transform(table, transform) ;
        return OpTable.create(table2) ;
    }
View Full Code Here

        if ( binding.vars().hasNext() )
            op = Substitute.substitute(op, binding) ;

        ExecutionContext execCxt = new ExecutionContext(context, dsg.getDefaultGraph(), dsg, QC.getFactory(context)) ;
        Evaluator eval = EvaluatorFactory.create(execCxt) ;
        Table table = Eval.eval(eval, op) ;
        QueryIterator qIter = table.iterator(execCxt) ;
        return QueryIteratorCheck.check(qIter, execCxt) ;
    }
View Full Code Here

            }
            possibleValues.get(inequalityTest.getLeft()).add(inequalityTest.getRight());
        }

        // Then combine them into all possible rows to be eliminated
        Table table = buildTable(possibleValues);

        // Then apply the MINUS
        return OpMinus.create(op, OpTable.create(table));
    }
View Full Code Here

    }

    private static Table buildTable(Map<Var, Set<NodeValue>> possibleValues) {
        if (possibleValues.size() == 0)
            return TableFactory.createEmpty();
        Table table = TableFactory.create();

        // Although each filter condition must apply for a row to be accepted
        // they are actually independent since only one condition needs to fail
        // for the filter to reject the row. Thus for each unique variable/value
        // combination a single row must be produced
        for (Var v : possibleValues.keySet()) {
            for (NodeValue value : possibleValues.get(v)) {
                BindingMap b = BindingFactory.create();
                b.add(v, value.asNode());
                table.addBinding(b);
            }
        }
        return table;
    }
View Full Code Here

        {
            // Use the reference query engine
            // Create a table for the input stream (so it uses working memory at this point,
            // which is why this is not the preferred way). 
            // Then join to expression for this stage.
            Table table = TableFactory.create(input) ;
            Op op2 = OpJoin.create(OpTable.create(table), filter) ;
            return Algebra.exec(op2, execCxt.getDataset()) ;
        }       
       
        // Use the default, optimizing query engine.
View Full Code Here

    Table getResult()
    {
        if ( stack.size() != 1 )
            Log.warn(this, "Warning: getResult: stack size = "+stack.size()) ;
       
        Table table = pop() ;
        return table ;
    }
View Full Code Here

    }
   
    @Override
    public void visit(OpBGP opBGP)
    {
        Table table = evaluator.basicPattern(opBGP.getPattern()) ;
        push(table) ;
    }
View Full Code Here

        visit(opQuad.asQuadPattern()) ;
    }
    @Override
    public void visit(OpPath opPath)
    {
        Table table = evaluator.pathPattern(opPath.getTriplePath()) ;
        push(table) ;
    }
View Full Code Here

TOP

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

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.