简体   繁体   中英

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" . 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!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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