query-ec048cfc5e681086da4bbbac3f6f9e36

rq turtle/ttl

Propertiesoccupation (P106)sex or gender (P21)female form of label (P2521)instance of (P31)

Use at

PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>

SELECT ?occup ?occupLabel ?count
{
    {
    SELECT ?occup (COUNT(?person) as ?count)
    {
        ?person wdt:P106 ?occup.
        ?person wdt:P21 wd:Q6581072
        OPTIONAL { ?occup wdt:P2521 ?flabel . BIND(lang(?flabel) as ?lang) . FILTER(?lang="or")} . FILTER(!BOUND(?lang))
        ?person wdt:P31 wd:Q5
    }
    GROUP BY ?occup 
    ORDER BY DESC(?count)
    LIMIT 100
    }
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" } 
}
ORDER BY DESC(?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?count"):::projected v5("?flabel") v6("?lang") v4("?occup"):::projected v3("?person") c9(["bd:serviceParam"]):::iri c7(["wd:Q5"]):::iri c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal c4(["wd:Q6581072"]):::iri f0[["not bound(?lang)"]] f0 --> v6 v3 --"wdt:P106"--> v4 v3 --"wdt:P21"--> c4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P2521".-> v5 bind1[/"?flabel"/] v5 --o bind1 bind1 --as--o v6 end v3 --"wdt:P31"--> c7 bind3[/"count(?person)"/] v3 --o bind3 bind3 --as--o v6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end