Examples of OpFilter


Examples of com.hp.hpl.jena.sparql.algebra.op.OpFilter

    }
   
    @Test public void placement11()
    {
        Op op1 = SSE.parseOp("(filter (= ?x ?unbound) (bgp (?s ?p ?x)))") ;
        OpFilter f = (OpFilter)op1 ;
        Op op2 = TransformFilterPlacement.transform(f.getExprs(), ((OpBGP)f.getSubOp()).getPattern()) ;
        Op op3 = SSE.parseOp("(filter (= ?x ?unbound) (bgp (?s ?p ?x)))") ;
        Assert.assertEquals(op3, op2) ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.algebra.op.OpFilter

    }

    @Test public void placement12()
    {
        Op op1 = SSE.parseOp("(filter (= ?x ?unbound) (bgp (?s ?p ?x) (?s1 ?p1 ?XX)))") ;
        OpFilter f = (OpFilter)op1 ;
        Op op2 = TransformFilterPlacement.transform(f.getExprs(), ((OpBGP)f.getSubOp()).getPattern()) ;
        Op op3 = SSE.parseOp("(filter (= ?x ?unbound) (bgp (?s ?p ?x) (?s1 ?p1 ?XX)))") ;
        Assert.assertEquals(op3, op2) ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.algebra.op.OpFilter

    }
   
    @Test public void placement11()
    {
        Op op1 = SSE.parseOp("(filter (= ?x ?unbound) (bgp (?s ?p ?x)))") ;
        OpFilter f = (OpFilter)op1 ;
        Op op2 = TransformFilterPlacement.transform(f.getExprs(), ((OpBGP)f.getSubOp()).getPattern()) ;
        Op op3 = SSE.parseOp("(filter (= ?x ?unbound) (bgp (?s ?p ?x)))") ;
        Assert.assertEquals(op3, op2) ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.algebra.op.OpFilter

    }

    @Test public void placement12()
    {
        Op op1 = SSE.parseOp("(filter (= ?x ?unbound) (bgp (?s ?p ?x) (?s1 ?p1 ?XX)))") ;
        OpFilter f = (OpFilter)op1 ;
        Op op2 = TransformFilterPlacement.transform(f.getExprs(), ((OpBGP)f.getSubOp()).getPattern()) ;
        Op op3 = SSE.parseOp("(filter (= ?x ?unbound) (bgp (?s ?p ?x) (?s1 ?p1 ?XX)))") ;
        Assert.assertEquals(op3, op2) ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.algebra.op.OpFilter

        Op op = compileElement(subElt) ;
       
        ExprList exprs = null ;
        if ( op instanceof OpFilter )
        {
            OpFilter f = (OpFilter)op ;
            //f = OpFilter.tidy(f) ;  // Collapse filter(filter(..))
            Op sub = f.getSubOp() ;
            if ( sub instanceof OpFilter )
                broken("compile/Optional/nested filters - unfinished") ;
            exprs = f.getExprs() ;
            op = sub ;
        }
        current = OpLeftJoin.create(current, op, exprs) ;
        return current ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.algebra.op.OpFilter

    rewriter = new OpRewriter( securityEvaluator, "http://example.com/dummy");
   
    rewriter.visit( new OpBGP( BasicPattern.wrap(Arrays.asList(triples))));
    Op op = rewriter.getResult();
    Assert.assertTrue( "Should have been an OpFilter", op instanceof OpFilter );
    OpFilter filter = (OpFilter) op;
    ExprList eLst = filter.getExprs();
    Assert.assertEquals( 1, eLst.size());
    Assert.assertTrue( "Should have been a SecuredFunction", eLst.get(0) instanceof SecuredFunction);
    op = filter.getSubOp();
    Assert.assertTrue( "Should have been a OpBGP", op instanceof OpBGP);
    BasicPattern basicPattern = ((OpBGP)op).getPattern();
    Assert.assertEquals( 3, basicPattern.size() );
   
    Triple t = basicPattern.get(0);
View Full Code Here

Examples of com.hp.hpl.jena.sparql.algebra.op.OpFilter

   * @return ExprList - every entry of the exprlist is in conjunctive normalform
   */
  public static ExprList translateFilterExpressionsToCNF(final OpFilter opFilter)
  {
    ExprList exprList, newExprList;
    OpFilter copiedOpFilter;
   
    newExprList = new ExprList()// contains the translated expressions
    exprList = opFilter.getExprs();
   
    // workaround to avoid deep copy from the expressions
    // because deep copy is not available in Q_UnaryNot.java
    copiedOpFilter = (OpFilter) OpFilter.filter(exprList, opFilter.getSubOp());
    exprList = copiedOpFilter.getExprs();
   
    // for every expression of the filter, apply first DeMorgan-law and then Distributive-law
    for (Expr expr: exprList) {
      if (expr instanceof ExprNode) { // only SPARQL expressions are handled (e.g. no RDQL SimpleNode)
              expr = applyDeMorganLaw(expr);       // !(a || b) will become !a && !b
View Full Code Here

Examples of com.hp.hpl.jena.sparql.algebra.op.OpFilter

        for ( Expr e : opFilter.getExprs() )
        {
            Expr e2 = ExprTransformer.transform(exprTransform, e) ;
            ex.add(e2) ;
        }
        OpFilter f = (OpFilter)OpFilter.filter(ex, x) ;
        return super.transform(f, x) ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.algebra.op.OpFilter

    }
   
    @Test public void placement11()
    {
        Op op1 = SSE.parseOp("(filter (= ?x ?unbound) (bgp (?s ?p ?x)))") ;
        OpFilter f = (OpFilter)op1 ;
        Op op2 = TransformFilterPlacement.transform(f.getExprs(), ((OpBGP)f.getSubOp()).getPattern()) ;
        Op op3 = SSE.parseOp("(filter (= ?x ?unbound) (bgp (?s ?p ?x)))") ;
        Assert.assertEquals(op3, op2) ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.algebra.op.OpFilter

    }

    @Test public void placement12()
    {
        Op op1 = SSE.parseOp("(filter (= ?x ?unbound) (bgp (?s ?p ?x) (?s1 ?p1 ?XX)))") ;
        OpFilter f = (OpFilter)op1 ;
        Op op2 = TransformFilterPlacement.transform(f.getExprs(), ((OpBGP)f.getSubOp()).getPattern()) ;
        Op op3 = SSE.parseOp("(filter (= ?x ?unbound) (bgp (?s ?p ?x) (?s1 ?p1 ?XX)))") ;
        Assert.assertEquals(op3, op2) ;
    }
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.