Package de.fuberlin.wiwiss.d2rq.engine

Examples of de.fuberlin.wiwiss.d2rq.engine.BindingMaker


  public void testCombineDifferentConditions() {
    Attribute id = SQL.parseAttribute("TABLE.ID");
    db.setNullable(id, false);
    NodeMaker x = new TypedNodeMaker(TypedNodeMaker.PLAIN_LITERAL, new Column(id), true);
    Map<Var,NodeMaker> map = Collections.singletonMap(Var.alloc("x"), x);
    BindingMaker bm = new BindingMaker(map, null);
    RelationBuilder b1 = new RelationBuilder(db);
    RelationBuilder b2 = new RelationBuilder(db);
    b1.addProjection(id);
    b2.addProjection(id);
    b1.addCondition("TABLE.VALUE=1");
View Full Code Here


  public void testCombineConditionAndNoCondition() {
    Attribute id = SQL.parseAttribute("TABLE.ID");
    db.setNullable(id, false);
    NodeMaker x = new TypedNodeMaker(TypedNodeMaker.PLAIN_LITERAL, new Column(id), true);
    Map<Var,NodeMaker> map = Collections.singletonMap(Var.alloc("x"), x);
    BindingMaker bm = new BindingMaker(map, null);
    RelationBuilder b1 = new RelationBuilder(db);
    RelationBuilder b2 = new RelationBuilder(db);
    b1.addProjection(id);
    b2.addProjection(id);
    b1.addCondition("TABLE.VALUE=1");
   
    CompatibleRelationGroup group = new CompatibleRelationGroup();
    Relation r1 = b1.buildRelation();
    Relation r2 = b2.buildRelation();
    group.addBindingMaker(r1, bm);
    assertTrue(group.isCompatible(r2));
    group.addBindingMaker(r2, bm);
   
    assertEquals(2, group.bindingMakers().size());
    assertTrue(group.baseRelation().projections().contains(new ExpressionProjectionSpec(r1.condition())));
    assertEquals(2, group.baseRelation().projections().size());
    assertEquals(Expression.TRUE, group.baseRelation().condition());
    Iterator<BindingMaker> it = group.bindingMakers().iterator();
    BindingMaker bm3 = it.next();
    BindingMaker bm4 = it.next();
    assertTrue((bm3.condition() == null && bm4.condition() != null)
        || (bm3.condition() != null && bm4.condition() == null));
  }
View Full Code Here

TOP

Related Classes of de.fuberlin.wiwiss.d2rq.engine.BindingMaker

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.