SPARQL:如何将变量限制为命名空间?
考虑以下SPARQL查询:
PREFIX basics: <http://example.org/basic-knowledge/>
PREFIX special: <http://example.org/special-predicates/>
SELECT ?S ?P ?O
WHERE
{
?S ?P ?O.
}
这将产生所有三元组。
我如何将结果限制为谓词?p
来自命名空间的三个三元组,而precix special:?
Consider the following SPARQL query:
PREFIX basics: <http://example.org/basic-knowledge/>
PREFIX special: <http://example.org/special-predicates/>
SELECT ?S ?P ?O
WHERE
{
?S ?P ?O.
}
This yields all triples.
How can I restrict the result to those triples where the predicate ?P
is from the namespace with the prefix special:
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可以通过字符串测试来完成。
str()
将URIS变成字符串。注意
special:
由解析器替换为完整的URI:http://example.org/special-predicates
,因此executiuon是可运行的示例:
This can be done with a string test.
str()
turns URIs into strings.note the
special:
is replaced by the parser with the full URI:http://example.org/special-predicates
so the executiuon isRunnable example: