Lesson 3 4 min Free lesson

Mapping columns to fields

Tell CSV Import where each column goes, including two fields from one column, images by address, item sets, and several columns at once.

Mapping is where you tell CSV Import what each column means. Columns named after their fields map themselves; the rest you map by hand, and one column can go into more than one field. Most spreadsheets you're given, from donors, other departments, or older systems, need some hand mapping, so this is the screen you'll spend the most time on.

In this lesson you import the six Hollis seed packets from the spreadsheet you prepared in lesson 2. Five of its columns map themselves. You map the other four by hand: the seller into two fields, the year, the image of each packet's front, and its item sets.

The video maps each column and runs the import, then looks at the other kinds of mapping in the sidebar and the mistakes people make most often. This page has the same steps. Going further and When things go wrong stay closed until you open them.

Before you start

  • Import the Hollis item sets, as in lesson 1. The packets go into two of them.
  • Download hollis-packets.csv. Its Front column points at images that are already online, so CSV Import can fetch them.

Start the import

  1. Click CSV Import in the left menu and choose hollis-packets.csv.
  2. Leave Import type on Items, tick Automap with simple labels, and type Hollis seed packets in Comment.
  3. Click Next.

On the Map to Omeka S data tab, Identifier, Title, Description, Subject, and Rights already show their fields. Seller, Year, Front, and Item set show nothing yet: a column with no mapping isn't imported.

The Map to Omeka S data tab with five columns mapped automatically and four empty
Columns named like a field map themselves.

One column into two fields

The Hollis Brothers both made and sold their packets, so the Seller column belongs in Creator and in Publisher.

  1. Click the plus sign beside Seller (Add mapping). A sidebar opens, titled with the column's name.
  2. Open Properties. Type creator in Filter properties and click Creator under Dublin Core. It's highlighted.
  3. Clear the filter, type publisher, and click Publisher. You can pick as many fields as you like before you apply them.
  4. Click Apply changes. Seller now lists both.

The small i beside each field (More info) says what the field is for, which helps when two names sound alike.

The Add mapping sidebar for Seller, with Creator and Publisher highlighted under Dublin Core
One column can fill two fields.

The year

  1. Click Add mapping beside Year.
  2. Under Properties, filter for date and click Date, then Apply changes.

Date suits a packet, which was printed for a season. For a book or a catalog, Date Issued is more exact; lesson 4 uses it.

An image from its web address

The Front column holds the address of each packet's scan. CSV Import downloads each one and attaches it to the item as a file.

  1. Click Add mapping beside Front.
  2. Open Media source, choose URL, and click Apply changes.

The address must open the image file itself, usually ending in .jpg, .png, or .tif, not a web page that shows it. Lesson 6 covers several files per item and the link problems you'll meet.

Item sets by title

  1. Click Add mapping beside Item set.
  2. Open Item-specific data. Under Item set (by selected property), choose Title, then Apply changes.

Each cell must match an existing item set's title exactly. You could also choose Identifier and fill the column with HB-PKT, or Internal ID and use Omeka's own numbers. Identifiers are safest: a title can be edited, but the identifier stays.

Column options, several at once

Two things are left. Rights holds a link, and Subject and Item set hold several values. Each column's Configure button sets its options, and you can set the same option on several columns at once.

  1. Click Configure beside Rights, set Data type to URI, and click Apply changes. Lesson 4 explains data types.
  2. Tick the boxes beside Subject and Item set, then click Batch edit options above the list.
  3. Tick Use multivalue separator and click Apply changes. Both columns now show it.
  4. Open Basic Settings and replace the comma in Multivalue separator with |. Check that Sites lists your site, so the packets appear on it.
Every column mapped, with Seller going to Creator and Publisher, Front to URL, and Item set to Item set by Title
Every column has somewhere to go.

Import and check

  1. Click Import. On Past Imports, refresh until Status reads completed and Result shows Added: 6 items.
  2. Open Items and open Sweet pea, Hollis Finest Mixed. Check its Creator and Publisher, its Date, its subjects as two separate values, the front of the packet under Media, and the two item sets on the Item sets tab.

Going further

The kinds of mapping, other vocabularies, and two columns into one field.

Everything a column can map to

The Add mapping sidebar groups what a column can become:

  • Properties: any field in any vocabulary your site has, Dublin Core and beyond.
  • Item-specific data: the item sets an item goes into.
  • Media source: a file, image, or video to attach (lessons 6 and 7).
  • Generic data: the resource template, class, owner, or visibility, set row by row (lesson 5).

The groups change with the Import type: an item set import offers Open to additions, and a media import offers the item each file belongs to.

Two columns into one field

Several columns can map to the same field. A spreadsheet with Subject 1, Subject 2, and Subject 3 can map all three to Subject, and each item gets every value that isn't empty. It's a good way to handle a file you didn't make, without merging the columns first.

Other vocabularies

The property list holds every vocabulary installed on your site, such as Bibliographic Ontology (for page counts and editions) and Friend of a Friend (for people). A field from another vocabulary maps exactly like a Dublin Core one. Filter by the field's name, or by its vocabulary's prefix, such as bibo.

Mapping isn't saved

CSV Import doesn't keep a mapping for next time. If you import the same kind of spreadsheet often, name its columns after their fields, as in lesson 2, so most of the mapping happens automatically.

When things go wrong

What to do when values land in the wrong field, run together, or go missing.
  • A column mapped to the wrong field. Click Remove mapping beside the field under that column, then add the right one.
  • Two subjects arrived as one value, Sweet peas|Seed packets. The column didn't have Use multivalue separator, or the separator in Basic Settings was still a comma. Undo the import on Past Imports, fix both, and import again.
  • The items aren't in their item sets. The cell didn't match a title exactly, or the set didn't exist yet. The import's Log names each one (is not a valid item set). Fix the cells and undo and import again, or add the items to the set with a batch edit.
  • An item has no image. If its row isn't missing, the image column wasn't mapped to Media source. If the item is missing entirely, its image couldn't be fetched: lesson 6 covers why.
  • A whole column is missing from the items. It had no mapping. Columns with no mapping are skipped without a warning, so check the mapping page column by column before you click Import.

Your turn

Sign in to tick off what you've done and keep your place in the course.

Log in for Support