Skip to content

Metadata manipulator: PiratizeAbstract

Mark Jordan edited this page Jan 28, 2016 · 4 revisions

Overview

This sample metadata manipulator converts text within MODS <abstract> elements into pirate speak using the http://isithackday.com/arrpi.php API.

Toolchains

This metadata manipulator applies to all toolchains that output MODS documents.

Configuration

To register this manipulator in your toolchain, add the following line to the "[MANIPULATORS]" section of your .ini file:

metadatamanipulators[] = "PiratizeAbstract"

Also note that the mappings file must contain a mapping to the MODS <abstract> element.

Parameters

This manipulator does not take any parameters.

Functionality

The purpose of this metadata manipulator is to illustrate how you can call a web service and use the results to update your metadata. For example, it will convert

<abstract>A waterfront and shipping scene in Vancouver, B.C. Several vessels are shown along the waterfront.</abstract>

into

<abstract>A waterfront and shipping scene in Vancouver, B.C. Several vessels be shown along thar waterfront.</abstract>

If the version of the text returned by the API is different than the original text (sometimes the API doesn't find anything in the text that has a pirate equivalent), it logs the original and the new versions.

Clone this wiki locally