How do I query wikidata for a list of scientists that died in a prime-numbered year, and also were born in a prime-numbered year, using SPARQL? Here is what I have so far, which returns no results, and I'm assuming that's because people don't die in a number, but rather in a year... Also missing is the UNION statement for those born in a prime-numbered year, but we can omit that for the sake of focus.
SELECT ?number ?scientist ?scientistLabel
WHERE
{
?number wdt:P31 wd:Q49008.
?scientist wdt:P106 wd:Q901.
?scientist wdt:P570 ?number
SERVICE wikibase:label { bd:serviceParam wikibase:language " [AUTO_LANGUAGE].en". }
}
ORDER BY DESC(?number)
Here is the URL for this query entered into the Query Service: https://query.wikidata.org/#SELECT%20%3Fnumber%20%3Fperson%20%3FpersonLabel%0AWHERE%0A%7B%0A%20%20%3Fnumber%20wdt%3AP31%20wd%3AQ49008.%0A%20%20%3Fperson%20wdt%3AP106%20wd%3AQ901.%0A%20%20%3Fperson%20wdt%3AP570%20%3Fnumber%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D.en%22.%20%7D%0A%7D%0AORDER%20BY%20DESC%28%3Fnumber%29