query-2261275f67c265477a0dceb1a2639dd7

rq turtle/ttl

Types of theatre professionals (theatrical occupations) by number of instances Types of theatre professionals (theatrical occupations) by number of instances Types de professionnels du théâtre (professions théâtrales) par nombre d'instances Soorten theaterprofessionals (beroepen) naar aantal instanties Types of theatre professionals (theatrical occupations) by number of instances Types of theatre professionals (theatrical occupations) by number of instances

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?type 
 (COUNT(DISTINCT ?instance) AS ?count)
 ?Label_en
 (group_concat(distinct ?occupationType1_en;separator="; ") as ?occupationTypes1_en) 
 (group_concat(distinct ?occupationType2_en;separator="; ") as ?occupationTypes2_en)
 (group_concat(distinct ?occupationType3_en;separator="; ") as ?occupationTypes3_en)
 (group_concat(distinct ?occupationType4_en;separator="; ") as ?occupationTypes4_en)
WHERE {
 ?type wdt:P31/wdt:P279* wd:Q15839299.
 OPTIONAL { ?instance wdt:P106 ?type }  
 OPTIONAL { ?type rdfs:label ?Label_en . FILTER (lang(?Label_en) = "en") }
 OPTIONAL { ?type wdt:P279+ ?occupationType1 . ?occupationType1 wdt:P279/^wdt:P279 wd:Q15839299 . ?occupationType1 rdfs:label ?occupationType1_en . FILTER (lang(?occupationType1_en) = "en") }
 OPTIONAL { ?type wdt:P279+ ?occupationType2 . ?occupationType2 wdt:P279 wd:Q15839299 . ?occupationType2 rdfs:label ?occupationType2_en . FILTER (lang(?occupationType2_en) = "en") }
 OPTIONAL { ?type wdt:P279+ ?occupationType3 . ?occupationType3 wdt:P279/wdt:P279 wd:Q15839299 . ?occupationType3 rdfs:label ?occupationType3_en . FILTER (lang(?occupationType3_en) = "en") }
 OPTIONAL { ?type wdt:P279+ ?occupationType4 . ?occupationType4 wdt:P279/wdt:P279/wdt:P279 wd:Q15839299 . ?occupationType4 rdfs:label ?occupationType4_en . FILTER (lang(?occupationType4_en) = "en") }
}
GROUP BY ?type                      #List all the variables for which the values are not concatenated!
  ?count
  ?Label_en 
ORDER BY DESC(?count)
LIMIT 10000

Query found at