Package de.fuberlin.wiwiss.d2rq

Examples of de.fuberlin.wiwiss.d2rq.D2RQException


    // TODO
  }
 
  private void checkNotConnected() {
    if (this.connection != null) {
      throw new D2RQException("Cannot modify Database as it is already connected",
          D2RQException.DATABASE_ALREADY_CONNECTED);
    }
  }
View Full Code Here


      return new Column(SQL.parseAttribute(this.uriColumn));
    }
    if (this.uriPattern != null) {
      Pattern p = new Pattern(this.uriPattern);
      if (!p.literalPartsMatchRegex(MapParser.IRI_CHAR_REGEX)) {
        throw new D2RQException("d2rq:uriPattern '"
            + this.uriPattern + "' contains characters not allowed in URIs",
            D2RQException.RESOURCEMAP_ILLEGAL_URIPATTERN);
      }
      return p;
    }
    if (this.column != null) {
      return new Column(SQL.parseAttribute(this.column));
    }
    if (this.pattern != null) {
      return new Pattern(this.pattern);
    }
    if (this.sqlExpression != null) {
      return new SQLExpressionValueMaker(SQLExpression.create(sqlExpression));
    }
    if (this.uriSqlExpression != null) {
      return new SQLExpressionValueMaker(SQLExpression.create(uriSqlExpression));
    }
    throw new D2RQException(this + " needs a column/pattern/bNodeID specification");
  }
View Full Code Here

      return TypedNodeMaker.URI;
    }
   
    // literals
    if (this.column == null && this.pattern == null && this.sqlExpression == null) {
      throw new D2RQException(this + " needs a column/pattern/bNodeID/sqlExpression/uriSqlExpression specification");
    }
    if (this.datatype != null && this.lang != null) {
      throw new D2RQException(this + " has both d2rq:lang and d2rq:datatype");
    }
    if (this.datatype != null) {
      return TypedNodeMaker.typedLiteral(buildDatatype(this.datatype));
    }
    if (this.lang != null) {
View Full Code Here

        if (i > 0) {
          error.append(", ");
        }
        error.append(PrettyPrinter.toString(allowedSpecs[i]));
      }
      throw new D2RQException(error.toString(), D2RQException.RESOURCEMAP_MISSING_PRIMARYSPEC);
    }
    if (definedSpecs.size() > 1) {
      throw new D2RQException(toString() + " can't have both " +
          PrettyPrinter.toString((Property) definedSpecs.get(0)) +
          " and " +
          PrettyPrinter.toString((Property) definedSpecs.get(1)));
    }
  }
View Full Code Here

    if (property.equals(D2RQ.pattern)) return this.pattern != null;
    if (property.equals(D2RQ.sqlExpression)) return this.sqlExpression != null;
    if (property.equals(D2RQ.uriSqlExpression)) return this.uriSqlExpression != null;
    if (property.equals(D2RQ.refersToClassMap)) return this.refersToClassMap != null;
    if (property.equals(D2RQ.constantValue)) return this.constantValue != null;
    throw new D2RQException("No primary spec: " + property);
  }
View Full Code Here

      if (this.resultSet != null) {
        this.resultSet.close();
        this.resultSet = null;
      }
    } catch (SQLException ex) {
      throw new D2RQException(ex);
    }
  }
View Full Code Here

        }
      }
      mediaType = mediaTypeValueMaker.makeValue(
          ResultRowMap.fromResultSet(resultSet, builder.getColumnSpecs(), db));
    } catch (SQLException ex) {
      throw new D2RQException(ex);
    }
  }
View Full Code Here

    if (eliminateDuplicates) {
      for (ProjectionSpec projection: selectSpecs) {
        for (Attribute column: projection.requiredAttributes()) {
          if (!database.columnType(aliases.originalOf(column)).supportsDistinct()) {
            log.info("Attempting to apply DISTINCT to relation: " + relation);
            throw new D2RQException("Bug in engine logic: DISTINCT used with " +
                "datatype (" + database.columnType(column) + ") that " +
                "doesn't support it",
                D2RQException.DATATYPE_DOES_NOT_SUPPORT_DISTINCT);
          }
        }
View Full Code Here

      if (!Modifier.isStatic(field.getModifiers())) continue;
      if (!Property.class.isAssignableFrom(field.getType())) continue;
      try {
        results.add((Property) field.get(null));
      } catch (IllegalAccessException ex) {
        throw new D2RQException(ex);
      }
    }
    return results;
  }
View Full Code Here

      if (!Resource.class.isAssignableFrom(field.getType())) continue;
      if (Property.class.isAssignableFrom(field.getType())) continue;
      try {
        results.add((Resource) field.get(null));
      } catch (IllegalAccessException ex) {
        throw new D2RQException(ex);
      }
    }
    return results;
  }
View Full Code Here

TOP

Related Classes of de.fuberlin.wiwiss.d2rq.D2RQException

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.