Package de.fuberlin.wiwiss.d2rq.parser

Examples of de.fuberlin.wiwiss.d2rq.parser.RelationBuilder


    }
  }

  protected Relation buildRelation() {
    ConnectedDB database = belongsToClassMap.database().connectedDB();
    RelationBuilder builder = belongsToClassMap.relationBuilder(database);
    builder.addOther(relationBuilder(database));
    if (this.refersToClassMap != null) {
      builder.addAliased(this.refersToClassMap.relationBuilder(database));
    }
    for (String pattern: dynamicPropertyPatterns) {
      builder.addOther(new PropertyMap(pattern, belongsToClassMap.database()).relationBuilder(database));
    }
    if (this.limit!=null) {
      builder.setLimit(this.limit.intValue());
    }
    if (this.limitInverse!=null) {
      builder.setLimitInverse(this.limitInverse.intValue());
    }
    if (this.order!=null) {
      builder.setOrderSpecs(Collections.singletonList(
          new OrderSpec(new AttributeExpr(SQL.parseAttribute(this.order)), this.orderDesc.booleanValue())));
    }
    return builder.buildRelation();
  }
View Full Code Here


  }

  @Override
  protected Relation buildRelation() {
    Database db = belongsToClassMap == null ? database : belongsToClassMap.database();
    RelationBuilder builder = relationBuilder(db.connectedDB());
    builder.addProjection(contentDownloadColumn);
    for (ProjectionSpec projection: getMediaTypeValueMaker().projectionSpecs()) {
      builder.addProjection(projection);
    }
    if (belongsToClassMap != null) {
      builder.addOther(belongsToClassMap.relationBuilder(db.connectedDB()));
    }
    return builder.buildRelation();
  }
View Full Code Here

    }
    return parsedAliases;
  }
 
  public RelationBuilder relationBuilder(ConnectedDB database) {
    RelationBuilder result = new RelationBuilder(database);
    for (Join join: SQL.parseJoins(joins)) {
      result.addJoinCondition(join);
    }
    for (String condition: conditions) {
      result.addCondition(condition);
    }
    result.addAliases(aliases());
    for (ProjectionSpec projection: nodeMaker().projectionSpecs()) {
      result.addProjection(projection);
    }
    if (!containsDuplicates) {
      result.setIsUnique(true);
    }
    return result;
  }
View Full Code Here

    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");
    b2.addCondition("TABLE.VALUE=2");
   
    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());
View Full Code Here

    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());
View Full Code Here

TOP

Related Classes of de.fuberlin.wiwiss.d2rq.parser.RelationBuilder

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.