Re: definition of natural mapping

On 11 Jan 2012, at 02:29, Eric Prud'hommeaux wrote:
> <http://www.w3.org/2001/sw/rdb2rdf/r2rml/#natural-mapping> includes an almost exhaustive list of defined SQL datatypes.
> 
> Bullet 2 specifies "If dt is a character string type, then the result is a plain literal without language tag whose lexical form is the SQL data value."
>  Given that the rest of the datatypes are listed, including INTERVAL which specifically has no defined mapping in DM or R2RML, I propose that bullet 2 list string types: "If dt is a character string type, i.e. CHARACTER, CHARACTER VARYING or CHARACTER LARGE OBJECT, then…"

The full list in standard SQL 2008 is:

CHARACTER, CHARACTER VARYING, CHARACTER LARGE OBJECT, NATIONAL CHARACTER, NATIONAL CHARACTER VARYING, NATIONAL CHARACTER LARGE OBJECT.

I have a preference for not spelling out this full list.

> Bullet 4 says "Otherwise, the result is a plain literal without language tag whose lexical form is the SQL data value cast to string." Given that we've already covered the SQL datatypes, I think this line as the potential to do more harm than good.

This view is outvoted. We discussed this at length and got input from several WG members to the effect that they'd prefer an explicit “default behaviour” for vendor types. See the thread “Request for comments: Breaking down the datatype mapping problem (ISSUE-69)” starting here:
http://lists.w3.org/Archives/Public/public-rdb2rdf-wg/2011Nov/0048.html

The WG accepted a resolution on ISSUE-69:
http://www.w3.org/2011/11/22-RDB2RDF-minutes.html

The accepted proposal explicitly states:

[[
The behaviour for vendor types remains unchanged: they are converted to plain literals by default, but it is noted that implementations are expected to add custom behaviour.
]]

You +1'd this proposal.

> (E.g. many DBs have native support for XML but we probably don't want to imply that XML is serialized as a (canonicalized?) plain literal.

The spec explicitly states:

[[
Note: R2RML processor implementations that handle vendor-specific types or user-defined types beyond the standard SQL 2008 datatypes are expected to do so by behaving as if the table above contained additional rows that associate the SQL datatypes with appropriate RDF-compatible datatypes (e.g., the XML Schema built-in types [XMLSCHEMA2]), and appropriate lexical transformations where required.
]]

> I proposed to strike the line.

The line is backed by a formal WG resolution.

> An alternative would be to refine http://www.w3.org/2001/sw/rdb2rdf/directMapping/LC/#defn-literal_map to say [[
> Definition literal map: a mapping from an SQL value with a datatype to:
> 
> • For row nodes, a canonical RDF literal representation of the column value as defined in points 1-3 in R2RML section 10.2 Natural Mapping of SQL Values.
> • For other R2RML natural RDF literal representation of the column value as defined in points 1-3 in R2RML section 10.2 Natural Mapping of SQL Values.
> ]] (note the added "points 1-3 in" text).

See above.

Many commenters stated that DM and R2RML should use the *same* mapping and should *not* have random exceptions in weird corner cases. I made an LC comment to that effect. We have a WG resolution that supports this. The WG has spent a *lot* of time crafting a compromise design that makes sense both for R2RML and for the DM and that was – at least at that time – acceptable to everyone. I'd rather not re-open this can of worms.

So can we please stick to the original plan for the DM?

[[
1. when creating literals, use the “natural RDF literal” corresponding to the SQL data value
http://www.w3.org/2001/sw/rdb2rdf/r2rml/#dfn-natural-rdf-literal
2. when creating IRIs, use the “canonical RDF lexical form” corresponding to the SQL data value
http://www.w3.org/2001/sw/rdb2rdf/r2rml/#dfn-canonical-rdf-lexical-form
3. perhaps add an informative link to this section:
http://www.w3.org/2001/sw/rdb2rdf/r2rml/#xsd-summary
4. suggest any editorial changes to section 10 that make integration with the DM smoother or otherwise improve the section
]]
http://www.w3.org/2001/sw/rdb2rdf/track/actions/174

Thanks,
Richard


> 
> -- 
> -ericP
> 

Received on Wednesday, 11 January 2012 14:38:30 UTC