Hitachi Content Platform​

 content Classes: Concatenate multiple metadata value into same field

  • Object Storage
  • Hitachi Content Intelligence HCI
Hitendra Talluri's profile image
Hitendra Talluri posted 12-11-2018 13:20

content Classes: Concatenate multiple metadata value into same field

Is there a way we can concatenate multiple fields extracted into a single field using the Expression feilds. Ie can i use concat function for xpath and then join two values detected during the extraction phase?

Or should be use the append stage to append field to field and then index the appended value?


#HitachiContentIntelligenceHCI
Jonathan Chinitz's profile image
Jonathan Chinitz

Only way I know to do this is with the Append stage.

Data Conversion's profile image
Data Conversion

Either way should work

Hitendra Talluri's profile image
Hitendra Talluri

We tried xpath query like below and it throws an error.

XML

Metadata_BCstamm

concat(/Metadata/Client/Stamm/text(),/Metadata/Client/BC/text())

Error testing content class: java.lang.String cannot be cast to net.sf.saxon.om.NodeInfo

×

After reading some blogs looks like Saxon doesnt support concat? not sure what version are we using but they said older version of saxon doesnt support it.

Data Conversion's profile image
Data Conversion

I stand corrected. Support for functions is not available prior to 1.4 (soon to be released). That means for now your only option is to use the separate stage.

Hitendra Talluri's profile image
Hitendra Talluri

good to know that it is coming.Thanks Yury

Jason Hardy's profile image
Jason Hardy

Hitendra,

For that exact field in the POC platform, here is what I did to get the same result.

1.  Define a nested conditional statement, ensuring that both BC & STAMM are not null

pastedimage_0

2.  Then, create a tagging stage, to create the bcStamm field

pastedimage_1

3.  Then, create the appender, starting w/ the BC field

pastedimage_2

4.  Then create a second appender task, adding in the STAMM field

pastedimage_5

Note:  Ensure that you have the multiple values field enabled & a '-' defined as the separator.

pastedimage_6

 

Once in place, the bcStamm field will be created w/ the same formatting & values that the MQE content class parsed the data as.

 

Thanks!

-Jason

Javier Avila Nieto's profile image
Javier Avila Nieto

Hi!

Why not use this connector?

HCI Plugin - "Execute Operating System Command" - No more coding ;-)

You'll only need a stage with a line. This stage will create the new field and concatenate all fields that you need, you can even insert any text.

pastedimage_2

pastedimage_0

Regards,

Javier