W3C home > Mailing lists > Public > public-linked-json@w3.org > May 2019

Handling integers

From: Angelo Veltens <angelo.veltens@online.de>
Date: Fri, 31 May 2019 10:46:06 +0200
To: JSON-LD CG <public-linked-json@w3.org>
Message-ID: <83d36771-ad6f-64ae-2ca5-fc893c374961@online.de>
Hi everybody,

Question regarding Integers in JSON-LD.

Given the following snippet:

{
  "@context": {
    "@vocab": "http://vocab.example/"
  },
  "age": {
    "@value": "27",
    "@type": "http://www.w3.org/2001/XMLSchema#integer"
  }
}

Is there a JSON-LD algorithm / context to transform it to a real JSON
integer?

{
  "@context": {
    "@vocab": "http://vocab.example/"
  },
  "age": 27
}

They are semantically the same, but the upper construct is much more
complicated to handle in JavaScript application and does not give any
additional value. I would have expected at least the compact algorithm
to output the latter construct.

All the best,
Angelo


Received on Friday, 31 May 2019 08:46:32 UTC

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