Determine if a specific triple exists using SPARQL

If the data set:

@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 to check if triple exists :book1 dc:title "SPARQL Tutorial" .?

I can do it SELECT ?book where {?book dc:title "SPARQL Tutorial"}, but then I need to do post-processing to determine if "book1" was received!

+3
source share
1 answer
ASK  { ?book dc:title "SPARQL Tutorial" }
+3
source

Source: https://habr.com/ru/post/1762867/


All Articles