query-cf561fde20ecfa1d3f820be29cc98fbe

rq turtle/ttl

List of all people born between certain yearsI need to query all people between the years 1900-2010. Properties I am interested in are: image date of creation (point in time) image caption (media legend) image wikipedia ID or link wikidata ID or link occupation date of death date of birth gender short description nameAll the mentioned properties can be optional, except name. There are already too many results so I would focus on results in english. Not necessarily people with page on EN wikipedia, but people with all the attributes in english. Also querying that many years will timeout, so 3 years is enough. This is what I came up with so far:

Use at

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/> 
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX schema: <http://schema.org/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/> 
PREFIX ps: <http://www.wikidata.org/prop/statement/> 

SELECT ?item ?itemLabel ?description ?image ?birthdate ?deathdate ?nationality ?sex ?occupation WHERE {
    ?item wdt:P31 wd:Q5 .
    ?item rdfs:label ?itemLabel .  
    ?item wdt:P569 ?birthdate .  }
    OPTIONAL{ ?item wdt:P734 ?lastname . }
    OPTIONAL{ ?item wdt:P570 ?deathdate . }
    OPTIONAL{ ?item wdt:P27 ?nationality . }
    OPTIONAL{ ?item wdt:P21 ?sex . }
    OPTIONAL{ ?item wdt:P106 ?occupation . }
    OPTIONAL{ ?item wdt:P18 ?image. }
    FILTER("1920-00-00"^^xsd:date <= ?birthdate &&
         ?birthdate < "1923-00-00"^^xsd:dat)
    FILTER (lang(?itemLabel)="en")
    FILTER (lang(?description)="en")
}

Query found at