本文介绍了如何按BlankNode ID进行过滤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在标签进行过滤?

  1. How would you filter based on a bnode label?

请参见 空白节点标签信息.简而言之,不能依赖SPARQL查询中的空白节点标签:

See the blank-nodes tag info. In short, one can't rely on blank node labels in SPARQL queries:

应用程序编写者不应期望查询中的空白节点标签引用数据中的特定空白节点.

An application writer should not expect blank node labels in a query to refer to a particular blank node in the data.

如果很难通过SPARQL中的空白节点的属性等来区分空白节点,则可以使用GraphDB的内部资源标识符.

If it is hard to distinguish blank nodes by their properties etc. in SPARQL, one can use GraphDB's internal resource identifiers.

PREFIX ent: <http://www.ontotext.com/owlim/entity#>
SELECT * {
    ?s content:value ?value .
    ?s ent:id ?id .
    FILTER (?id = 424242)
}

PREFIX ent: <http://www.ontotext.com/owlim/entity#>
SELECT * {
    ?s content:value ?value
    BIND (ent:id(?s) AS ?id)
    FILTER (?id = 424242)
}


  1. 有可能STR(bnode)吗?

不.来自 17.4.2.5 str :

simple literal  STR (literal ltrl)
simple literal  STR (IRI rsrc)

返回ltrl的词法形式(文字);返回rsrc(一个IRI)的代码点表示形式.

Returns the lexical form of ltrl (a literal); returns the codepoint representation of rsrc (an IRI).

这篇关于如何按BlankNode ID进行过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 18:19