d2rq/d2rq — Issue #112: xsd:base64Binary encoder/decoder
Author: cygri
Created: 2012-03-07 00:03:21+00:00
State: open
Labels: conformance, expressivity, priority, R2RML

This is needed to support the W3C Direct Mapping and R2RML.

We currently handle binary datatypes (`BINARY`, `VARBINARY`, `LONGVARBINARY`, `BLOB`) by trying to treat them as strings. This is not particularly useful (binary data looks bad in any serilization) and even fails on some database drivers because they don't support the `getString(rowIndex)` method on `java.sql.ResultSet` for binary types (e.g., Oracle).

It would be better to slap a `d2rq:datatype xsd:base64Binary` on these columns in the mapping generator, and then export their values by base64-encoding them. The reverse would have to be done when these values are queried for in SPARQL or `find` queries.

This may imply a new type of quoting, in addition to `d2rq:numericColumn`, `d2rq:textColumn` and `d2rq:date/timeColumn`.

See also [R2RML's Natural Mapping](http://www.w3.org/TR/r2rml/#natural-mapping) where this behaviour is specified.