Handling integers

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