Re: DM and R2RML should use same datatype mapping

On 30 Oct 2011, at 23:11, Eric Prud'hommeaux wrote:
> A tool which uses e.g. floats or ints to manipulate the graph defined by R2RML would have to qualify its conformance by the version of the database to which it was connected (e.g. "offers R2RML for MySQL 5.01, but not Oracle 11G").

Neither floats nor ints are sufficient to represent xsd:decimal even if we consider only xsd:decimals restricted to 18 digits.

Any programming language these days has some sort of arbitrary-precision decimal type in a readily available library. That is sufficient for conformance with any SQL 2008 conforming implementation of DECIMAL, regardless of how many digits it uses.

> General compatibility with R2RML over any database can only be preserved if you don't use native types at any step of the e.g. query answering process.

I have no idea what you're trying to say here.

> Applying the unbounded precision support to DM would mean that FeDeRate would no longer be an implementation (it uses Jena to parse and execute queries which I believe uses java native types)

You may want to check that again. Jena uses BigDecimal to represent xsd:decimal.

> and SWObjects would have an even harder time as it is intended to connect multiple databases with potentially different maximum precisions.

I don't understand the problem. When you query the DB you get back some value. Then you stuff that value into a BigDecimal.

I don't understand how knowing that you're never going to see a decimal longer than 18 digits simplifies an implementation. It's not like it's particularly hard to write arbitrary-precision code.

As far as I can see, the text in R2RML works fine, is easy to implement, easy to test, and meets user expectations. I have seen no evidence yet that changing the text would benefit users or implementers, and I have seen no argument being made why R2RML and DM should differ. As far as I can tell, you're trying to solve an imaginary problem.

Best,
Richard

Received on Monday, 31 October 2011 00:09:45 UTC