reteplayground
Aggregate

Most common occupations

OccupationOcc LabelPeople
Q829552935
Q361802393
Q16222722016
Q339991682
Run this query → no server · no download · no account
caviri.github.io/rete
Run this query in the playground → 20 rows · 3.9 s · 5.0 MB of 125.1 MB read over HTTP range · no server, no download — the query runs in your browser.

The query

PREFIX wdt: <http://www.wikidata.org/prop/direct/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?occupation ?occLabel (COUNT(?p) AS ?people) WHERE { ?p wdt:P106 ?occupation . OPTIONAL { ?occupation rdfs:label ?occLabel . FILTER(LANG(?occLabel) = "en") } } GROUP BY ?occupation ?occLabel ORDER BY DESC(?people) LIMIT 20

rete playground · documentation · github.com/caviri/rete