Search code examples
apimediawikidbpediawikidata

How to get all person instances with its height from DBpedia?


I'm working on a project that displays celebs height and Wikidata does not always provide the information needed. So I considered DBpedia as another option and spent days trying to find out how to deal with it

  • how can I fetch every instance of Person class with its Height in DBpedia, is it possible ?

Solution

  • You can use SPARQL to export the data from DBPedia (http://live.dbpedia.org/sparql/).

    select * where {
        ?person dbo:Person\/height ?height.
    }
    LIMIT 10000 OFFSET 10000
    

    The public endpoint limits the size of result sets, currently to 10000 rows, so you'll have to step through the data with an increasing OFFSET, or you find a better endpoint for your need.