I have a template (json format) to project triples from document’s content properties.
I also have metadatas stored on those documents, added on document creation/update with xdmp:document-insert.
How can I access to document metadata in tde template?
I tried with the following in the template:
"triples": [ {
"subject": { "val": "$sub" },
"predicate": { "val": "sem:iri($pred || 'hash')" },
"object": { "val": "xdmp:document-get-metadata-value(fn:document-uri(fn:root(.)), 'hash')" }
}]
with “hash” the correct name of the metadata.
It gave me the error above:
### TDE-EVALFAILED: tde.nodeDataExtract([cts.doc("/root/0322a0e4-7e96-4112-bfe6-5f642bcd2a53.json")], [Document({"template":{"description":"Template to project triples out of ...", ...}})]) -- Eval for Object='xdmp:document-get-metadata-value(fn:document-uri(fn:root(.)), 'hash')' returns XDMP-UNDFUN: (err:XPST0017) Undefined function **xdmp:document-get-metadata-value()**