If I have a dbpedia url (i.e., http://dbpedia.org/page/Abraham_Lincoln), how can I query SPARQL to verify if the entity (in this case Abraham Lincoln) is a person? It occurred to me that I could return all the rdf:type values and then check to see if foaf:Person or dbo:Person are in the output, but it would be more convenient to just get a true/false response.
Use a SPARQL ASK
query? This answer should have been found by yourself when looking into the W3C recommendation
ASK { ?s rdf:type <SOME_CLASS_URI> }
Note, it allows for more complex query pattern of course:
ASK {
{ ?s rdf:type foaf:Person }
UNION
{ ?s rdf:type dbo:Person }
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With