【问题标题】:MarkLogic globally unique URIsMarkLogic 全局唯一 URI
【发布时间】:2022-01-04 10:10:22
【问题描述】:

在聚合 XML 文件/space/data/big.xml 的 mlcp 导入期间,默认文档 URI 将类似于 /space/data/big.xml-0-1 /space/data/big.xml-0-2 等。

由于在文档中没有唯一的标签值可以使用-uri_id,并且上面生成的 URI 不是全局唯一的,是否有任何选项可以获取唯一的 URI(例如 RDF c7f92bccb4e2bfdc-0-100.xml)?

【问题讨论】:

    标签: uri unique marklogic


    【解决方案1】:

    您可以应用custom transformation 模块,然后使用sem.uuidString() 等函数构造一个连接随机值的URI。

    function envelope(content, context)
    {
      content.uri = sem.uuidString() + "-" + content.uri;
      return content;
    };
    exports.transform = envelope;
    

    Using a Custom Transformation

    在 MarkLogic Server 上安装自定义转换功能后,您可以使用以下选项将其应用于您的 mlcp 导入或复制作业:

    -transform_module - 包含您的转换的模块的路径。

    $ mlcp.sh import -mode local -host mlhost -port 8000 \
        -username user -password password \
        -input_file_path /space/mlcp-test/data \
        -transform_module /example/mlcp-transform.sjs
    

    【讨论】:

    • 好的,Mads,谢谢你的回答!
    猜你喜欢
    • 1970-01-01
    • 2010-10-10
    • 1970-01-01
    • 2020-04-25
    • 2016-08-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多