Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Marklogic 8中的SPARQL 1.1属性路径_Sparql_Marklogic_Marklogic 8 - Fatal编程技术网

Marklogic 8中的SPARQL 1.1属性路径

Marklogic 8中的SPARQL 1.1属性路径,sparql,marklogic,marklogic-8,Sparql,Marklogic,Marklogic 8,MarkLogic语义文档提到,除否定之外,所有SPARQL 1.1属性路径都受支持。我无法获取指定路径长度的语法,即 elt{n,m} A path between n and m occurrences of elt. elt{n} Exactly n occurrences of elt. A fixed length path. elt{n,} n or more occurrences of elt. elt{,n} Between 0 and n oc

MarkLogic语义文档提到,除否定之外,所有SPARQL 1.1属性路径都受支持。我无法获取指定路径长度的语法,即

elt{n,m}    A path between n and m occurrences of elt.
elt{n}      Exactly n occurrences of elt. A fixed length path.
elt{n,}     n or more occurrences of elt.
elt{,n}     Between 0 and n occurrences of elt.
如果我尝试以下方法:

select ?leaf ?distance {
      select  ?leaf (count(?mid) as ?distance) { 
        ?leaf <http://schemas.abbvienet.com/ontologies/infrastructure.owl#manager>{1,2} ?mid .
        ?mid <http://schemas.abbvienet.com/ontologies/infrastructure.owl#manager>{1,2} <http://rdf.abbvienet.com/infrastructure/person/10019933> .
      }
      group by ?leaf
    }
选择叶片距离{
选择?叶(计数(?中间)作为?距离){
?叶{1,2}?中部。
?中间{1,2}。
}
按叶分组
}
我得到以下错误:

XDMP-EXPENTED:(错误:XPST0003)意外令牌语法错误,意外{


这是否适用于其他人,或者是否有人知道MarkLogic中是否支持此路径语法?

请参阅SPARQL 1.1规范-注意,这与SPARQL属性路径的早期草案不同,尤其是删除了属性的n到m次引用

您还可能发现本文很有用-

顺便说一句,并不是说查询中的子选择是多余的(如果查询有效的话)。以下内容与您所拥有的内容相当:

select  ?leaf (count(?mid) as ?distance) { 
    ?leaf <http://schemas.abbvienet.com/ontologies/infrastructure.owl#manager>{1,2} ?mid .
    ?mid <http://schemas.abbvienet.com/ontologies/infrastructure.owl#manager>{1,2} <http://rdf.abbvienet.com/infrastructure/person/10019933> .
}
group by ?leaf
select?leaf(count(?mid)as?distance){
?叶{1,2}?中部。
?中间{1,2}。
}
按叶分组

路径长度不属于SPARQL 1.1,并且支持否定
!:p
。正如AKSW所提到的,路径长度(
p{n,m}
)不是在SPARQL 1.1中,尽管它是在属性路径语法中。提到一些端点仍然支持它,并描述了一些解决方法。我将此查询提取为一个部分或更大的查询,其中有一个联合。因此,我完全同意在这种情况下,额外的子选择是多余的。