Jump to content

Help:Contributing/dataCuration

From Wikibase
Revision as of 20:51, 22 November 2026 by SeedBot (talk | contribs) (Mark the curated-dataset guide live (deployed 2026-11-22) (via update-page on MediaWiki MCP Server))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Languages: English · français · Esperanto

Deployed 2026-11-22 (PR #211). The curated-dataset store, APIs, parser functions and Dataset: namespace are live on production.

A curated dataset is a hand-picked scientific table (for example a meta-analysis table cited by an article) stored as structured, queryable data instead of a plain-text table. Each dataset has a manifest, a readable Dataset: page, and a set of measurements that can be queried and exported.

What lives where

  • Dataset:<slug> — the readable page: infobox, one section per table, provenance, footnotes and a citation block.
  • Dataset:<slug>/manifest — the canonical manifest (JSON). It is the source of truth; the database rows and the Wikibase items are derived from it. Do not edit the generated page or the manifest by hand — update the manifest through the tools and re-apply it.
  • The measurement store — the wb_dataset_* tables. They are queried by the page functions and by action=datasetquery; never edit them directly.
  • Wikibase — one item for the dataset and one per table, with the source, table number/id, review status and extraction method. The dataset item is sitelinked to Dataset:<slug>.

Reading a dataset

A Dataset: page uses four parser functions:

  • {{#dataset-table:<table_id>|panel=<key>}} — the table, with linked footnote superscripts.
  • {{#dataset-footnotes:<table_id>}} — the notes list with a backlink to the table.
  • {{#dataset-provenance:<table_id>}} — source PDF, page, extraction method, confidence and review status.
  • {{#dataset-cite:<dataset_id>}} — a compact citation block.

To query the store programmatically, use action=datasetquery (JSON) or format=csv; the MCP embeddable-dataset-query tool wraps it. The data is also reachable from the dataset page, so ordinary readers do not need the API.

Adding a dataset

The recommended flow is:

  1. Pick the source (the paper and the table). Prefer an open text layer; the PDF is the fallback.
  2. Run pdf-figures-mcp extract_pdf_table on the table. It returns the manifest envelope: the manifest, a validation report and a manifest_path.
  3. Fill the dataset-level fields the extractor cannot know (source page, source item, DOI, year, licence, rights basis, curator) and review the cells, footnotes and column labels.
  4. Hand the envelope (or its path) to embeddable-dataset-upsert with mode="validate". Fix every error and review the warnings.
  5. Apply with mode="apply". The wiki saves the manifest, queues the apply job, writes the database rows and Wikibase items, renders the page and returns a run_id. Poll embeddable-dataset-status until the run is ok/partial/failed.
  6. Review the dataset page: table, footnotes, provenance and citation. Set the table's review status to checked or verified after human review.

The manifest contract is the same one the wiki, the MCP client and the extractor use. The wiki is the authoritative validator; a validation report from the extractor is advisory.

Manifest rules to remember

  • value_text always holds the verbatim cell string; a numeric/date cell also carries exactly one typed value (value_float, value_int or value_date).
  • Cells are long-format observations: one row per (row, column) cell. Each cell can carry footnote_keys.
  • Footnotes are first-class: every marker needs a note, every note must be referenced or have scope=table. A missing marker/note is a validation error or warning.
  • The source PDF is identified by its exact SHA1 (and, when supplied, its revision). The file's internal-use marker is provenance only: extracted data is not copyright-protected, so a public dataset may cite an internal-use PDF. Do not reject a public dataset because its source PDF is internal.
  • access_tier is the dataset's audience tier, independent of the PDF gate. public is readable by anyone; registered needs a logged-in session; internal is deny-by-default until the group mechanism is enabled.

Access tiers

The v1 store accepts public and registered data; internal is stored but not readable by anyone until an operator adds the allowed groups to $wgEmbeddableContentDatasetInternalGroups (server configuration). Ask an administrator before storing internal data. The source PDF remains behind the existing internal-use file gate; the dataset tier is declared in the manifest, not inferred from the file.

Review status

Each table carries a review status:

  • unreviewed — extracted but not checked.
  • checked — a human compared the extracted cells with the source.
  • verified — independently verified by a domain expert.

The status is shown in the provenance line and is queryable. A dataset can be published while a table remains unreviewed; the status makes that visible.

See also