【问题标题】:Facing an error while harmonizing the data在协调数据时遇到错误
【发布时间】:2019-08-07 08:24:00
【问题描述】:

我是 MLDataHubFramework 的新手,开始按照 marklogic 文档创建新的实体流。
1. 创建客户实体并提取到暂存数据库。
2. 在尝试进行协调时,我遇到了以下问题。

错误输出:

java.lang.RuntimeException: com.marklogic.client.FailedRequestException: Local message: failed to apply resource at resources/ml:sjsFlow: Internal Server Error. Server Message: TDE-INDEX: xdmp:eval("xdmp.docume
ntInsert(\"/12545362905389506919.json\",trace,xdmp.de...", {trace:{trace:{jobId:"38b8a84d-7927-4aac-a482-33d64a9cf56e", format:"json", traceId:"12545362905389506919", ...}}}, {database:"3883525708217113046", co
mmit:"auto", update:"true", ...}) -- Error applying template /tde/Customer-0.0.1.tdex to document /12545362905389506919.json: TDE-EVALFAILED: Eval for $subject-iri='sem:iri(concat("http://example.com/Customer-0
.0.1/Customer/", fn:encode-for-uri(./CustomerId)))' returns TDE-BADVALEXPRESSION: Invalid val expression: XDMP-ARGTYPE: (err:XPTY0004) arg1 is not of type xs:string? . See the MarkLogic server error log for fur
ther detail.

但在这里我已将 CustomerId 定义为字符串。我尝试使用多个实体并为所有人遇到相同的问题。 谁能建议我出了什么问题?我也交叉验证了 TDE 文件和其他内容(架构、实体 json、xsd),但在这些文件中没有发现任何问题。

【问题讨论】:

    标签: marklogic marklogic-dhf


    【解决方案1】:

    MarkLogic 是说,当它将此 TDE 模板应用于新文档时,它得到了一个不合适的值。

    将模板 /tde/Customer-0.0.1.tdex 应用于文档 /12545362905389506919.json 时出错:TDE-EVALFAILED: Eval for $subject-iri='sem:iri(concat("http://example.com/Customer-0 .0.1/Customer/", fn:encode-for-uri(./CustomerId)))' 返回 TDE-BADVALEXPRESSION:无效的 val 表达式:XDMP-ARGTYPE: (err:XPTY0004) arg1 不是 xs:string 类型?

    试试这个:

    • 在变量中获取新文档的内容
    • 针对该文档使用模板中的“上下文”
    • 使用./CustomerId 看看你会得到什么

    类似:

    let $doc := document { <envelope... /> }
    let $context := $doc/my/context/path
    return $context/CustomerId
    

    我想知道您是否会返回多个符合错误消息的 CustomerId。

    如果还是不行,我建议您使用最小版本的文档和重新创建错误所需的模板来更新您的问题。有了这些信息,应该更容易发现问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-31
      • 2021-12-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-15
      • 2021-04-14
      相关资源
      最近更新 更多