Examples of ExprList


Examples of com.hp.hpl.jena.sparql.expr.ExprList

        return OpTable.create(table2) ;
    }
   
    @Override public Op transform(OpLeftJoin opLeftJoin, Op left, Op right)
    {
        ExprList exprList = opLeftJoin.getExprs() ;
        ExprList exprList2 = exprList ;
        if ( exprList != null )
            exprList2 = NodeTransformLib.transform(transform, exprList) ;
        if ( exprList2 == exprList )
            return super.transform(opLeftJoin, left, right) ;
        return OpLeftJoin.create(left, right, exprList2) ;
View Full Code Here

Examples of com.hp.hpl.jena.sparql.expr.ExprList

        }
       
        @Override
        public Op transform(OpFilter filter, Op op)
        {
            ExprList exprs = filter.getExprs().copySubstitute(binding) ;
            if ( exprs == filter.getExprs() )
                return filter ;
            return OpFilter.filter(exprs, op) ;
        }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.expr.ExprList

    public boolean isList()             { return argList != null  ; }
    public boolean isNode()             { return arg != null  ; }
   
    public ExprList asExprList(PropFuncArg pfArg)
    {
        ExprList exprList = new ExprList() ;
        if ( pfArg.isNode() )
        {
            Node n = pfArg.getArg() ;
            Expr expr = ExprUtils.nodeToExpr(n) ;
            exprList.add(expr) ;
            return exprList ;
        }
       
        for ( Iterator<Node> iter = pfArg.getArgList().iterator() ; iter.hasNext() ; )
        {
            Node n = iter.next() ;
            Expr expr = ExprUtils.nodeToExpr(n) ;
            exprList.add(expr) ;
        }
        return exprList ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.expr.ExprList

        else
            acc.add(opUnion.getRight()) ;
    }

    protected QueryIterator execute(OpFilter opFilter, QueryIterator input) {
        ExprList exprs = opFilter.getExprs() ;

        Op base = opFilter.getSubOp() ;
        QueryIterator qIter = executeOp(base, input) ;

        for (Expr expr : exprs)
View Full Code Here

Examples of com.hp.hpl.jena.sparql.expr.ExprList

    public TransformFilterDisjunction() {}
   
    @Override
    public Op transform(OpFilter opFilter, final Op subOp)
    {
        ExprList exprList = opFilter.getExprs() ;
       
        // First pass - any disjunctions at all?
        boolean processDisjunction = false ;
        for ( Expr expr : exprList )
        {
            if ( isDisjunction(expr) )
            {
                processDisjunction = true ;
                break ;
            }
        }
       
        // Still may be a disjunction in a form we don't optimize.
        if ( ! processDisjunction )
            return super.transform(opFilter, subOp) ;
       
        ExprList exprList2 = new ExprList() ;
        Op newOp = subOp ;
        // remember what's been seen so that FILTER(?x = <x> || ?x = <x> ) does not result in two transforms.
        Set<Expr> doneSoFar = new HashSet<Expr>() ;
       
        for ( Expr expr : exprList )
        {
            if ( ! isDisjunction(expr) )
            {
                // Assignment there?
                exprList2.add(expr) ;
                continue ;
            }
           
//            // Relies on expression equality.
//            if ( doneSoFar.contains(expr) )
//                continue ;
//            // Must be canonical: ?x = <x> is the same as <x> = ?x
//            doneSoFar.add(expr) ;
           
            Op op2 = expandDisjunction(expr, newOp) ;
           
            if ( op2 != null )
                newOp = op2 ;
        }

        if ( exprList2.isEmpty() )
            return newOp ;

        // There should have been at least on disjunction.
        if ( newOp == subOp ) {
            Log.warn(this, "FilterDisjunction assumption failure: didn't find a disjunction after all") ;
View Full Code Here

Examples of com.hp.hpl.jena.sparql.expr.ExprList

    public static Op transform(ExprList exprs, BasicPattern bgp)
    {
        if ( ! doFilterPlacement )
            return OpFilter.filter(exprs, new OpBGP(bgp)) ;
        // Mutated
        ExprList exprs2 = new ExprList(exprs) ;
        Op op = transformFilterBGP(exprs2, new HashSet<Var>(), bgp) ;
        // Remaining filters? e.g. ones mentioning var s not used anywhere.
        op = buildFilter(exprs2, op) ;
        return op ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.expr.ExprList

    public static Op transform(ExprList exprs, Node graphNode, BasicPattern bgp)
    {
        if ( ! doFilterPlacement )
            return OpFilter.filter(exprs, new OpQuadPattern(graphNode, bgp)) ;
        // Mutated
        ExprList exprs2 = new ExprList(exprs) ;
        Op op =  transformFilterQuadPattern(exprs2, new HashSet<Var>(), graphNode, bgp);
        op = buildFilter(exprs2, op) ;
        return op ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.expr.ExprList

    {
        if ( ! doFilterPlacement )
            return super.transform(opFilter, x) ;
       
        // Destructive use of exprs - copy it.
        ExprList exprs = new ExprList(opFilter.getExprs()) ;
        Set<Var> varsScope = new HashSet<Var>() ;
       
        Op op = transform(exprs, varsScope, x) ;
        if ( op == x )
            // Didn't do anything.
View Full Code Here

Examples of com.hp.hpl.jena.sparql.expr.ExprList

   
    private OpFilter(Op sub)
    {
        super(sub) ;
        expressions = new ExprList() ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.expr.ExprList

    }
   
    /** Compress multiple filters:  (filter (filter (filter op)))) into one (filter op) */
    public static OpFilter tidy(OpFilter base)
    {
        ExprList exprs = new ExprList() ;
       
        Op op = base ;
        while ( op instanceof OpFilter )
        {
            OpFilter f = (OpFilter)op ;
            exprs.addAll(f.getExprs()) ;
            op = f.getSubOp() ;
        }
        return new OpFilter(exprs, op) ;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.