jnv / death-o-meter

Visualization of deaths of famous people in 2016
https://jnv.github.io/death-o-meter/
Creative Commons Attribution 4.0 International
3 stars 0 forks source link

Eliminate incorrect dates for January 1st #5

Open jnv opened 7 years ago

jnv commented 7 years ago

Okay, I need to query wikibase:timePrecision for P570 e.g. like this:

?human p:P570/psv:P570/wikibase:timePrecision ?dodPrecision.

We can filter out the precision to day by limiting the value to wikibase:timePrecision "11"^^xsd:integer.

Or rather keep all the data around and just remove values with incorrect precision.

jnv commented 7 years ago
SELECT ?human ?hl ?dod ?dodPrecision WHERE {
  ?human wdt:P31 wd:Q5.
  ?human wdt:P106 ?occupation.
  ?human rdfs:label ?hl.
  ?human wdt:P570 ?dod.
  ?human p:P570/psv:P570/wikibase:timePrecision ?dodPrecision.
  FILTER(LANG(?hl) = "en")
  FILTER(YEAR(?dod) >= 2011 && YEAR(?dod) <= 2016)
  FILTER(?occupation = wd:Q36180) # || ?occupation = wd:Q33999 || ?occupation = wd:Q36180
}

Split to separate queries per occupation due to timeout.