Package de.fuberlin.wiwiss.d2rq.algebra

Examples of de.fuberlin.wiwiss.d2rq.algebra.Attribute


    if (!match.matches()) {
      throw new D2RQException("Attribute \"" + qualifiedName +
          "\" is not in \"[schema.]table.column\" notation",
          D2RQException.SQL_INVALID_ATTRIBUTENAME);
    }
    return new Attribute(match.group(1), match.group(2), match.group(3));
  }
View Full Code Here


  public static Set<Attribute> findColumnsInExpression(String expression) {
    Set<Attribute> results = new HashSet<Attribute>();
    Matcher match = attributeRegexConservative.matcher(expression);
    while (match.find()) {
      results.add(new Attribute(match.group(1), match.group(2), match.group(3)));
    }
    return results;
  }
View Full Code Here

    int firstPartEnd = matched ? (match.start(1) != -1 ? match.start(1)
                               : match.start(2))
                   : expression.length();
    result.append(expression.substring(0, firstPartEnd));
    while (matched) {
      Attribute column = new Attribute(match.group(1), match.group(2), match.group(3));
      result.append(columnRenamer.applyTo(column).qualifiedName());
      int nextPartStart = match.end();
      matched = match.find();
      int nextPartEnd = matched ? (match.start(1) != -1 ? match.start(1)
                                : match.start(2))
View Full Code Here

                                    : match.start(2))
                      : expression.length();
    result.append(expression.substring(0, firstPartEnd));
    while (matched) {
      result.append(database.vendor().quoteAttribute(
          new Attribute(match.group(1), match.group(2), match.group(3))));
      int nextPartStart = match.end();
      matched = match.find();
      int nextPartEnd = matched ? (match.start(1) != -1 ? match.start(1)
                                  : match.start(2))
                      : expression.length();
View Full Code Here

        throw new D2RQException("d2rq:join \"" + joinCondition +
            "\" is not in \"table1.col1 [ <= | => | = ] table2.col2\" form",
            D2RQException.SQL_INVALID_JOIN);
      }
     
      Attribute leftSide = SQL.parseAttribute(joinCondition.substring(0, index).trim());
      Attribute rightSide = SQL.parseAttribute(joinCondition.substring(index + Join.joinOperators[joinOperator].length()).trim());
     
      return new AttributeEqualityCondition(leftSide, rightSide, joinOperator);
    }
View Full Code Here

  public void testCreateEmpty() {
    assertEquals(new Constant(""), Concatenation.create(Collections.<Expression>emptyList()));
  }
 
  public void testCreateOnePart() {
    Expression expr = new AttributeExpr(new Attribute(null, "table", "col"));
    assertEquals(expr, Concatenation.create(Collections.singletonList(expr)));
  }
View Full Code Here

    assertEquals(expr, Concatenation.create(Collections.singletonList(expr)));
  }
 
  public void testTwoParts() {
    Expression expr1 = new Constant("mailto:");
    Expression expr2 = new AttributeExpr(new Attribute(null, "user", "email"));
    Expression concat = Concatenation.create(Arrays.asList(new Expression[]{expr1, expr2}));
    assertEquals("Concatenation(Constant(mailto:), AttributeExpr(@@user.email@@))",
        concat.toString());
  }
View Full Code Here

  private void assertPatternValues(Pattern pattern, String value, Map<String,String> expectedValues) {
    assertTrue(matches(pattern, value));
    Collection<Expression> expressions = new HashSet<Expression>();
    for (String attributeName: expectedValues.keySet()) {
      String attributeValue = (String) expectedValues.get(attributeName);
      Attribute attribute = SQL.parseAttribute(attributeName);
      expressions.add(Equality.create(
          new AttributeExpr(attribute),
          new Constant(attributeValue, attribute)));
    }
    Expression expr = Conjunction.create(expressions);
View Full Code Here

 
  public String toString() {
    StringBuffer result = new StringBuffer("BlankNodeID(");
    Iterator<Attribute> it = attributes.iterator();
    while (it.hasNext()) {
      Attribute attribute = (Attribute) it.next();
      result.append(attribute.qualifiedName());
      if (it.hasNext()) {
        result.append(",");
      }
    }
    result.append(")");
View Full Code Here

    this.limit = Relation.combineLimits(relation.limit(), database.limit());
    this.orderSpecs = relation.orderSpecs();
    this.aliases = this.aliases.applyTo(relation.aliases());
    for (Join join: relation.joinConditions()) {
      for (Attribute attribute1: join.attributes1()) {
        Attribute attribute2 = join.equalAttribute(attribute1);
        addCondition(Equality.createAttributeEquality(attribute1, attribute2));
      }
    }
    addCondition(relation.condition());
    addCondition(relation.softCondition());
View Full Code Here

TOP

Related Classes of de.fuberlin.wiwiss.d2rq.algebra.Attribute

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.