Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SPARQL: Given a dbpedia url, how can I determine if the entity is a person?

Tags:

sparql

dbpedia

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.

like image 460
Bailey Smith Avatar asked Mar 02 '17 01:03

Bailey Smith


1 Answers

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 }
}
like image 89
UninformedUser Avatar answered Nov 13 '22 14:11

UninformedUser