query-81bc446086492347a3de5e500d37fdf4

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?occupation ?occupationLabel ?cnt WHERE {
  {
    SELECT ?occupation (COUNT(?occupation) AS ?cnt) WHERE {
      FILTER NOT EXISTS { ?wikilink schema:about ?item; schema:inLanguage "en" . }
      ?item wdt:P21 wd:Q6581072 .
      OPTIONAL { ?item wdt:P106 ?occ . }
      BIND(IF(!BOUND(?occ), wd:Q19798648, ?occ) AS ?occupation) .
    } GROUP BY (?occupation)
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
} ORDER BY DESC(?cnt)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?cnt"):::projected v3("?item") v4("?occ") v5("?occupation"):::projected v2("?wikilink") c8(["bd:serviceParam"]):::iri c3(["en"]):::literal c5(["wd:Q6581072"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"schema:about"--> e0v2 e0v1 --"schema:inLanguage"--> e0c3 e0v2("?item"):::projected e0v1("?wikilink"):::projected e0c3(["en"]):::literal end f0--EXISTS--> f0e0 f0 --> v2 f0 --> c1 f0 --> v3 f0 --> c2 f0 --> c3 v2 --"schema:about"--> v3 v2 --"schema:inLanguage"--> c3 v3 --"wdt:P21"--> c5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P106".-> v4 end bind1[/"if(not bound(?occ),'wd:Q19798648',?occ)"/] v4 --o bind1 bind1 --as--o v5 bind3[/"count(?occupation)"/] v5 --o bind3 bind3 --as--o v6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c3 end