1.7

@johardi johardi released this Jul 8, 2014 · 92 commits to master since this release

Release Notes:

  • Improved Data Type Handling
    There have been a lot of bug fixes for handling data types. Users can override data types and the system will ensure a safe conversion, including to add cast function in SQL query automatically. The system support almost all primitive and derived XML datatypes (see table conversion below). However, data type reasoning is not available.
  • Support SPARQL STR
    More support on SPARQL syntax. Users can use STR expression to get the string representation of a given literal in SPARQL query.

API Changes

  • Class Value is no longer available. Iterating a value list will return you either a Literal or Uri object. Both are different classes to represent typed-value and object-value, respectively.
  • Use getType() to determine the type of a Value object as an alternative way from using instanceof condition.
  • When the JDBC Result Set returns null then the system produces a null object as well in the value list. Therefore, you need to take care null object while iterating the value list, especially when dealing with queries that use OPTIONAL expression.
  • Class QueryReturnMetadata has been replaced by QueryMetadata. The implementation is different especially the new class can determine the select item should be a literal-value or an object-value.
  • DataTypeException is a runtime exception. No need to try-and-catch it anymore.
  • The prefix manager has a copy(Map<String,String>) method to store prefix-namespace pairs in batch.
  • XmlTypeToSqlType defines type conversion XSD --> SQL in the following. (Note that the SQL types are represented by java.sql.Types constants.
XSD SQL XSD SQL
xsd:string Types.VARCHAR xsd:unsignedByte Types.SMALLINT
xsd:boolean Types.BOOLEAN xsd:double Types.DOUBLE
xsd:decimal Types.DECIMAL xsd:float Types.FLOAT
xsd:long Types.BIGINT xsd:dateTime Types.TIMESTAMP
xsd:integer Types.INTEGER xsd:dateTimeStamp Types.TIMESTAMP
xsd:int Types.INTEGER xsd:date Types.DATE
xsd:short Types.SMALLINT xsd:time Types.TIME
xsd:byte Types.TINYINT xsd:gYearMonth Types.VARCHAR
xsd:nonNegativeInteger Types.BIGINT xsd:gMonthDay Types.VARCHAR
xsd:nonPositiveInteger Types.BIGINT xsd:gYear Types.VARCHAR
xsd:negativeInteger Types.BIGINT xsd:gMonth Types.VARCHAR
xsd:positiveInteger Types.BIGINT xsd:gDay Types.VARCHAR
xsd:unsignedLong Types.BIGINT
xsd:unsignedInt Types.BIGINT
xsd:unsignedShort Types.INTEGER
  • Likewise, SqlTypeToXmlType defines type conversion SQL --> XSD in the following.
SQL XSD SQL XSD
Types.NUMERIC xsd:decimal Types.NVARCHAR xsd:string
Types.DECIMAL xsd:decimal Types.LONGVARCHAR xsd:string
Types.BIGINT xsd:long Types.LONGNVARCHAR xsd:string
Types.INTEGER xsd:integer Types.DATE xsd:date
Types.SMALLINT xsd:short Types.TIME xsd:time
Types.TINYINT xsd:byte Types.TIMESTAMP xsd:dateTime
Types.REAL xsd:float Types.BOOLEAN xsd:boolean
Types.FLOAT xsd:float Types.BIT xsd:boolean
Types.DOUBLE xsd:double Types.OTHER xsd:string
Types.CHAR xsd:string
Types.VARCHAR xsd:string
Types.NCHAR xsd:string

Bug Fixes

[#11] Fix the incorrect value representation when the mapping term is specified as rr:IRI.
[#12] The API should distinguish between literal-value and object-value (IRI-value).