rufuspollock added a comment.
Hi, I'm one of the authors of JSON Table Schema and of the Data Package family of specifications (I was also an author on the W3C spec which was originally based on Data Packages but diverged in complexity substantially ...). I've responded to @Yurik's question that he posted on the Data Protocols issue tracker: https://github.com/dataprotocols/dataprotocols/issues/265 To echo what I said there ... ---- Great to hear about this. I would encourage taking a good look at: JSON Table Schema: http://dataprotocols.org/json-table-schema/ Its very simple and already does exactly what you want :-) I'd definitely recommend adopting that model for describing headers and types rather than rolling your own if you could. In addition for the overall structure you could adopt the "resource" part of a (Tabular) Data Package model <http://dataprotocols.org/data-packages/#resource-information> What this would look like ------------------------- Here's your example from your proposal <https://www.mediawiki.org/wiki/Extension:JsonConfig/Tabular#Example> redone using this approach. As you can see it's just as simple and if anything a bit more expressive -- plus you can leverage all the work that has already been done developing these (and the tooling)! **Note:** the data could be simple array of arrays rather than array of objects if that were preferred (it is more concise but is a it less "json-ic"). I've done a 2nd example showing that ... { "title": "Some good fruites for you", "title@es": "Algunas buenas frutas para ti" "schema": { "fields": [ { "name": "label", "type": "string", }, { "name": "value", "type": "number" }, { "name": "stored", "type": "boolean" }, { "name": "localName", // would suggest changing this type to "object" "type": "localized" } ] ], "data": [ [ { "label": "peaches", "value": 100, "stored": true, "localized": { "en": "in english", "es": "esto puede estar en español", "fr": "this could be in french" } } ], [ { "label": "plums", "value": 32, "stored": false, "localized": { "en": "in english", "es": "esto también está en español", "fr": "this is also in french", "gr": "this could be in greek" } } ], ... ] } **Example with row data as arrays rather than objects** { "title": "Some good fruites for you", "title@es": "Algunas buenas frutas para ti" "schema": { "fields": [ { "name": "label", "type": "string", }, { "name": "value", "type": "number" }, { "name": "stored", "type": "boolean" }, { "name": "localName", "type": "localized" } ] ], "data": [ [ [ "peaches", 100, true, { "en": "in english", "es": "esto puede estar en español", "fr": "this could be in french" } ], [ "plums", 32, false, { "en": "in english", "es": "esto también está en español", "fr": "this is also in french", "gr": "this could be in greek" } ], ... ] } TASK DETAIL https://phabricator.wikimedia.org/T134426 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Yurik, rufuspollock Cc: rufuspollock, RobLa-WMF, Danny_B, DannyH, StudiesWorld, Steinsplitter, Aklapper, Lydia_Pintscher, ekkis, Matanya, MarkTraceur, JEumerus, Thryduulf, Milimetric, MZMcBride, Bawolff, -jem-, gerritbot, Pokefan95, TerraCodes, intracer, ThurnerRupert, brion, Jdforrester-WMF, Eloy, TheDJ, Yurik, Zppix, Riley_Huntley, D3r1ck01, Izno, Luke081515, JAllemandou, Wikidata-bugs, aude, El_Grafo, Ricordisamoa, Shizhao, fbstj, Fabrice_Florin, Mbch331, Jay8g, Krenair, jeremyb _______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
