Unnecessarily complicate definition?

Hi!

I just had a look at http://www.w3.org/TR/activitystreams-core/

Normally I really like JSON. But when I see the examples, then I think
that someone tried to make the worst out of the both worlds "JSON" and
"XML".

With a structure like this you may have to implement some kind of
"JQuery for JSON" to fetch the relevant data.

Data with only a single language could be written this way:

{
  "@context": "http://www.w3.org/ns/activitystreams",
  "@type": "Object",
  "displayNameMap": {
    "en": "This is the title",
  }
}

Or that way:

{
  "@context": "http://www.w3.org/ns/activitystreams",
  "@type": "Object",
  "displayName": "This is the title"
}

Or even that way:

{
  "@context": "http://www.w3.org/ns/activitystreams",
  "@type": "Object",
  "displayName": {
    "@value": "This is the title",
    "@language": "en"
  }
}

And maybe there is some other way possible as well.

That really means that you need a parser that queries all these
variants. That really makes the things complicate.

I really would suggest a single definition. Flexibility maybe nice when
defining this stuff. But it is a nightmare in the implementation.

Michael

Received on Friday, 23 October 2015 17:09:16 UTC