Wikipedia:GLAM/Museum of New Zealand Te Papa Tongarewa/The whole GLAM package/Upload images
How to use this manual · Set up your project · Select your topic · Select images · Make Wikidata edits · Upload images · Create and edit articles · Review and promote · Project checklist |
With Wikidata up to date, you can now upload your selected images into Wikimedia Commons. You’ll do this in OpenRefine too, along with a table of descriptive metadata and more structured Wikidata statements.
Modelling data for collection objects
editChecklist task: Model image metadata
Images loaded to Wikimedia Commons can have both descriptive and structured metadata.
Descriptive metadata is what shows on the page underneath the image. Most images just the standard title, description, creator and license, but you can replace these with much more information if you use a template. See more about using a template below.
Structured metadata connects to Wikidata using statements about the image, like the ones you added earlier about people, places and things. People looking at the image on the Commons can see these too, but the real benefits are what can be done automatically across different Wiki platforms and beyond.
Create a data model for both descriptive and structured metadata so you know what goes into your final export and OpenRefine project. You’ll want a lot of that information to be in both places, so don’t worry if it looks like you’re doubling up.
Include:
- The label you want to give it when you upload your images
- Where in your own system the data comes from
- Any transformations you have to do before uploading
- For structured data, include both statements and qualifiers to those statements
Example data structures
editLabel | Source | Transform |
---|---|---|
Basis of record | API: basisOfRecord | None |
Common names | API: identification > vernacularName > title | Collate list, separate with a comma |
Collection date | API: evidenceFor > atEvent > dateCollected | Change from ISO to DD MONTH YYYY |
Property | Source/transform | Qualifier | Source/transform |
---|---|---|---|
depicts | API: depicts > title
Add item for each listed value |
||
source of file | Standard item: file available on internet | described at url | URL for record |
country of origin | API: production > locality > country
No transformation |
Find or create a template
editChecklist task: Create/prepare template
A template lets you share more detailed information about an image, making it easier for anyone to find, understand and use it. The standard template is called Information, and most other templates look pretty much the same – just with more fields.
You can use an existing template or create your own, and then do a little work in OpenRefine to combine data from several columns, generating the Wikitext (marked up text that Wiki platforms use for things like headings, tables and links) that will fill it in.
Template | Details |
---|---|
Artwork |
|
Photograph |
|
Specimen |
|
Biohist |
|
TePapaColl |
|
File description pages has some other Commons templates, including for maps and books.
If the available options don’t work for your collections, see how to create a Commons template to make your own custom one.
Whatever you choose, make sure the fields – and fieldnames – in your template and data model are completely lined up. Spelling and capitalisation are really important.
Export your data and images
editChecklist task: Prepare and load images
Export your data one last time!
Make sure you include:
- All the fields for both the descriptive and structured metadata – these might overlap
- Columns for Wikitext, Filename, Filepath, and any category values you want to add
If different sets of images need different schemas (for example, if you have photographs and artworks), they’ll have to be separated out into their own OpenRefine projects – you can only use one schema at a time.
Export the images you’re going to use to a folder. Make sure the folders and filenames you use match up with what’s in your OpenRefine project.
Load images and data from OpenRefine
editThere are three main bits of preparation you still need to do:
- Create Wikitext for descriptive metadata
- Reconcile Wikidata values and Wikimedia Commons filenames
- Enter your upload schema
Read the OpenRefine guidance on uploading files for the full details.
Wikitext
editOpenRefine lets you transform values in all sorts of ways using little snippets of Javascript or General Refine Expression Language (GREL). You can link together simple instructions to do some really complex changes.
You’re going to use GREL to build the field your selected template will turn into the table of data on each image’s page. Write this up in a text editor like Notepad++ or Sublime Text first – it’s a lot easier to edit there.
How to create a GREL instruction to build Wikitext – OpenRefine recipes
Tip This might take some trial and error, so use OpenRefine’s Undo function as much as you need to. |
Reconciliation
editFor each column of QIDs, reconcile the values. This ensures your structured data statements hook up to the right Wikidata items.
Now, reconcile the filenames – just the names, not the whole file path. This prepares the pages on Wikimedia Commons you’re going to upload to.
Schema
editYou now have all the data you need, in the right places. You just have to tell OpenRefine what to do with it.
See “Build your schema” in OpenRefine’s guide to bulk uploading
Follow the instructions to drag and drop your column names into the right slots.
Example You can see the JSON file for Te Papa’s schema on Github. |
You can now upload your images. Review the OpenRefine instructions to make sure you’ve covered everything.
Tips when uploading your images:
- Do a test run with a few records and check they look right to you
- Use a bot password linked to your Wikimedia Commons login
- Do it as a team – but have snacks ready, because it’ll take a while
When everything’s uploaded, check the images. If there are mistakes, you can always fix them! If you can, add the urls to your collections database – it’s useful to keep track of where your collections end up.
Next up: Create and edit articles