query-0f5b084cf8eef869d5d55ccee683ad25

rq turtle/ttl

Australian women artist with institution count

SELECT ?artist ?artistLabel (COUNT(?institution) as ?count) with { select distinct ?artist WHERE { ?artist wdt:P106 ?occ. VALUES ?occ {wd:Q483501 wd:Q11569986 wd:Q1028181 wd:Q1281618} # occupations ?artist wdt:P31 wd:Q5. # is human ?artist wdt:P21 wd:Q6581072. # is female ?artist wdt:P6379/wdt:P131 wd:Q408. # has work in institution in Australia hint:Prior hint:gearing "forward". } } as %i where { include %i ?artist wdt:P6379 ?institution. # has works in ?institution ?institution wdt:P131 wd:Q408. # institution in Australia SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } GROUP BY ?artist ?artistLabel ORDER BY DESC (?count)

Use at

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

SELECT ?artist ?artistLabel (COUNT(?institution) as ?count) where
{
   { select distinct ?artist WHERE 
{
   ?artist wdt:P106 ?occ.
   VALUES ?occ {wd:Q483501 wd:Q11569986 wd:Q1028181 wd:Q1281618}    # occupations
   ?artist wdt:P31 wd:Q5.             # is human
   ?artist wdt:P21 wd:Q6581072.       # is female
   ?artist wdt:P6379/wdt:P131* wd:Q408.    # has work in institution in Australia

} }  ?artist wdt:P6379 ?institution.    # has works in ?institution
  ?institution wdt:P131* wd:Q408.    # institution in Australia
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?artist ?artistLabel
ORDER BY DESC (?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?artist"):::projected v5("?count") v4("?institution"):::projected v4("?occ") a1((" ")) c10(["bd:serviceParam"]):::iri c3(["wd:Q5"]):::iri c12(["en"]):::literal c8(["wd:Q408"]):::iri c5(["wd:Q6581072"]):::iri v2 --"wdt:P106"--> v4 bind0[/VALUES ?occ/] bind0-->v4 bind00(["wd:Q483501"]) bind00 --> bind0 bind01(["wd:Q11569986"]) bind01 --> bind0 bind02(["wd:Q1028181"]) bind02 --> bind0 bind03(["wd:Q1281618"]) bind03 --> bind0 v2 --"wdt:P31"--> c3 v2 --"wdt:P21"--> c5 v2 --"wdt:P6379"--> a1 a1 --"wdt:P131"--> c8 v2 --"wdt:P6379"--> v4 v4 --"wdt:P131"--> c8 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end bind2[/"count(?institution)"/] v4 --o bind2 bind2 --as--o v5