Template:DPLA metadata/doc
Overview
The {{DPLA metadata}} template renders the file-information block for files uploaded by the Digital Public Library of America (DPLA) ingestion bot. Unlike most uses of metadata templates like {{Information}} or {{Artwork}}, the primary displayed fields are not authored as template parameters—they are read live from the file's structured data on Commons (SDC), so the rendered page always reflects the current SDC state. Note that while this template is only designed to work correctly for DPLA-maintained files, it does have fallbacks which should work in other situations, and might work for you on a DPLA file derivitave or even other Commons files (but please test first!).
The template renders up to two stacked boxes:
- A blue box showing metadata DPLA has contributed and continues to maintain. Each row is read directly from a DPLA-authored SDC statement (one marked with the determination method or standard (P459) determined by GLAM institution and stated at its website (Q61848113) "determination method = heuristic" qualifier).
- An optional light-yellow box showing additional metadata contributed by Wikimedia editors — either as explicit template parameters or as non-DPLA SDC statements on the same properties. This is where you should put your own corrections, translations, or supplementary descriptions. You cannot not edit the blue box, as they come from the DPLA-sourced SDC statements. DPLA bot will overwrite any changes during its next sync to those statements that don't align with the authoritative source metadata. The yellow box means you do not have to add a second {{Information}} template for user-contributed metadata, and it is also how we preserve data when we adopt another user's upload (of a participating institution's file) into the DPLA system, by migrating it into the template parameters.
When a file has neither DPLA-authored SDC nor user-contributed values, the template renders nothing.
Editing DPLA-uploaded files
If you want to add, correct, or translate metadata on a DPLA-uploaded file, you have two equivalent options:
1. Add wikitext parameters
Pass any of the parameters listed in the parameters table below directly to the template. The values appear in the yellow user-contributed box, alongside (or instead of) the DPLA-authored values:
{{DPLA metadata
|description = An expanded narrative of the scene depicted, with context not present in the source catalog.
|author = Smith, John, 1842-1901
|date = 1870-04
}}
The yellow box accepts either {{Information}}-style or {{Artwork}}-style parameter names where they differ — see the parameters table for the full set of accepted aliases.
To point at related images or alternate versions of the file (the standard {{Artwork}} / {{Information}} "Other versions" idiom), pass one or more {{Other version}} calls to the other versions parameter:
{{DPLA metadata
|other versions = {{other version|Alternate scan.jpg}} {{other version|Another crop.jpg}}
}}
Related images can also be added structurally via related image (P6802) (related image) SDC statements — the yellow-box row renders from either source.
2. Add a non-DPLA SDC statement
Any SDC statement on a property the template renders, when not marked as DPLA-authored (i.e. lacking the determination method or standard (P459) determined by GLAM institution and stated at its website (Q61848113) qualifier), is treated as user-contributed and appears in the yellow box.
This is the recommended path for multilingual translations: add a monolingual-text statement on title (P1476) (title) or original catalog description (P10358) (description) in your language without the DPLA determination-method qualifier. The translation will appear in the yellow box alongside the DPLA-authored English value.
Explicit wikitext parameters take precedence over SDC fallbacks when both are present for the same field.
Tracking categories
When a file carries DPLA-authored SDC, the template adds the file to three tracking categories:
- Media contributed by the Digital Public Library of America — the parent category for every DPLA upload.
- The regional DPLA hub category, resolved from the Commons media contributed by (P9126) (maintained by) statement whose object of statement has role (P3831) (object has role) is "aggregator" — for example, Category:Media contributed by the Plains to Peaks Collective.
- The contributing institution category, resolved from the collection (P195) (collection) statement — for example, Category:Media contributed by Denver Public Library.
Unresolvable partners fall back to Media contributed by the Digital Public Library of America with unknown partner or Media contributed by the Digital Public Library of America with unknown institution respectively; both are maintenance categories DPLA staff monitor.
User-only invocations (yellow box without blue box) do not add the tracking categories — these are reserved for DPLA-attributed files.
Use during bot upload
Current state
User:DPLA bot today uploads files with a {{Artwork}}-based wikitext block. The {{DPLA metadata}} template is not yet written at upload time; it is a parallel rendering option that displays the same metadata from the file's structured data (SDC) once the SDC sync phase has populated it. If you see a file using {{Artwork}} rather than this template, that is the normal current state — both renderings co-exist on Commons during the transition described below.
Planned workflow for new uploads
The template is designed to support the following lifecycle, which will become DPLA bot's default once the upload code is migrated:
- Upload — every file is uploaded with the {{DPLA metadata}} template populated by explicit wikitext parameters (title, description, creator, date, etc.). Wikitext parameters are necessary at this step because MediaWiki's upload API does not allow SDC statements to be attached in the same request, and Commons will not tolerate a file landing with no readable description even briefly.
- SDC sync — a subsequent edit posts the same metadata as MediaInfo structured data via wbeditentity. At this point the wikitext parameters become redundant — the same values now live in SDC and the Lua module renders them automatically.
- Cleanup — a one-time follow-up edit removes the redundant wikitext parameters, leaving a bare
{{DPLA metadata}}invocation. The template then renders the file's metadata entirely from SDC, so any subsequent edit DPLA makes to the source data flows through to the displayed page without re-editing the wikitext.
Step 3 is what makes the SDC the single source of truth: explicit wikitext parameters override SDC on display (see "Editing DPLA-uploaded files" above), so leaving them in place would mask any future SDC corrections.
Adoption of community-uploaded files
DPLA's pipeline includes duplicate-detection logic that identifies files already on Commons matching a DPLA item (typically uploaded by a Commons editor directly from the partner's catalog or from Flickr). When the pipeline adopts such a file into the DPLA system — renaming it to the canonical ... - DPLA - <id>.<ext> form — the editor-contributed metadata in the existing wikitext is migrated into {{DPLA metadata}}'s parameters, preserving attribution and any details the original uploader recorded. SDC sync then layers the DPLA-authoritative values on top, which appear in the blue box; the migrated editor values continue to appear in the yellow user-contributed box.
This adoption flow is not yet implemented; today's pipeline handles the duplicate detection and SDC sync against the {{Artwork}}-based wikitext format.
Parameters
Category:Template documentation#DPLA%20metadata/docRenders DPLA-authored structured data, plus optional user-contributed augmentations, as a two-box file-information block.
Usage
{{subst:DPLA metadata/doc |title= |description= |author= |date= |institution= |subject= |source= |permission= |other versions= }}
All parameters below are optional and appear in the user-contributed (yellow) box. Leaving every parameter unset is the normal case for a freshly DPLA-uploaded file: the blue box alone renders from SDC, and the yellow box is omitted.
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
titleTitle | Title | A user-supplied title — for example, a translation of the DPLA-authored title in your language. When unset, falls back to any non-DPLA title (P1476) (title) statement on the file's MediaInfo entity. | title (P1476) | optional |
descriptionDescription | Description | Additional or translated description text. When unset, falls back to any non-DPLA original catalog description (P10358) (description) statement. To add a translation in another language, use a language template: {{fr|Une description en français}}. | original catalog description (P10358) | optional |
authorartist, creator, Author, Artist, Creator | Creator | Creator of the original work. Same value goes into the "Creator" row regardless of which alias is used. When unset, falls back to any non-DPLA creator (P170) (creator) statement. Use the {{Creator}} template (e.g. {{Creator:Pierre-Auguste Renoir}}) where one is available. | creator (P170) | optional |
dateDate | Date | Date the original work was created. Use a {{Other date}}, ISO date, or natural-language text. When unset, falls back to any non-DPLA inception (P571) (inception) statement. | inception (P571) | optional |
institutionInstitution | Institution | The contributing institution. Accepts plain wikitext (a name or a {{Institution}} template call). When unset, falls back to any non-DPLA collection (P195) (collection) statement. | collection (P195) | optional |
subjectSubject | Subject | Subject keywords or {{Depicts}}-style descriptive terms. When unset, falls back to any non-DPLA main subject (P921) (main subject) statement. | main subject (P921) | optional |
sourceSource | Source | Source of the digital file or its original. Free-text wikitext, including URLs. Does not fall back to SDC — the blue box already shows DPLA's authoritative File URL / IIIF manifest / Catalog record links. | empty | optional |
permissionPermission | Permission | Additional licensing information that should appear in the yellow user-contributed box (for example, an editor-supplied {{Cc-by-sa-4.0}} tag asserting a downstream re-license). Does not fall back to SDC — the blue box already shows the DPLA-asserted rights from RightsStatements.org statement according to source website (P6426) (rights status). | empty | optional |
other versionsOther versions, other_versions | Other versions | Related images or alternate versions of the file. Accepts one or more {{Other version}} template invocations (the standard {{Artwork}} / {{Information}} idiom). When unset, falls back to non-DPLA related image (P6802) (related image) statements on the file's MediaInfo entity — including inferred-from-Wikitext statements the DPLA-bot migration writes when it adopts a community upload's {{Artwork}} "Other versions" field. Each SDC statement is expanded as {{other version|<filename>}} at render time, so a value populated via wikitext and one populated via SDC produce the same output. | related image (P6802) | optional |
|
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard. Existing template documentation Newly created template documentation and imports Wikipedia's help about TemplateData • Commons-specific information Renders DPLA-authored structured data, plus optional user-contributed augmentations, as a two-box file-information block.
| ||||||||||||||||||||||||||||||||||||||||||||||||||
Additional information
The template is intended to be used in the following namespaces: the File namespace
The template is intended to be used by the following user groups: no user group specified
Placement:
Top of the file description page (file namespace only).
Relies on:
Module:DPLA (rendering logic), Template:License from structured data (license display), Template:Institution (institution row), Template:Divbox (box framing), Template:NoC-US (RightsStatements.org NoC-US display).
Example
{{DPLA metadata|See the "Editing DPLA-uploaded files" section above for invocations with and without user-contributed augmentations.}}
renders as:
Localization
This template displays field labels and banner strings in the viewer's interface language, falling back to English when a translation is not yet available. Translations for most labels live in Module:DPLA/i18n — a Lua data page that any Commons editor can update.
How to add your language
- Open Module:DPLA/i18n for editing.
- Copy the existing
en = { ... }block. - Paste it below the English block and rename the key to your language code (e.g.
fr =for French,de =for German,pt-br =for Brazilian Portuguese). - Translate each string on the right of the
=sign. Keep the keys (left side) unchanged. - Save. The new translation is picked up on the next page render — no admin action needed.
Comments at the top of the module page describe each key, what it represents, and any per-key translation notes.
A few translation notes
creator≠ "Author". DPLA's source institutions are primarily archives, where the creator (per the Society of American Archivists definition) is the entity responsible for the records' creation or aggregation, not necessarily the author of any single item. For example, a folder of correspondence to the White House from the public has the Office of the President as its creator, even though the President didn't write the letters. Choose the archival-records term in your language rather than the literary-authorship one.
- Banner strings preserve the DPLA interwiki link.
banner_dplaandbanner_usercontain a[[w:Digital Public Library of America|Digital Public Library of America]]link. You can translate the visible label inside the pipe; the link target before the pipe must stay as-is.
$1/$2placeholders inpage_nandpartnership_text_*are substituted at render time with the page number, institution name, or hub name. Keep them in place; you can reorder them as your language's grammar requires.
- Short labels inside link cells.
file_url,iiif_manifest,catalog_record, andcircaappear inline next to small icons. Keep them brief.
Labels translated elsewhere
The following labels reuse existing Commons file-information messages, which already carry translations into many languages via translatewiki.net. To improve those translations, register an account at translatewiki.net and translate the messages there; no edit to this template or Module:DPLA/i18n is needed:
- Title —
MediaWiki:Wm-license-artwork-title - Description —
MediaWiki:Wm-license-information-description - Date —
MediaWiki:Wm-license-information-date - Source —
MediaWiki:Wm-license-information-source - Permission —
MediaWiki:Wm-license-information-permission
If a viewer's language is missing from one of these messages on Commons, the module falls back to the English string.
Wikidata-backed fallbacks
For six Module:DPLA/i18n keys, the module also consults the matched Wikidata label as an intermediate fallback — between the i18n table and the English baseline. Editors who add their language to Module:DPLA/i18n always win, but if a viewer's language hasn't been added there yet, Wikidata's community-maintained label catches the gap for these concepts:
- creator → creator (Q59275219) (archival creator)
- subject → subject (Q12310021)
- catalog record → catalog record (Q59211006)
- circa → circa (Q5727902)
- IIIF manifest → International Image Interoperability Framework (Q22682088)
- DPLA ID → P760 (Wikidata property — labels follow the same fallback chain as items)
So the priority order, per label, is: reused MediaWiki message (if applicable) → Module:DPLA/i18n[viewer-lang] → Wikidata label of the matched item or property in viewer-lang → English. Adding a translation to Module:DPLA/i18n is still useful for overriding wording (e.g. a more idiomatic local term than the literal Wikidata label) but no longer strictly required for these six keys.
This fallback is deliberately limited to single-noun concepts that match a Wikidata entity precisely. Institution, Partnership, and Page N don't use it because their Wikidata labels drift semantically across languages or carry a placeholder the WD label doesn't accommodate.
See also
- Module:DPLA — the Lua module that implements rendering.
- Module:DPLA/i18n — the translation data table.
- Commons:Digital Public Library of America/Modeling — the DPLA bot's SDC modeling reference (which properties and qualifiers the bot writes, and what each one means).
- Commons:Digital Public Library of America — DPLA's project page on Commons.
- Commons:Structured data — Commons SDC overview.
- {{Information}} and {{Artwork}} — the standard file-information templates {{DPLA metadata}}'s yellow-box parameters mirror.