Koha How-To

Keyword to MARC mapping / Koha to MARC Mapping

As we upgrade to Koha version 19.11, there are some changes afoot in how Koha displays title information beyond the 245$a. What had been configured in Keyword to MARC Mapping is now handled through some new database fields and your Koha to MARC Mapping.

If you had your subtitle display set up through Keyword to MARC Mapping in 19.05, you may need to reset a thing or two in 19.11, and this blog post will help you know what to look at.

If you hadn’t ever set up your subtitle display in 19.05 or earlier, this change won’t mean much to you, but this blog post will be helpful if you want to set it up now!

Keyword to MARC Mapping

First, let’s talk about what Keyword to MARC Mapping did in 19.05 and earlier versions of Koha. This allowed us to define the MARC subfields that we wanted to show as the subtitle when checking an item in or out or performing other actions within. Without this, most Koha screens show just the 245$a when interacting with a title, which is often not enough information to really know which title you’re working with -- after all, the 245$b can make the difference between Batman: The Long Halloween and Batman: Year One, and I don’t need to tell you how crucial that distinction is!

However, Keyword to MARC Mappings never learned to do anything other than subtitle, which eventually got confusing. The interface here gave the impression that one could set up all sorts of keywords, but entering anything other than “subtitle” didn’t do anything. Ultimately, it was decided we could accomplish this in a better way.

Titles in 19.11

In 19.11, Koha has changed how it handles subtitles and other 245 subfields. Instead of using Keyword to MARC Mapping, we’re now treating the 245$b, $h, $n, and $p the same way we’ve been treating the 245$a. So let’s look at that.

The 245$a is mapped to the database field biblio.title. Whenever a record is saved, we take whatever is in the 245$a and write it into biblio.title. Then, when Koha needs to show a user that title, it’s quick and easy to grab from the database, rather than fishing it out of the MARC. This behavior is defined in the Koha to MARC Mapping.

In 19.11, we added four new database fields in the biblio table: subtitle, part_number, part_name, and medium. By default, these are mapped to the 245$b, $h, $n, and $p, respectively -- you can see biblio.subtitle mapped to the 245$b in my screenshot above. Just like with biblio.title, this makes it easier for Koha to grab and display this data. As a bonus, it also makes these bits of data easier to include in reports. You can now say:

“SELECT subtitle FROM biblio”

rather than

“SELECT extractvalue(metadata,’//datafield[@tag=245]/subfield[@code=”a”]’) FROM biblio_metadata,”

and that’s definitely a bonus!

What this change means for you

Ultimately, this should not be impactful to one’s day-to-day use of Koha. It is still the case that some backend setup allows Koha to show more 245 subfields in several places and once that setup is complete there’s nothing you need to do. As part of the upgrade, those new biblio fields will be mapped to the relevant MARC fields. To reiterate, that’s:

    • biblio.subtitle to the 245$b
    • biblio.medium to the 245$h
    • biblio.part_number to the 245$n
    • biblio.part_name to the 245$p

With the upgrade taking care of adding those mappings, there’s not a lot you need to do. However, there are a few small complications here.

First, we’re losing a small amount of customization potential. Keyword to MARC Mapping in 19.05 and earlier was defined per framework. That meant your subtitle field(s) for the Books framework could be different from your subtitle field(s) for your Default framework. It also meant you had to do a lot more setup, making sure to define that subfield for every framework you’re using. In 19.11, where we’re using Koha to MARC Mapping instead, we’re no longer able to set this per framework. Whatever we set up is applied to all frameworks.

Second, many sites had subfields other than the 245$b, $h, $n, or $p mapped to subtitle in their Keyword to MARC Mapping. A lot of libraries mapped 490$a or 490$v to subtitle for series information, and we’ve seen a handful of more idiosyncratic local customizations. If you had something other than the 245$b, $h, $n, or $p mapped to subtitle in 19.05, you’ll need to add that to your Koha to MARC Mapping in 19.11 manually. If you’d like any assistance with that, please let us know!

Finally, whenever we change anything in Koha to MARC Mapping, those changes are only reflected in records that are created or edited after the change is made. Existing records won’t push data into biblio.subtitle or our other new database fields until that record is opened and saved for the first time after the upgrade. We have a process we can run on your server to deal with this, but it’s a bit too resource intensive to run as a part of every upgrade, so we’ll have to space them out a bit. There’s nothing you need to do here, just know that you may not see subtitles in circulation the morning after your upgrade.

This post gets into some complicated data structure stuff. I know it took me some time to wrap my head around, so I suspect you’re feeling similarly. Please let us know what questions you have and how we can help!

Read more by Andrew Fuerste-Henry

Tags