Plugins/OaiPmhRepository

The OaiPmhRepository plugin exposes metadata for Omeka items using the Open Archives Initiative Protocol for Metadata Harvesting. This is the reverse of the functionality provided by the OaiPmhHarvester plugin.

Requirements

The plugin requires at least version 1.0 of Omeka to run.

In addition, the DOM extension for PHP must be installed.

Metadata Formats

The repository plugin currently has support for two metadata formats:

  • Dublin Core (oai_dc)
    • This is required by the OAI-PMH specification for all repositories. Omeka metadata fields are mapped one-to-one with fields for this output format, and it is the preferred format to use with the plugin.
  • CDWA Lite (cdwalite)
    • The mapping between Omeka's metadata and CDWA Lite metadata is more complicated, and certain fields may not be populated correctly. The chief advantage of using CDWA Lite output is that file URLs can be output in a controlled format, unlike Dublin Core. Harvesters may therefore be able to harvest or link to files, not just metadata.

The plugin uses an extensible architecture, and additional or custom metadata formats may be added. See Extending for more details.

Configuration

The plugin has several user-configurable values. You will be prompted to set these at installation time, or you can change them at any time from the Configure link on the plugin management page.

  • Repository name
    • Name for this OAI-PMH repository. This value is sent as part of the response to an Identify request, and it is how the repository will be identified by well-behaved harvesters.
    • Default: The name of the Omeka installation.
  • Namespace identifier
    • The oai-identifier specification requires repositories to specify a namespace identifier. This will be used to form globally unique IDs for the exposed metadata items. This value is required to be a domain name you have registered. Using other values will generate invalid identifiers.
    • Default: "default.must.change" This is intended to be a not-so-subtle hint that the default value is inappropriate. The plugin will function with this, or any other string, as the namespace identifier, but this breaks the assumption that each identifier is globally unique. Best practice is to set this value to the domain name the Omeka server is published at, possibly with a prefix like "oai."
  • List response limit
    • Number of individual items that can be returned in a response at once. Larger values will increase memory usage but reduce the number of database queries and HTTP requests. Smaller values will reduce memory usage but increase the number of DB queries and requests.
    • Default: 50
  • List expiration time
    • Amount of time in minutes a resumptionToken is valid for. The specification suggests a number in the tens of minutes. This boils down to the length of time a harvester has to request the next part of an incomplete list request.
    • Default: 10 (minutes)
  • Expose files
    • Whether the repository should expose direct URLs to all the files associated with an item as part of its returned metadata. This gives harvesters the ability to directly access the files described by the metadata.
    • Default: true

Development and Distribution

Information on development and releases is published on the Omeka Dev mailing list

The source for the plugin is available via Web and Subversion at [1]

SVN trunk holds the most up-to-date code, and is available at [2]

Extending

This plugin is designed to allow output to arbitrary metadata formats. To add a new format, add a new file to libraries/OaiPmhRepository/Metadata/, and in the file declare a class extending OaiPmhRepository_Metadata_Abstract. The only function you must declare is appendRecord, which appends the appropriate XML to the response. The plugin ships with one subclass, in OaiDc.php. Use it as a helpful example.

Important notes:

  • The class name should be in the OaiPmhRepository_Metadata hierarchy
  • The class name must match the file name (i.e., if you create a class OaiPmhRepository_Metadata_Foo, the filename must be Foo.php
  • You must be sure to copy the initial variable declarations from OaiDc.php, and edit them to suit your metadata format.

Author