W3C home > Mailing lists > Public > public-linked-json@w3.org > September 2011

Type Coercion is confusing (ISSUE-34)

From: Markus Lanthaler <markus.lanthaler@gmx.net>
Date: Wed, 28 Sep 2011 15:11:13 +0200
To: <public-linked-json@w3.org>
Message-ID: <011801cc7de0$1a0e8fd0$4e2baf70$@lanthaler@gmx.net>
OK.. last but not least I would like to discuss the type coercion feature
which I find a bit confusing.

The reason is that it works the other way round as it is normally expected
by developers/programmers. An exemplary type coercion definition looks as

  "xsd:integer": "age",
  "@iri": "homepage"

Which says that age is an integer and homepage is an IRI. I expect that an
average developer would try to specify it exactly the other way round:

  "age": "xsd:integer",
  "homepage": "@iri"

What was the rationale of doing it the other way round? Isn't it even in the
processing algorithms more handy if it is stored in the second form?

Markus Lanthaler

Received on Wednesday, 28 September 2011 13:11:56 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:18:32 UTC