cts:从sem查询:SPARQL

问题描述 投票:0回答:1

如何从sem:sparql创建cts:查询...

背景,我想创建一个自定义约束,为此它需要返回cts:query ..但在我的自定义约束中,我想做sparql ..我该怎么做..例如:

sem:sparql("select DISTINCT ?subject  
            from 
           <http://rdf.abbvienet.com/entity/abbvie/biologic> 
           where {?subject <http://schemas.abbvienet.com/entity/target> <http://rdf.abbvienet.com/entity/ncbi/target/695>} ")
marklogic marklogic-9
1个回答
0
投票

我想我知道..需要使用cts:triple-range-query

[如果有人感兴趣..以下是我为上面的sparq做的..

  cts:and-query((cts:triple-range-query((), sem:iri('http://schemas.abbvienet.com/entity/target'), 
                                                              sem:iri('http://rdf.abbvienet.com/entity/ncbi/target/695')),
                                   cts:collection-query('http://rdf.abbvienet.com/entity/abbvie/biologic'))))

请让我知道是否有更好的方法:)?

© www.soinside.com 2019 - 2024. All rights reserved.