query-63768f41f36f516297b326bc95510a55
Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age Query to find all musicians who have already died # calculate their age (full years) at death # count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age ORDER BY ?age
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
# Query to find all musicians who have already died
# calculate their age (full years) at death
# count how many of them died at each age
SELECT ?age (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a wdt:P31 wd:Q5 . #instance of human
?a wdt:P106/wdt:P279 wd:Q639669 . #occupation a subclass of musician
?a p:P569/psv:P569 ?birth_date_node .
?a p:P570/psv:P570 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date .
?death_date_node wikibase:timeValue ?death_date .
FILTER(?age > 10 && ?age < 100) . #ignore outlyers, several of which are probably errors
BIND( year(?death_date) - year(?birth_date) - if(month(?death_date)<month(?birth_date) || (month(?death_date)=month(?birth_date) && day(?death_date)<day(?birth_date)),1,0) as ?age )
# calculate the age, precisely to the day (times and timezones ignored)
}
GROUP BY ?age
ORDER BY ?age
Query found at
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/ar
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/be-tarask
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/ca
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/cs
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/da
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/de
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/en
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/en-gb
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/eo
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/es
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/eu
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/fr
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/he
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/hy
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/id
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/it
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/ja
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/ko
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/lb
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/lt
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/ms
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/nl
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/pl
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/pt-br
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/ro
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/ru
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/si
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/sv
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/th
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/tr
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/uk
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/vec
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/zh