You can use a graph to prepend collection keys to attribute names in the metadata.
To prepend collection keys to attribute names in a graph:
You can create the new graph anywhere in your Integrator ETL workspace, as you may want to re-use it. You do not have to create it in a specific project.
<Global> <Metadata id="Metadata0" previewAttachmentCharset="ISO-8859-1"> <Record fieldDelimiter="|" name="row" previewAttachmentCharset="ISO-8859-1" recordDelimiter="\n" type="delimited"> <Field delimiter="\r" name="row" type="string"/> </Record> </Metadata> <Property fileURL="workspace.prm" id="GraphParameter0"/> <Note alignment="1" backgroundColorB="225" backgroundColorG="255" backgroundColorR="255" folded="false" height="177" id="Note0" textColorB="0" textColorG="0" textColorR="0" textFontSize="8" title="Description" titleColorB="0" titleColorG="0" titleColorR="0" titleFontSize="10" width="824" x="20" y="56"> <attr name="text"><![CDATA[This graph reads metadata from a single external source. It adds a prefix and rewrites the metadata to a new .fmt]]></attr> </Note> <Dictionary/> </Global> <Phase number="0"> <Node enabled="enabled" fileURL="${META_DIR}/no_prefix.fmt" guiHeight="87" guiName="DATA_READER0" guiWidth="128" guiX="30" guiY="126" id="DATA_READER0" type="DATA_READER"/> <Node enabled="enabled" guiHeight="65" guiName="Filter Header" guiWidth="128" guiX="255" guiY="126" id="EXT_FILTER0" type="EXT_FILTER"> <attr name="filterExpression"><![CDATA[$0.row ~= "<Field.*>"]]></attr> </Node> <Node enabled="enabled" guiHeight="65" guiName="Prefix" guiWidth="128" guiX="480" guiY="126" id="REFORMAT0" type="REFORMAT"> <attr name="transform"><![CDATA[//#CTL2 // Transforms input record into output record. function integer transform() { $out.0.row = replace($0.row,"name=\"","name=\"Vehicle_"); return ALL; } ]]></attr> </Node> <Node enabled="enabled" fileURL="${META_DIR}/prefix_after.fmt" footer="</Record>" guiHeight="87" guiName="Create Metadata" guiWidth="128" guiX="705" guiY="126" header="<?xml version="1.0" encoding="UTF-8"?> <Record fieldDelimiter="|" name="ProductCategory" previewAttachmentCharset="ISO-8859-1" recordDelimiter="\\r\\n" type="delimited"> " id="STRUCTURE_WRITER0" mask="$row \n" type="STRUCTURE_WRITER"/> <Edge debugMode="true" fromNode="DATA_READER0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge1" inPort="Port 0 (in)" metadata="Metadata0" outPort="Port 0 (output)" toNode="EXT_FILTER0:0"/> <Edge debugMode="true" fromNode="EXT_FILTER0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge3" inPort="Port 0 (in)" metadata="Metadata0" outPort="Port 0 (accepted)" toNode="REFORMAT0:0"/> <Edge debugMode="true" fromNode="REFORMAT0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge5" inPort="Port 0 (Body port)" metadata="Metadata0" outPort="Port 0 (out)" toNode="STRUCTURE_WRITER0:0"/> </Phase>
A new metadata is created with the name you specified. In the metadata, the collection key you specified is appended to the attribute names.
You can re-use this graph to create additional metadata. For each new metadata you want to create, repeat Steps 3 through 8.
Oracle Endeca Information Discovery Integrator: Integrator User's Guide · Version 3.1.1 · December 2013
Copyright © 2003, 2013, Oracle and/or its affiliates. All rights reserved.