query: SELECT DISTINCT ?item 
  WHERE 
  {
    ?item wdt:P570 ?dod .
    FILTER ( ?dod >= "2017-01-01T00:00:00Z"^^xsd:dateTime && ?time0 < "2018-01-01T00:00:00Z"^^xsd:dateTime )
   OPTIONAL { ?item wdt:P21 ?gender } .
   FILTER ( !BOUND (?gender ) ) .
  }
  ORDER BY ?dod
  LIMIT 10000