query-43f3ae6e1b51fd39d95c1c1c55ac6d58
Propertiescollection (P195)creator (P170)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
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#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:ScatterChart
SELECT (?count1 AS ?in_Tate) (?count2 AS ?in_NPG) ?artist WHERE {
{ SELECT (COUNT(?obj1) AS ?count1) ?creator WHERE {
?obj1 wdt:P195 wd:Q430682. #Tate
?obj1 wdt:P170 ?creator.
} GROUP BY ?creator }
{ SELECT (COUNT(?obj2) AS ?count2) ?creator WHERE {
?obj2 wdt:P195 wd:Q238587. #National Portrait Gallery
?obj2 wdt:P170 ?creator.
} GROUP BY ?creator }
FILTER (?creator != wd:Q4233718) # exclude anonymous works
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?creator rdfs:label ?artist }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?artist"):::projected
v3("?count1"):::projected
v5("?count2"):::projected
v1("?creator")
v8("?in_NPG")
v7("?in_Tate")
v2("?obj1")
v4("?obj2")
c7(["bd:serviceParam"]):::iri
c5(["wd:Q238587"]):::iri
c3(["wd:Q430682"]):::iri
c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["?creator != 'wd:Q4233718'"]]
f0 --> v1
v2 --"wdt:P195"--> c3
v2 --"wdt:P170"--> v1
bind2[/"count(?obj1)"/]
v2 --o bind2
bind2 --as--o v3
v4 --"wdt:P195"--> c5
v4 --"wdt:P170"--> v1
bind4[/"count(?obj2)"/]
v4 --o bind4
bind4 --as--o v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
v1 --"rdfs:label"--> v6
end
bind5[/"?count1"/]
v3 --o bind5
bind5 --as--o v7
bind6[/"?count2"/]
v5 --o bind6
bind6 --as--o v8