Package de.fuberlin.wiwiss.d2rq.sql.types

Examples of de.fuberlin.wiwiss.d2rq.sql.types.DataType


    this.out.println("\td2rq:property " + vocabularyIRITurtle(column) + ";");
    if (generateDefinitionLabels) {
      this.out.println("\td2rq:propertyDefinitionLabel \"" + toLabel(column) + "\";");
    }
    this.out.println("\td2rq:column \"" + column.qualifiedName() + "\";");
    DataType colType = this.schema.columnType(column);
    String xsd = colType.rdfType();
    if (xsd != null && !"xsd:string".equals(xsd)) {
      // We use plain literals instead of xsd:strings, so skip
      // this if it's an xsd:string
      this.out.println("\td2rq:datatype " + xsd + ";");
    }
    if (colType.valueRegex() != null) {
      this.out.println("\td2rq:valueRegex \"" + colType.valueRegex() + "\";");
    }
    if (xsd == null) {
      createDatatypeProperty(column, null);
    } else {
      String datatypeURI = xsd.replaceAll("xsd:", XSDDatatype.XSD + "#");
View Full Code Here


    for (Attribute column: columns) {
      if (!filter.matches(column)) {
        log.info("Skipping filtered column " + column + " as " + reason);
        continue;
      }
      DataType type = schema.columnType(column);
      if (type == null) {
        writeWarning(new String[]{
            "Skipping column " + column + " as " + reason + ".",
            "    Its datatype is unknown to D2RQ.",
            "    You can override the column's datatype using d2rq:xxxColumn and add a property bridge.",
          }, "");
        continue;
      }
      if (type.isUnsupported()) {
        writeWarning(new String[]{
            "Skipping column " + column + " as " + reason + ".",
            "    Its datatype " + schema.columnType(column) + " cannot be mapped to RDF."
          }, "");
        continue;
      }
      if (requireDistinct && !type.supportsDistinct()) {
        writeWarning(new String[]{
            "Skipping column " + column + " as " + reason + ".",
            "    Its datatype " + schema.columnType(column) + " does not support DISTINCT."
        }, "");
      }
View Full Code Here

              D2RQException.SQL_COLUMN_NOT_FOUND);
        }
        int type = rs.getInt("DATA_TYPE");
        String name = rs.getString("TYPE_NAME").toUpperCase();
        int size = rs.getInt("COLUMN_SIZE");
        DataType result = db.vendor().getDataType(type, name, size);
        if (result == null) {
          log.warn("Unknown datatype '" + (size == 0 ? name : (name + "(" + size + ")")) + "' (" + type + ")");
        }
        return result;
      } finally {
View Full Code Here

    AttributeTypeValidator(TripleRelation relation) {
      this.relation = relation.baseRelation();
    }
    void validate() {
      for (Attribute attribute: relation.allKnownAttributes()) {
        DataType dataType = relation.database().columnType(
            relation.aliases().originalOf(attribute));
        if (dataType == null) {
          throw new D2RQException("Column " + relation.aliases().originalOf(attribute) +
              " has a datatype that is unknown to D2RQ; override it with d2rq:xxxColumn in the mapping file",
              D2RQException.DATATYPE_UNKNOWN);
        }
        if (dataType.isUnsupported()) {
          throw new D2RQException("Column " +
              relation.aliases().originalOf(attribute) +
              " has a datatype that D2RQ cannot express in RDF: " + dataType,
              D2RQException.DATATYPE_UNMAPPABLE);
        }
View Full Code Here

    }
    if (jdbcType == Types.BLOB) {
      return new SQLBinary(this, name, false);
    }
   
    DataType standard = super.getDataType(jdbcType, name, size);
    if (standard != null) return standard;

    // Special handling for TIMESTAMP(x) WITH LOCAL TIME ZONE
    if (name.contains("WITH LOCAL TIME ZONE") || "TIMESTAMPLTZ".equals(name)) {
      return new OracleCompatibilityTimeZoneLocalDataType(this, name);
View Full Code Here

    // size isn't reported.
    if (jdbcType == Types.BIT && "BOOL".equals(name)) {
      return new SQLBoolean(this, name);
    }

    DataType standard = super.getDataType(jdbcType, name, size);
    if (standard != null) return standard;

    if ("UUID".equals(name)) {
      return new SQLCharacterString(this, name, true);
    }
View Full Code Here

TOP

Related Classes of de.fuberlin.wiwiss.d2rq.sql.types.DataType

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.