【发布时间】:2017-11-27 14:42:48
【问题描述】:
这是我的问题的后续:MarkLogic template driven extraction and triples: dealing with array nodes
假设我有一些结构如下的文档:
declareUpdate();
xdmp.documentInsert(
'/test/tde.json',
{
content: {
name:'Joe Parent',
children: [
{
name: 'Bob Child'
},
{
name: 'Sue Child'
},
{
name: 'Guy Child'
}
]
}
},
{permissions : xdmp.defaultPermissions(),
collections : ['test']})
我想定义一个模板,该模板将从这些文档中提取三元组来定义子级之间的兄弟关系。对于上面的例子,我想提取以下三元组(关系是双向的):
Bob Child sibling-of Sue Child
Bob Child sibling-of Guy Child
Sue Child sibling-of Bob Child
Sue Child sibling-of Guy Child
Guy Child sibling-of Bob Child
Guy Child sibling-of Sue Child
如何设置我的模板来完成此操作?
谢谢!
【问题讨论】:
标签: marklogic