query-667415d3c182dfff8eaa21c5ffc95836

rq turtle/ttl

Depictions in common between Ashmolean Museum and Cleveland Museum of Art

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#>
SELECT ?depicted ?depictedLabel ?ashcount ?ashexample ?ashexampleLabel ?clevcount ?clevexample ?clevexampleLabel WHERE {
{SELECT ?depicted (Sample(?itemash) AS ?ashexample) (COUNT(DISTINCT ?itemash) AS ?ashcount) (sample(?itemclev) as ?clevexample) (COUNT(DISTINCT ?itemclev) AS ?clevcount) WHERE {
?itemclev wdt:P195 wd:Q657415; wdt:P180 ?depicted.
?itemash wdt:P195 wd:Q636400 ; wdt:P180 ?depicted.
  } GROUP BY ?depicted }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY DESC(?ashcount + ?clevcount)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?ashcount"):::projected v6("?ashexample"):::projected v8("?clevcount"):::projected v7("?clevexample"):::projected v4("?depicted"):::projected v5("?itemash") v3("?itemclev") c6(["bd:serviceParam"]):::iri c2(["wd:Q657415"]):::iri c4(["wd:Q636400"]):::iri c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal v3 --"wdt:P195"--> c2 v3 --"wdt:P180"--> v4 v5 --"wdt:P195"--> c4 v5 --"wdt:P180"--> v4 bind4[/"sample(?itemash)"/] v5 --o bind4 bind4 --as--o v6 bind5[/"count(?itemash)"/] v5 --o bind5 bind5 --as--o v7 bind6[/"sample(?itemclev)"/] v3 --o bind6 bind6 --as--o v7 bind7[/"count(?itemclev)"/] v3 --o bind7 bind7 --as--o v8 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end