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

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


    }

    @Override
    public void visit(OpReduced opReduced)
    {
        Table table = eval(opReduced.getSubOp()) ;
        table = evaluator.reduced(table) ;
        push(table) ;
    }
View Full Code Here


    }

    @Override
    public void visit(OpSlice opSlice)
    {
        Table table = eval(opSlice.getSubOp()) ;
        table = evaluator.slice(table, opSlice.getStart(), opSlice.getLength()) ;
        push(table) ;
    }
View Full Code Here

    }

    @Override
    public void visit(OpAssign opAssign)
    {
        Table table = eval(opAssign.getSubOp()) ;
        table = evaluator.assign(table, opAssign.getVarExprList()) ;
        push(table) ;
    }
View Full Code Here

    }

    @Override
    public void visit(OpExtend opExtend)
    {
        Table table = eval(opExtend.getSubOp()) ;
        table = evaluator.extend(table, opExtend.getVarExprList()) ;
        push(table) ;
    }
View Full Code Here

    }

    @Override
    public void visit(OpGroup opGroup)
    {
        Table table = eval(opGroup.getSubOp()) ;
        table = evaluator.groupBy(table, opGroup.getGroupVars(), opGroup.getAggregators()) ;
        push(table) ;
    }
View Full Code Here

            if ( symbol.equals("empty") )
                return TableFactory.createEmpty() ;
            BuilderLib.broken(list, "Don't recognized table symbol") ;
        }
       
        Table table = TableFactory.create() ;
       
        int count = 0 ;
        Binding lastBinding = null ;
        for ( int i = start ; i < list.size() ; i++ )
        {
            Item itemRow = list.get(i) ;
            Binding b = BuilderBinding.build(itemRow) ;
            table.addBinding(b) ;
            lastBinding = b ;
            count++ ;
        }
        // Was it the unit table?
       
        if ( table.size() == 1 )
        {
            // One row, no bindings.
            if ( lastBinding.isEmpty() )
                return TableFactory.createUnit() ;
        }
View Full Code Here

    {
        Node gn = opDatasetNames.getGraphNode() ;
        if ( gn.isVariable() )
        {
            // Answer is a table.
            Table t = TableFactory.create() ;
            Var v = Var.alloc(gn) ;
            for ( Node n : namedGraphs )
            {
                Binding b = BindingFactory.binding(v, n) ;
                t.addBinding(b) ;
            }
            return OpTable.create(t) ;
        }
        // Not a variable.
        if ( ! namedGraphs.contains(gn) )
View Full Code Here

    public static boolean isJoinIdentify(Op op)
    {
        if ( ! ( op instanceof OpTable ) )
            return false ;
        Table t = ((OpTable)op).getTable() ;
        // Safe answer.
        return TableUnit.isTableUnit(t) ;
    }
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

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.