-2

I want to find all types to which Tiger woods belongs. I am struggling with semantic and getting errors

  • Tiger Woods? Is this a real question? Voting to close. ***edit*** - just realized that he's trying to query dbpedia, but still feels like this question needs more information (e.g. what do your various query attempts look like)? – Michael Dautermann Sep 05 '15 at 13:02

1 Answers1

1

In RDF, that a resource x has a given type t is expressed by the triple "x rdf:type t." In your case, x is dbr:Tiger_Woods, so you can use a query like this:

select ?type { dbr:Tiger_Woods rdf:type ?type }

SPARQL results

TallTed
  • 9,069
  • 2
  • 22
  • 37
Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
  • Of course, this presumes that someone has already declared `PREFIX dbr: ` and `PREFIX rdf: ` – TallTed Sep 06 '15 at 17:01
  • @tallted, that's true. Fortunately, the public endpoint for dbpedia pre declares those and listse namespaces that it defines that way. That's why the query results there work. You can get a list of all those namespaces from dbpedia.org/sparql. – Joshua Taylor Sep 06 '15 at 19:18
  • Yes, the predefined prefix list for DBpedia's public endpoint is at [http://dbpedia.org/sparql?nsdecl](http://dbpedia.org/sparql?nsdecl) ... but that list has changed and will likely continue to change over time, and may not be active on every endpoint hosting DBpedia data, so it seems better to have a more complete and generally applicable answer here. :-) – TallTed Sep 06 '15 at 21:50