简体   繁体   English

使用SPARQL确定是否存在特定的三元组

[英]Determine if a specific triple exists using SPARQL

If the data set is: 如果数据集是:

@prefix dc:   <http://purl.org/dc/elements/1.1/> .
@prefix :     <http://example.org/book/> .
@prefix ns:   <http://example.org/ns#> .

:book1  dc:title  "SPARQL Tutorial" .
:book2  dc:title  "The Semantic Web" .

How do I check that the triple :book1 dc:title "SPARQL Tutorial" . 我如何检查三重:book1 dc:title "SPARQL Tutorial" . exists? 存在?

I can do SELECT ?book where {?book dc:title "SPARQL Tutorial"} but then I have to do post processing to determine if 'book1' was retrieved! 我可以做SELECT ?book where {?book dc:title "SPARQL Tutorial"}但我必须做后期处理以确定是否检索到'book1'!

ASK  { ?book dc:title "SPARQL Tutorial" }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM