Technical Deep Dives

OAI-PMH Metadata Harvesting: A Technical Guide for Library Systems

View as Markdown
OAI-PMH Metadata Harvesting: A Technical Guide for Library Systems
On this page

If your library participates in a union catalog, contributes to a digital repository aggregator, or shares metadata with partner institutions, you have probably encountered OAI-PMH. The Open Archives Initiative Protocol for Metadata Harvesting is the most widely deployed standard for exchanging metadata between library systems, and understanding its mechanics is essential for anyone managing these integrations.

What OAI-PMH Does

At its core, OAI-PMH defines a simple client-server interaction. A harvester (the client) sends requests to a repository (the server) asking for metadata records. The repository responds with records in a standard XML format. The harvester stores those records locally and can request updates incrementally by specifying a date range.

The protocol defines six request types, called verbs:

  • Identify: Returns information about the repository: name, administrator email, supported features.
  • ListMetadataFormats: Lists the metadata formats the repository can provide, such as Dublin Core, MARC XML, or MODS.
  • ListSets: Lists any logical groupings of records, such as by collection, department, or material type.
  • ListIdentifiers: Returns a list of record identifiers matching the request criteria, without the full metadata.
  • ListRecords: Returns full metadata records matching the request criteria.
  • GetRecord: Returns a single record by its identifier.

Every OAI-PMH repository must support Dublin Core as a minimum metadata format. Most library repositories also support MARC XML and increasingly MODS or BIBFRAME.

Incremental Harvesting

The power of OAI-PMH lies in incremental harvesting. After the initial full harvest, subsequent requests include a from date parameter that tells the repository to return only records created or modified since that date. This keeps the harvester synchronized without transferring the entire dataset each time.

For large repositories, ListRecords responses use a resumption token to paginate results. The harvester processes one page, then uses the token to request the next page, continuing until all records are retrieved.

Common Configuration Challenges

Deleted Records

When a record is deleted from the source repository, how should the harvester know? OAI-PMH supports three deletion policies: no tracking, transient tracking (deleted records are reported temporarily), and persistent tracking (deleted records remain in responses indefinitely). Mismatched expectations between harvester and repository lead to ghost records in union catalogs. Always check the repository's deletion policy via the Identify verb.

Date Granularity

Some repositories track modification dates at day granularity while others track to the second. If your harvester requests records modified since a specific second but the repository only tracks days, you may miss records or receive duplicates. Align your from parameter with the repository's granularity, reported in the Identify response.

Character Encoding

OAI-PMH responses must be UTF-8 encoded XML. Repositories that store data in other encodings sometimes produce malformed XML with invalid characters. ERMLib's OAI-PMH provider normalizes all output to valid UTF-8 before serialization.

Configuring OAI-PMH in ERMLib

ERMLib can act as both an OAI-PMH provider (serving records to harvesters) and a harvester (pulling records from external repositories).

As a provider:

  1. Navigate to Settings > Integrations > OAI-PMH Provider.
  2. Enable the provider and configure the base URL.
  3. Define which collections or item types to expose as sets.
  4. Select supported metadata formats.

As a harvester:

  1. Navigate to Settings > Integrations > OAI-PMH Harvester.
  2. Add a source repository with its base URL.
  3. Configure the harvest schedule and target metadata format.
  4. Map incoming fields to your local schema.
  5. Run an initial test harvest to verify records import correctly.

When to Use OAI-PMH vs. APIs

OAI-PMH excels at batch metadata exchange between systems that do not need real-time synchronization. For real-time integrations, webhooks or REST APIs are more appropriate. Many library systems, including ERMLib, use both: OAI-PMH for periodic bulk exchange with union catalogs and partner institutions, and APIs for real-time operations within their own ecosystem.

ERMLib Team

Product, engineering and library specialists

Related Posts