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

Examples of com.hp.hpl.jena.sparql.algebra.table.TableN


        JoinType joinType = (leftJoin? JoinType.LEFT : JoinType.PLAIN ) ;
        QueryIterator qIter = TableJoin.joinWorker(left, tableRight, joinType, conditions, execCxt) ;
        tableLeft.close() ;
        tableRight.close() ;
        // qIter and left should be properly closed by use or called code.
        return new TableN(qIter) ;
    }
View Full Code Here


   
    // @@ Abstract compatibility
    private Table diffWorker(Table tableLeft, Table tableRight)
    {
        QueryIterator left = tableLeft.iterator(execCxt) ;
        TableN r = new TableN() ;
        for ( ; left.hasNext() ; )
        {
            Binding b = left.nextBinding() ;
            if ( tableRight.contains(b) )
                r.addBinding(b) ;
        }
        tableLeft.close() ;
        tableRight.close() ;
        return r ;
    }
View Full Code Here

   
    private Table minusWorker(Table tableLeft, Table tableRight)
    {
        // Minus(Ω1, Ω2) = { μ | μ in Ω1 such that for all μ' in Ω2, either μ and μ' are not compatible or dom(μ) and dom(μ') are disjoint }
       
        TableN results = new TableN() ;
        QueryIterator iterLeft = tableLeft.iterator(execCxt) ;
        for ( ; iterLeft.hasNext() ; )
        {
            Binding bindingLeft = iterLeft.nextBinding() ;
            boolean includeThisRow = true ;
            // Find a reason not to include the row.
            // That's is not disjoint and not compatible.
           
            QueryIterator iterRight = tableRight.iterator(execCxt) ;
            for ( ; iterRight.hasNext() ; )
            {
                Binding bindingRight = iterRight.nextBinding() ;
                if ( Algebra.disjoint(bindingLeft, bindingRight) )
                    // Disjoint - not a reason to exclude
                    continue ;
               
                if ( ! Algebra.compatible(bindingLeft, bindingRight) )
                    // Compatible - not a reason to exclude.
                    continue ;
               
                includeThisRow = false ;
                break ;
               
            }
            iterRight.close();
            if ( includeThisRow )
                results.addBinding(bindingLeft) ;
        }

        iterLeft.close();
        return results ;
    }
View Full Code Here

   
    public static Table createEmpty()
    { return new TableEmpty() ; }

    public static Table create()
    { return new TableN() ; }
View Full Code Here

        {
            queryIterator.close();
            return createUnit() ;
        }
       
        return new TableN(queryIterator) ; }
View Full Code Here

           
        Set<String> vars1 = new HashSet<String>() ;
        vars1.addAll(left.getVarNames()) ;
        vars1.addAll(right.getVarNames()) ;
       
        TableN results = new TableN(qIter) ;
        boolean b = TableCompare.equalsByTerm(expected, results) ;
        if ( !b ) {
            System.out.println("** Expected") ;
            System.out.println(expected) ;
            System.out.println("** Actual") ;
View Full Code Here

           
        Set<String> vars1 = new HashSet<>() ;
        vars1.addAll(left.getVarNames()) ;
        vars1.addAll(right.getVarNames()) ;
       
        TableN results = new TableN(qIter) ;
        boolean b = TableCompare.equalsByTerm(expected, results) ;
        if ( !b ) {
            System.out.println("** Expected") ;
            System.out.println(expected) ;
            System.out.println("** Actual") ;
View Full Code Here

        {
            Binding b = iter.nextBinding() ;
            if ( expressions.isSatisfied(b, execCxt) )
                output.add(b) ;
        }
        return new TableN(new QueryIterPlainWrapper(output.iterator(), execCxt)) ;
    }
View Full Code Here

            dump(tableRight) ;
        }
        QueryIterConcat output = new QueryIterConcat(execCxt) ;
        output.add(tableLeft.iterator(execCxt)) ;
        output.add(tableRight.iterator(execCxt)) ;
        return new TableN(output) ;
    }
View Full Code Here

    @Override
    public Table order(Table table, List<SortCondition> conditions)
    {
        QueryIterator qIter = table.iterator(getExecContext()) ;
        qIter = new QueryIterSort(qIter, conditions, getExecContext()) ;
        return new TableN(qIter) ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sparql.algebra.table.TableN

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.