query-421b7b44fe3f8996faf108ee53c06f4e

rq turtle/ttl

Count biographies at dawiki by occupation SELECT ?job ?jobLabel ?count with { SELECT ?job (COUNT(?link) AS ?count) WHERE { ?person wdt:P31 wd:Q5. ?person wdt:P106 ?job. ?link schema:about ?person; schema:isPartOf https://da.wikipedia.org/. } GROUP BY ?job ORDER BY DESC(?count) limit 10 } as %i where { include %i SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en" } }

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#>
# Count biographies at dawiki by occupation 
SELECT ?job ?jobLabel ?count where
{
   {
SELECT ?job (COUNT(?link) AS ?count)
WHERE {
  ?person wdt:P31 wd:Q5.
  ?person wdt:P106 ?job.
  ?link schema:about ?person;
        schema:isPartOf <https://da.wikipedia.org/>.
} 
  GROUP BY ?job
  ORDER BY DESC(?count)
  limit 10
}  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en" }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?count"):::projected v3("?job"):::projected v4("?link") v2("?person") c8(["bd:serviceParam"]):::iri c10(["da,en"]):::literal c2(["wd:Q5"]):::iri c6([https://da.wikipedia.org/]):::iri v2 --"wdt:P31"--> c2 v2 --"wdt:P106"--> v3 v4 --"schema:about"--> v2 v4 --"schema:isPartOf"--> c6 bind1[/"count(?link)"/] v4 --o bind1 bind1 --as--o v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end