Package com.hp.hpl.jena.query

Examples of com.hp.hpl.jena.query.SortCondition


            // Aggregates in ORDER BY
            for ( SortCondition sc : query.getOrderBy() )
            {
                Expr e = sc.getExpression() ;
                e = ExprLib.replaceAggregateByVariable(e) ;
                scList.add(new SortCondition(e, sc.getDirection())) ;
               
            }
            op = new OpOrder(op, scList) ;
        }
       
View Full Code Here


            // Aggregates in ORDER BY
            for ( SortCondition sc : query.getOrderBy() )
            {
                Expr e = sc.getExpression() ;
                e = ExprLib.replaceAggregateByVariable(e) ;
                scList.add(new SortCondition(e, sc.getDirection())) ;
               
            }
            op = new OpOrder(op, scList) ;
        }
       
View Full Code Here

            for ( SortCondition sc : conditions )
            {
                Expr e = sc.getExpression() ;
                Expr e2 = ExprTransformer.transform(exprTransform, e) ;
                conditions2.add(new SortCondition(e2, sc.getDirection())) ;
                if ( e != e2 )
                    changed = true ;
            }
            OpOrder x = opOrder ;
            if ( changed )
View Full Code Here

                direction = Query.ORDER_DESCENDING ;
            item = item.getList().get(1) ;
        }
        Expr expr = BuilderExpr.buildExpr(item) ;
        if ( expr.isVariable() )
            return new SortCondition(expr.getExprVar().asVar(), direction) ;
        else
            return new SortCondition(expr, direction) ;
    }
View Full Code Here

    }

    @Test public void testSorting()
    {
        List<SortCondition> conditions = new ArrayList<SortCondition>();
        conditions.add(new SortCondition(new ExprVar("8"), Query.ORDER_ASCENDING));
        conditions.add(new SortCondition(new ExprVar("1"), Query.ORDER_ASCENDING));
        conditions.add(new SortCondition(new ExprVar("0"), Query.ORDER_DESCENDING));
        BindingComparator comparator = new BindingComparator(conditions);
       
        List<Binding> sorted = new ArrayList<Binding>();
       
        SortedDataBag<Binding> db = new SortedDataBag<Binding>(
View Full Code Here

    }
   
    @Test public void testTemporaryFilesAreCleanedUpAfterCompletion()
    {
        List<SortCondition> conditions = new ArrayList<SortCondition>();
        conditions.add(new SortCondition(new ExprVar("8"), Query.ORDER_ASCENDING));
        BindingComparator comparator = new BindingComparator(conditions);
       
        SortedDataBag<Binding> db = new SortedDataBag<Binding>(
                new ThresholdPolicyCount<Binding>(10),
                SerializationFactoryFinder.bindingSerializationFactory(),
View Full Code Here

        for(int i = 0; i < 500; i++){
            unsorted.add(randomBinding(vars));
        }
       
        List<SortCondition> conditions = new ArrayList<SortCondition>();
        conditions.add(new SortCondition(new ExprVar("8"), Query.ORDER_ASCENDING));
        comparator = new BindingComparator(conditions);
       
        iterator = new CallbackIterator(unsorted.iterator(), 25, null);
        iterator.setCallback(new Callback() {
            @Override
View Full Code Here

            for ( SortCondition sc : conditions )
            {
                Expr e = sc.getExpression() ;
                Expr e2 = transform(e, exprTransform) ;
                conditions2.add(new SortCondition(e2, sc.getDirection())) ;
                if ( e != e2 )
                    changed = true ;
            }
            OpOrder x = opOrder ;
            if ( changed )
View Full Code Here

                direction = Query.ORDER_DESCENDING ;
            item = item.getList().get(1) ;
        }
        Expr expr = BuilderExpr.buildExpr(item) ;
        if ( expr.isVariable() )
            return new SortCondition(expr.getExprVar().asVar(), direction) ;
        else
            return new SortCondition(expr, direction) ;
    }
View Full Code Here

    @Override
    public int compare(Binding bind1, Binding bind2)
    {
        for ( Iterator<SortCondition> iter = conditions.iterator() ; iter.hasNext() ; )
        {
            SortCondition sc = iter.next() ;
            if ( sc.expression == null )
                throw new QueryExecException("Broken sort condition") ;

            NodeValue nv1 = null ;
            NodeValue nv2 = null ;
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.query.SortCondition

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.