Open Refine: Exporting nested XML with templating

I have a question regarding the templating option for XML in Open Refine. Is it possible to export data from two columns in a nested XML-structure, if both columns contain multiple values, that need to be split first? Here's an example to illustrate better what I mean. My columns look like this:

Column1 Column2
https://d-nb.info/gnd/119119110;https://d-nb.info/gnd/118529889 Grützner, Eduard von;Elisabeth II., Großbritannien, Königin

Each value separated by semicolon in Column1 has a corresponding value in Column2 in the right order and my desired output would look like this:

<edm:Agent rdf:about="https://d-nb.info/gnd/119119110">
<skos:prefLabel xml:lang="zxx">Grützner, Eduard von</skos:prefLabel>
</edm:Agent>

<edm:Agent rdf:about="https://d-nb.info/gnd/118529889">
<skos:prefLabel xml:lang="zxx">Elisabeth II., Großbritannien, Königin</skos:prefLabel>
</edm:Agent>

I managed to split the values separated by ";" for both columns like this



but I can't find out how to nest the splitted skos:prefLabel into the edm:Agent element. Is that even possible? If not, I would work with seperate columns or another workaround, but I wanted to make sure, if there's a more direct way before.

Thank you! Kristina



Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation