0

I am currently working on MarkLogic using Data Hub.

Is there a way you can change a document's URI during harmonization before it gets written to the Final Database?

Current URI Format after Load:

/Entity/123456.xml

Desired URI Format after Harmonization

/Entity/Location/123456.xml

where Entity is a constant value, Location is a dynamic variable

I saw one related article but it changes the URI if the document is already in the database. I am thinking of doing it during harmonization before the document is written in the FINAL database.

Mads Hansen
  • 63,927
  • 12
  • 112
  • 147
Ryan
  • 175
  • 9

1 Answers1

4

Inside writer.xqy you can write your first line as-

let $newuri:="Entity"||($Location)||"123456.xml" (: Or use fn:concat() :)

At the last line of writer.xqy where you will be using xdmp:document-insert just change the $id to $newuri.

Hope That Helps !

Shalini
  • 348
  • 1
  • 12