Smalyshev added a comment.

I'm looking at https://www.wikidata.org/wiki/Special:EntityData/Q42.json structure, and I see it is:

{
  "entities": {
    "Q42": { ...stuff... }
  }
}

So, why can't we have:

{
  "entities": {
    "Q42": { ...stuff... }
  },
  "@metadata": {
     "version": "1.0",
     "phase-of-moon": "gibbous"
  }
}

etc.? I don't think well-behaved clients should mind? But even if they do, it shouldn't be hard for them to make one-time change to ignore @metadata if they don't want it? After all, we already have other items besides entities - e.g. in API response there's success.

The same can be done with wbgetentities, etc. APIs. For the dump it's a bit harder as we don't have any kind of encompassing structure beyond entities... Maybe we should make it use "entities" too? It will be a breaking change but at least it breaks the stalemate and allows us to easily add more info later. It won't be also hard to distinguish between the formats, including by streaming readers - you actually need only the first character to know which one you're dealing with, and converting new one into old one or back should be rather easy.


TASK DETAIL
https://phabricator.wikimedia.org/T92961

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Smalyshev
Cc: Pfps, aude, Smalyshev, Ricordisamoa, Addshore, Lydia_Pintscher, adrianheine, JanZerebecki, daniel, Tobi_WMDE_SW, Aklapper, D3r1ck01, Izno, Wikidata-bugs, Mbch331
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to