query-d94bd11772d2c01657e5f05685c5e891

rq turtle/ttl

Types of performing artists by number of instances Types of performing artists by number of instances Types of performing artists by number of instances Soorten uitvoerende artiesten naar aantal instanties Types of performing artists by number of instances Types of performing artists 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:P279* wd:Q713200.
 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:Q713200 . ?occupationType1 rdfs:label ?occupationType1_en . FILTER (lang(?occupationType1_en) = "en") }
 OPTIONAL { ?type wdt:P279+ ?occupationType2 . ?occupationType2 wdt:P279 wd:Q713200 . ?occupationType2 rdfs:label ?occupationType2_en . FILTER (lang(?occupationType2_en) = "en") }
 OPTIONAL { ?type wdt:P279+ ?occupationType3 . ?occupationType3 wdt:P279/wdt:P279 wd:Q713200 . ?occupationType3 rdfs:label ?occupationType3_en . FILTER (lang(?occupationType3_en) = "en") }
 OPTIONAL { ?type wdt:P279+ ?occupationType4 . ?occupationType4 wdt:P279/wdt:P279/wdt:P279 wd:Q713200 . ?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