← Documentation home

Canonical Markdown source · Oct 20, 2018

Meta Wiki Art Bridge (MediaWiki + Wikibase)

meta-wiki-art-bridge.md · 90 lines · SHA-256 7a43fb0c48b8

Status: Era C5 implementation is active, with the source-of-truth contract finalized.

Decision

Meta Museum will use a MediaWiki instance extended with a custom Wikibase as the publication surface for the Meta Wiki Art bridge.

This extends the existing C5 plan from "publish to MediaWiki" to a structured semantic publication model that supports statement-level references and authority reconciliation.

Source-Of-Truth Contract (Finalized)

Chosen model: publication-target-only.

  • Canonical source of truth: Meta Museum internal Linked Art records in Postgres/storage (`/api/records` domain model).
  • Wiki role: governed publication projection layer (MediaWiki narrative + Wikibase statements/references).
  • Edit ownership: publication content may evolve on wiki, but canonical data corrections must flow through Meta Museum ingest/reconciliation pipelines first.
  • Publish gate: `/api/wiki-drafts/[id]/publish` preflight now requires the draft `sourceRecordId` to resolve to an existing internal record.
  • Runtime policy key: `METAMUSEUM_WIKI_SOURCE_OF_TRUTH_MODE` (default and current enforced mode is `publication-target-only`).

Community-editable mode now requires explicit opt-in and reverse-ETL enablement:

  • `METAMUSEUM_WIKI_SOURCE_OF_TRUTH_MODE=community-editable`
  • `METAMUSEUM_WIKI_REVERSE_ETL_ENABLED=1`

Reverse-ETL endpoint:

  • `POST /api/wiki-sync/reverse-etl`

Deterministic merge policy (implemented):

  1. Resolve internal target record via explicit `internalEntityId` or bidirectional sync map (`wikiItemId` -> internal ID).
  1. Normalize + sort incoming claims deterministically (`property`, `modifiedAt`, `changeId`, `value`).
  1. Apply per-property precedence:
  1. Idempotency:
  1. Mapped claim updates:
  1. Unmapped claim properties remain no-op for record fields but are tracked in merge state for deterministic conflict handling.
  • newer `modifiedAt` wins;
  • tie-break by lexicographic `changeId`;
  • older/equal precedence claims are skipped.
  • replayed `changeId` is skipped safely.
  • `P_label` -> record `_label`
  • `P_primary_name` -> first `identified_by` Name
  • `P_description` -> `referred_to_by` statement (`Wikibase Description`)
  • `P_publish_rights_status` -> `referred_to_by` statement (`Wikibase Publish Rights Status`)

Why this fits

  1. Linked Art alignment:

Linked Art JSON-LD, RDF modeling, and planned SPARQL workflows map directly to Wikibase's item/property statement model.

  1. AI grounding:

C4 Graph-RAG and NL→SPARQL require verifiable, structured entities; Wikibase supplies a strong query/citation substrate.

  1. Provenance requirements:

Meta Museum's "cite or refuse" rule is reinforced by Wikibase statement references and qualifiers.

  1. Authority reconciliation:

B6/C2 authority-cache work (AAT/ULAN/TGN/Wikidata/GeoNames/LoC) maps naturally to external IDs and exact-match links in Wikibase.

Sequencing constraints

This bridge is intentionally deferred until Era C5. It must not ship before Era B hardening is complete.

Required gates before write-path activation:

  1. SHACL validation stable (B2).
  1. Postgres as storage of record (B3 cutover complete).
  1. Auth + role-gated write paths and auditability (B4).
  1. Authority cache and reconciliation baselines established (B6/C2).

Planned C5 flow

  1. Curator/agent creates `WikiDraft`.
  1. Draft enters human review queue with rights + citation checks.
  1. Approved draft publishes to MediaWiki/Wikibase:
  1. Publish action writes an audit trail and stores return identifiers for round-trip sync.
  • narrative article content (MediaWiki),
  • structured claims + references (Wikibase),
  • source attribution + rights templates.

Boundaries (Out Of Scope For Era A/B)

  1. Live MediaWiki/Wikibase provisioning in current app runtime.
  1. Public write automation from agents without explicit human approval.
  1. Direct external-authority query on request path.

Migration operations playbook

For cost-first rollout (Wikibase Cloud now) with a controlled path to self-hosted Wikibase later, use:

  • wikibase-cloud-migration-checklist.md(wikibase-cloud-migration-checklist.md)