W3C home > Mailing lists > Public > public-linked-json@w3.org > March 2012

RE: Clarification of @set and expansion

From: Markus Lanthaler <markus.lanthaler@gmx.net>
Date: Wed, 21 Mar 2012 19:03:58 +0800
To: <public-linked-json@w3.org>
Message-ID: <009401cd0752$55a74270$00f5c750$@lanthaler@gmx.net>
Hello,

I think I overlooked something when I first asked how expansion is supposed
to work now. I think expansion should always return an array at the top
level and not sometimes an object and sometimes an array. This is line with
our previous decision to convert every single value into an array and would
generate a very predictable structure which makes it quite easy to work
with. So, looking again at my last example:

{
  "@id": "id1",
  "@type": "t1",
  "term1": "v1",
  "term2": { "@value": "v2", "@type": "t2" },
  "term3": { "@value": "v3", "@language": "en" },
  "term4": 4,
  "term5": [ 50, 51 ],
}
 
 
I would argue that the result of expansion should be (plus IRI expansion):

[
  {
    "@id": "id1",
    "@type": [ "t1" ],
    "term1": [ "v1" ],
    "term2": [ { "@value": "v2", "@type": "t2" } ],
    "term3": [ { "@value": "v3", "@language": "en" } ],
    "term4": [ 4 ],
    "term5": [ 50, 51 ]
  }
]



--
Markus Lanthaler
@markuslanthaler
Received on Wednesday, 21 March 2012 11:04:43 UTC

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