About

Explode Plugin allows to modify the meta-data inside a clustered record for a given meta-search target (as returned by Pazpar2), by taking a single meta-data field and producing multiple meta-data fields based on the regular expression provided as a part of the target configuration (in the "explode" property). The regular expression must include "named groups" which are are then turned into meta data elements (group name becomes the name of the meta-data element and the group match becomes the value). The plugin may be used for regex based citation parsing. (The names comes from a PHP function "explode").

Example:

Given the following record (returned by Pazpar2)

 <record>
  ...
  <md-citation>58 Antitrust L.J. 355 (1989 1990)</md-citation>
  ...
 </record>

And the following "exploding" regex:

  <explode>md-citation:(\\d+)\\b(?<journal-title>.+?\\s(?=\\d))</explode>

Note, the regex is defined in the 'explode' element of the target configuration with the following syntax:

 md-element-name:regex[:::another-md-element-name:antother-regex]

The record after "explosion" becomes:

 <record>
  ...
  <md-citation>58 Antitrust L.J. 355 (1989 1990)</md-citation>
  <md-journal-title>Antitrust L.J.</md-journal-title>
  ...
 </record>

Protocol

The plugin is never interfaced with directly. It only acts as filter.

Configuration

Explode Plugin must be placed after the relay plugin in a chain. It usually only makes sense for the record and show chains:

chains.record = relay,explode
chains.show = relay,explode

Registration

plugins.explode = com.indexdata.serviceproxy.plugins.ExplodePlugin

Properties

MERGE

Cotrols the meta-data merging behaviour of the plugin.

yes - include the exploded elements in the "merged" meta-data, using the first target's meta-data as the source no - don't merge

Optional, default no

Example:

    explode.MERGE = yes

PATTERN_SOURCE

Cotrols what target profile element should be used for the patter source, this SHOULD NOT be changed in most cases.

Optional, default "explode"

Example:

    explode.PATTERN_SOURCE = explode