Description
We previously discussed this as issues #87 and #81.
What is the range of the coercion operator in JSON-LD? As indicated by issue 87, it is any value (not an object or an array). This would include boolean and numeric, in addition to string. One possibility is limiting this to string, or doing it on a case-by-case basis. (boolean could coerce numeric types based on 0 or not 0, integer or double could coerce boolean or other numeric).
I believe that the best thing for expansion, compaction (and possibly framing) is to not modify values expressed using native datatypes. Coercion needs to happen when turning into RDF triples (which, in my implementation, is used to flatten data for framing), but otherwise should be left alone.
The history of native datatype conversion is somewhat contradictory, and issue #87 would have all values coerced to %1.16E, which leads to ambiguities.
PROPOSAL: native datatypes (boolean and numeric) are preserved unchanged through expansion and compaction, even if the associated property has coercion.
PROPOSAL: native datatypes are converted to typed literals when converting to RDF, independent of coercion of associated property, with native numbers having a fractional or expenential lexical representation converted using %1.15E. String representations of typed literals are not converted when transforming to RDF.
PROPOSAL: typed literals are converted to string form (@value and @datatype) when transforming RDF to JSON-LD.
OPEN: conversion/representation of native datatypes when framing.
See also:
http://lists.w3.org/Archives/Public/public-linked-json/2012Mar/0027.html
http://lists.w3.org/Archives/Public/public-linked-json/2012Mar/0028.html
http://lists.w3.org/Archives/Public/public-linked-json/2012Mar/0029.html
http://lists.w3.org/Archives/Public/public-linked-json/2012Mar/0031.html