Data talk:Example from MediaWiki org.tab
Should be a table
At Wikimedia Commons, this kind of file would be rendered as a table, like Commons:Data:Wikipedia statistics/data.tab (which gets rendered as a wikitable on the Wikimedia Meta-Wiki by Template:List of wikis by project↗ using Module:List of wikis by project↗). Need to look into whether it's possible to do that here (I mean, see this as a table — I guess we [in the person of User:Most2dot0] already know how to get data from a JSON file once it's on this wiki). See also Commons:Extension:JsonConfig/Tabular and some other pages I need to find again. Will post them here later. - dcljr (talk) 22:15, 28 August 2025 (UTC)
- According to ChatGPT, that's just a preview and there are no generic built-in means to get a Wikitext table from it. Asked what's the idea behind it, as it mixes data with presentation without really supporting that presentation, see it's answer below. Note that Graph can render it as a table, but only in form of an image. So custom Lua is needed to use it in wikitext pages. --Most2dot0 (talk) 08:25, 29 August 2025 (UTC)
Idea behind Tabular Data on Wikimedia ( according to ChatGPT)
The Tabular Data (`.tab`) system is not a generic JSON store. It was introduced with very specific goals:
Purpose
- Support the Graph extension (Vega) with a predictable schema.
- Allow non-technical editors to upload datasets in a safe, uniform way.
- Ensure that data files are license-tagged, sourced, validated, unlike arbitrary JSON.
Schema trade-off
- `"schema": "TabularData"` enforces columnar data (`number`, `string`, `date`).
- This makes it easy for Graph to map columns to axes, colors, labels.
- But it does mix data with minimal presentation metadata (column names, descriptions).
Why not plain JSON?
- Security: Arbitrary JSON could be abused. JsonConfig only allows whitelisted schemas.
- Stability: Graphs need predictable data layout. Tabular Data guarantees columnar structure.
- Governance: Each `.tab` has license + sources → aligns with Wikimedia content policies.
Downsides
- Limited expressiveness. You cannot nest structures beyond flat rows.
- Not optimized for Lua-driven logic. For computation or rich data modeling, plain JSON is more efficient.
When to use what
- Use Tabular Data (.tab) → datasets powering charts/graphs on-wiki, with Commons-style preview, sourcing, and licensing.
- Use plain JSON (.json via JsonConfig) → for Lua consumption of arbitrary structures.
- Use Wikidata → for semantic or broadly reusable structured knowledge.
In summary: Tabular Data is a compromise to make graphing data safe, human-manageable, and compliant with Wikimedia policies. For raw Lua use, a tailored JSON schema is leaner.