Search code examples
sparqlontologydbpedia

How to query Olympians data from DBpedia


I was able to query athletes data from DBpedia, or data about a specific sport (e.g. basketball)

Is there a way to retrieve Olympians data?

SELECT * WHERE {
  ?player a <http://dbpedia.org/ontology/Athlete> .
  ?player foaf:name ?firstname .
  ?player foaf:surname ?lastname .
  ?player <http://dbpedia.org/ontology/birthDate> ?birthDate .
  ?player <http://dbpedia.org/ontology/Person/height> ?height .
  ?player <http://dbpedia.org/ontology/Person/weight> ?weight .

}

Solution

  • DBPedia includes a skos:broader hierarchy on Olympic athletes. Therefore you can check whether an athlete is the subject of one of these terms. For a start, try the following query:

    SELECT ?
    WHERE {
       ?olympicTerm skos:broader* <http://dbpedia.org/resource/Category:Olympic_competitors> .
       ?person dct:subject ?olympicTerm .
    }