Regex Splitter 0.4

Jump to: navigation, search

For Information on Aspire 3.1 Click Here

Aspire / Aspire Components / Regex Metadata Splitter 0.4

Regex Metadata Splitter 0.4
Description: The stage parses fields with semi-colon separated list and creates <val> entry in order to feed multi-value fields. Unlike the default subtype, values are only moved to the output element if they match a regular expression.
Inputs: AspireDocument that has xPath and delimeter element indicating input element to split
Outputs: AspireDocument
Factory: aspire-splitter
Sub Type: regex
Object Type: AspireDocument.


Element Type Default Description
xPath string Specify xPath element in the Aspire document e.g. //category
xPath/@regex string The regular expression must be matched for the split field to be moved to the output
xPath/@output string The name of the output element that will be created in the document.

Sample Configuration

 <component name="regexSplitter" subType="regex" factoryName="aspire-splitter">
     <xPath regex="^[A-Za-z ]*Keywords" output="pg_indexterm_classifications">/doc/pgClassifications_expanded</xPath>
     <xPath regex="^[A-Za-z ]*Keywords" output="p_indexterm_classifications">/doc/pClassifications_expanded</xPath>
     <xPath regex="^[A-Za-z ]*Keywords" output="pv_indexterm_classifications">/doc/pvClassifications_expanded</xPath>
     <xPath regex="^[A-Za-z ]*Keywords" output="ma_indexterm_classifications">/doc/maClassifications_expanded</xPath>

For example

Input fields:

 <maClassifications_expanded source="clasificationExpander">Scottish Keywords;Scottish Keywords/GAELIC LANGUAGE;Scottish Keywords/GAELIC LANGUAGE PROGRAMMES</maClassifications_expanded>

Output fields:

 <ma_indexterm_classifications source="RegexSplitter" tagName="maClassifications_expanded">
   <val>Scottish Keywords</val>
   <val>Scottish Keywords/GAELIC LANGUAGE</val>
   <val>Scottish Keywords/GAELIC LANGUAGE PROGRAMMES</val>