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

Examples of com.hp.hpl.jena.sparql.expr.Expr.visit()


  }
 
  public void testExprDistributiveABOrC() {
    Expr expr = ExprUtils.parse("(( ?a && ?b ) || ?c )");
    DistributiveLawApplyer apply = new DistributiveLawApplyer();
    expr.visit(apply);
    assertNotNull(apply.result());
    assertEquals("( ( ?a || ?c ) && ( ?b || ?c ) )", apply.result().toString());
  }

  public void testExprDistributiveCOrAB() {
View Full Code Here


  }

  public void testExprDistributiveCOrAB() {
    Expr expr = ExprUtils.parse("?c || ( ?a && ?b )");
    DistributiveLawApplyer apply = new DistributiveLawApplyer();
    expr.visit(apply);
    assertNotNull(apply.result());
    assertEquals("( ( ?c || ?a ) && ( ?c || ?b ) )", apply.result().toString());
  }

  public void testExprDistributiveAndDontChange() {
View Full Code Here

  }

  public void testExprDistributiveAndDontChange() {
    Expr expr = ExprUtils.parse("!(?a || ?b) && ?c");
    DistributiveLawApplyer apply = new DistributiveLawApplyer();
    expr.visit(apply);
    assertNotNull(apply.result());
    assertEquals("( ( ! ( ?a || ?b ) ) && ?c )", apply.result().toString());
  }
 
  public void testExprDistributiveOrComplex() {
View Full Code Here

  }
 
  public void testExprDistributiveOrComplex() {
    Expr expr = ExprUtils.parse("(?c || ( ?a && ?b )) || (?d && ?e)");
    DistributiveLawApplyer apply = new DistributiveLawApplyer();
    expr.visit(apply);
    assertNotNull(apply.result());
    assertEquals("( ( ( ( ?c || ?a ) || ?d ) && ( ( ?c || ?b ) || ?d ) ) && ( ( ( ?c || ?a ) || ?e ) && ( ( ?c || ?b ) || ?e ) ) )", apply.result().toString()); // correct
  }
 
  public void testExprDistributiveABC() {
View Full Code Here

  }
 
  public void testExprDistributiveABC() {
    Expr expr = ExprUtils.parse("(( ?a && ?b ) && ?c )");
    DistributiveLawApplyer apply = new DistributiveLawApplyer();
    expr.visit(apply);
    assertEquals("( ( ?a && ?b ) && ?c )", apply.result().toString());
  }
 
  public void testExprDistributiveUsingFunctions() {
    Expr expr = ExprUtils.parse("( ( ( ?n = 1 ) && bound(?pref) ) && bound(?n) )");
View Full Code Here

  }
 
  public void testExprDistributiveUsingFunctions() {
    Expr expr = ExprUtils.parse("( ( ( ?n = 1 ) && bound(?pref) ) && bound(?n) )");
    DistributiveLawApplyer apply = new DistributiveLawApplyer();
    expr.visit(apply);
    assertEquals("( ( ( ?n = 1 ) && bound(?pref) ) && bound(?n) )", apply.result().toString());
  }

  public void testDeMorganNotEqual() {
    Expr expr = ExprUtils.parse("?x != ?z");
View Full Code Here

  }

  public void testDeMorganNotEqual() {
    Expr expr = ExprUtils.parse("?x != ?z");
    DeMorganLawApplyer apply = new DeMorganLawApplyer();
    expr.visit(apply);
    assertNotNull(apply.result());
    assertEquals("( ?x != ?z )", apply.result().toString());
  }
}
View Full Code Here

                Expr expr = func.getArg(i) ;
                if ( expr == null )
                    break ;
                // endLine() ;
                out.print(' ') ;
                expr.visit(this) ;
            }
            out.print(")") ;
            out.decIndent() ;
        }
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.