MarkLogic 中的命名图支持

Named Graph Support in MarkLogic

我不明白 MarkLogic 如何支持 FROM NAMED 图。我正在尝试使用 SPARQL 查询来查找三元组来自哪个集合。结果真是一头雾水。例如:

select *
FROM <http://x.y.z/c>
FROM NAMED <http://x.y.z/c>
WHERE {
#  GRAPH ?g 
  {?s ?p ?o}
  }

returns一套三联。但是,如果我取消注释 # GRAPH ?g 行,则会返回以下错误:

[1.0-ml] XDMP-COLLXCNNOTFOUND: amped-qconsole:qconsole-sparql($query, (), (), (), ()) -- Collection lexicon not enabled

并且突出显示在 WHERE { 行。

此外,以下作品和returns一组三元组:

select *
FROM <http://x.y.z/c>
WHERE {
  {?s ?p ?o}
  }

但不是这个:

select *
FROM NAMED <http://x.y.z/c>
WHERE {
  {?s ?p ?o}
  }

它returns 是一个空集。添加 GRAPH ?g 行会导致返回与上述相同的错误。我真的很困惑。有人可以解释这种行为吗?

MarkLogic 在其图形实现中使用集合。 GRAPH keyword documentation 中有一条注释提到了收集词典的必要性。

You must enable the collection lexicon when you use a GRAPH construct in a SPARQL query. You can enable the collection lexicon from the database configuration pages or the Admin Interface.

我要补充一点,您还可以通过 Management API 启用集合词典。