Package com.hp.hpl.jena.sparql.expr

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


            for ( Expr e : exprList2 )
            {
                if ( eOther == null )
                    eOther = e ;
                else
                    eOther = new E_LogicalOr(eOther, e) ;
            }
            Op opOther = OpFilter.filter(eOther, subOp) ;
            op = OpDisjunction.create(op, opOther) ;
        }
       
View Full Code Here


        {
            exprList.add(expr) ;
            return exprList ;
        }
       
        E_LogicalOr exprOr = (E_LogicalOr)expr ;
        Expr e1 =  exprOr.getArg1() ;
        Expr e2 =  exprOr.getArg2() ;
        explodeDisjunction(exprList, e1) ;
        explodeDisjunction(exprList, e2) ;
        return exprList ;
    }
View Full Code Here

            for ( Expr e : exprList2 )
            {
                if ( eOther == null )
                    eOther = e ;
                else
                    eOther = new E_LogicalOr(eOther, e) ;
            }
            Op opOther = OpFilter.filter(eOther, subOp) ;
            op = OpDisjunction.create(op, opOther) ;
        }
       
View Full Code Here

        {
            exprList.add(expr) ;
            return exprList ;
        }
       
        E_LogicalOr exprOr = (E_LogicalOr)expr ;
        Expr e1 =  exprOr.getArg1() ;
        Expr e2 =  exprOr.getArg2() ;
        explodeDisjunction(exprList, e1) ;
        explodeDisjunction(exprList, e2) ;
        return exprList ;
    }
View Full Code Here

    pattern.add(Triple.create(Node.createVariable("s"), Node.createURI("http://example.org/value"), Node.createVariable("o")));
    NodeRelation[] rels = translate(pattern, "optimizer/filtertests.n3");
   
    NodeRelation intvalue = search("table2", "intvalue", rels);
 
    Expr disjunction = new E_LogicalOr(new E_Equals(new ExprVar("o"),  NodeValue.makeNode("1", XSDDatatype.XSDint)), new E_Equals(new ExprVar("o"), NodeValue.makeNode("2", XSDDatatype.XSDint)));
   
    Expression result = TransformExprToSQLApplyer.convert(disjunction, intvalue);
    TypedNodeMaker nm = (TypedNodeMaker) intvalue.nodeMaker(Var.alloc("o"));
    Expression e1 = nm.valueMaker().valueExpression("1");
    Expression e2 = nm.valueMaker().valueExpression("2");
View Full Code Here

        if (curExpr instanceof E_LogicalOr)
        {
          if (!(leftExpr instanceof E_LogicalAnd) && !(rightExpr instanceof E_LogicalAnd))
          {
            // no distributive law - normal or
            this.resultExpr = new E_LogicalOr(leftExpr, rightExpr);
          }else
          {
            // criterion for distributive law - first OR, then AND
           
            if (leftExpr instanceof E_LogicalAnd)
            {
              leftLeftExpr = ((E_LogicalAnd)leftExpr).getArg1();
              rightLeftExpr = ((E_LogicalAnd)leftExpr).getArg2();
             
              // OR AND will become to AND OR OR
              newOrExpr1 = new E_LogicalOr(leftLeftExpr, rightExpr);
              newOrExpr2 = new E_LogicalOr(rightLeftExpr, rightExpr);
              newAndExpr = new E_LogicalAnd(newOrExpr1, newOrExpr2);
             
              this.resultExpr = newAndExpr;
              // apply for subexpression again
              newAndExpr.visit(this);
            }
           
            if (rightExpr instanceof E_LogicalAnd)
            {
              leftRightExpr = ((E_LogicalAnd)rightExpr).getArg1();
              rightRightExpr = ((E_LogicalAnd)rightExpr).getArg2();
           
              // OR AND will become to AND OR OR
              newOrExpr1 = new E_LogicalOr(leftExpr, leftRightExpr);
              newOrExpr2 = new E_LogicalOr(leftExpr, rightRightExpr);
              newAndExpr = new E_LogicalAnd(newOrExpr1, newOrExpr2);
           
              this.resultExpr = newAndExpr;
              // apply for subexpression again
              newAndExpr.visit(this);
View Full Code Here

        rightExpr = this.resultExpr;
       
        // create new And/Or with resultExpr
        if (curExpr instanceof E_LogicalOr)
        {
          this.resultExpr = new E_LogicalOr(leftExpr, rightExpr);
        }else if (curExpr instanceof E_LogicalAnd)
        {
          this.resultExpr = new E_LogicalAnd(leftExpr, rightExpr);
        }
             
View Full Code Here

                {
                    Expr e2 = new E_Equals(x, sub) ;
                    if ( disjunction == null )
                        disjunction = e2 ;
                    else
                        disjunction = new E_LogicalOr(disjunction, e2) ;
                }
               
                if ( disjunction == null )
                    exprList2.add(FALSE) ;
                else
View Full Code Here

            for ( Expr e : exprList2 )
            {
                if ( eOther == null )
                    eOther = e ;
                else
                    eOther = new E_LogicalOr(eOther, e) ;
            }
            Op opOther = OpFilter.filter(eOther, subOp) ;
            op = OpDisjunction.create(op, opOther) ;
        }
       
View Full Code Here

        {
            exprList.add(expr) ;
            return exprList ;
        }
       
        E_LogicalOr exprOr = (E_LogicalOr)expr ;
        Expr e1 =  exprOr.getArg1() ;
        Expr e2 =  exprOr.getArg2() ;
        explodeDisjunction(exprList, e1) ;
        explodeDisjunction(exprList, e2) ;
        return exprList ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sparql.expr.E_LogicalOr

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.