query-ac1ac83ff92b52d0d1a2359dfc384476

rq turtle/ttl

Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge) Select the desired columns and get labels SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count WHERE { { # Group the people by their occupation and calculate age SELECT ?occ (count(?p) as ?count) (round(avg(?birthYear)) as ?avgBirthYear) (avg(?deathYear - ?birthYear) as ?avgAge) WHERE { { # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg SELECT ?p ?occ (avg(year(?birth)) as ?birthYear) (avg(year(?death)) as ?deathYear) WHERE { ?p wdt:P31 wd:Q5 ; wdt:P106 ?occ ; p:P569/psv:P569 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?birth ; ] ; p:P570/psv:P570 [ wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year wikibase:timeValue ?death ; ] . } GROUP BY ?p ?occ } } GROUP BY ?occ }

FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ASC(?avgAge)

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Select the desired columns and get labels
SELECT ?occ ?occLabel ?avgAge ?avgBirthYear ?count
WHERE
{
  {
    # Group the people by their occupation and calculate age
    SELECT
      ?occ
        (count(?p) as ?count)
        (round(avg(?birthYear)) as ?avgBirthYear)
        (avg(?deathYear - ?birthYear) as ?avgAge)
    WHERE {
      {
        # Get people with occupation + birth/death dates; combine multiple birth/death dates using avg
        SELECT
          ?p
            ?occ
            (avg(year(?birth)) as ?birthYear)
            (avg(year(?death)) as ?deathYear)
        WHERE {
           ?p wdt:P31 wd:Q5 ;
              wdt:P106 ?occ ;
              p:P569/psv:P569 [
                wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year
                wikibase:timeValue ?birth ;
              ] ;
              p:P570/psv:P570 [
                wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year
                wikibase:timeValue ?death ;
              ] .
        }
        GROUP BY ?p ?occ
      }
    }
    GROUP BY ?occ
  }

  FILTER (?count > 300) # arbitrary number to weed out values with 'few' observations
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
ORDER BY ASC(?avgAge)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v9("?_anon_d00291b7e9a143df8ec0be8c8ebd714c89438") v11("?avgAge"):::projected v10("?avgBirthYear"):::projected v5("?birth") v7("?birthYear") v10("?count"):::projected v6("?death") v8("?deathYear") v4("?occ"):::projected v3("?p") a2((" ")) a1((" ")) a4((" ")) a3((" ")) c15(["en"]):::literal c13(["bd:serviceParam"]):::iri c3(["wd:Q5"]):::iri c6(["9^^xsd:integer"]):::literal f0[["?count > '300^^xsd:integer'"]] f0 --> v10 v3 --"p:direct/P31"--> c3 v3 --"p:direct/P106"--> v4 a1 --"wikibase:timePrecision"--> c6 a1 --"wikibase:timeValue"--> v5 v3 --"p:P569"--> a2 a2 --"p:statement/value/P569"--> a1 a3 --"wikibase:timePrecision"--> c6 a3 --"wikibase:timeValue"--> v6 v3 --"p:P570"--> a4 a4 --"p:statement/value/P570"--> a3 bind3[/"average(year-from-dateTime(?birth))"/] v5 --o bind3 bind3 --as--o v7 bind4[/"average(year-from-dateTime(?death))"/] v6 --o bind4 bind4 --as--o v8 bind8[/"average(?birthYear)"/] v7 --o bind8 bind8 --as--o v9 bind9[/"count(?p)"/] v3 --o bind9 bind9 --as--o v10 bind10[/"numeric-round()"/] null --o bind10 bind10 --as--o v10 bind11[/"average(?deathYear - ?birthYear)"/] v8 --o bind11 v7 --o bind11 bind11 --as--o v11 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c13 --"wikibase:language"--> c15 end