Reputation: 3208
Assuming I am searching for an entity such as "Wizard of Oz" and know I am specifically interested in the book rather then movie or musical. Which query/method will return correct results on most cases?
Upvotes: 3
Views: 469
Reputation: 100
As every book, and only books, have an ISBN, I guess you can take Steve Harris' query and, instead of asking if it is a book, you can ask if it has an ISBN.
SELECT * WHERE {
?s <http://dbpedia.org/property/name> ?name .
?s <http://dbpedia.org/ontology/isbn> ?isbn .
FILTER(regex(STR(?name), "wizard of oz", "i"))
}
Upvotes: 0
Reputation: 400
You can also do that with DBpedia Lookup:
http://lookup.dbpedia.org/api/search.asmx/KeywordSearch?QueryClass=book&QueryString=wizard+of+oz
Or with DBpedia Spotlight:
http://spotlight.dbpedia.org/rest/candidates?text=wizard+of+oz+book
Upvotes: 1
Reputation: 3660
You can do that with a query like:
SELECT * WHERE {
?s <http://dbpedia.org/property/name> ?name .
?s a <http://dbpedia.org/ontology/Book> .
FILTER(regex(STR(?name), "wizard of oz", "i"))
}
Upvotes: 1