query-ab024d0a058e5c5ae2eb39e9e381492e

rq turtle/ttl

Co-depictions

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX target: <http://www.wikidata.org/entity/Q36794>

SELECT 
  ?artworks

  ?depiction ?depictionLabel
  (CONCAT("#depiction/", SUBSTR(STR(?depiction), 32)) AS ?depictionUrl)

  ?example_artwork ?example_artworkLabel
  (CONCAT("#artwork/", SUBSTR(STR(?example_artwork), 32)) AS ?example_artworkUrl)
WHERE {
   {
  SELECT
    (COUNT(?artwork) AS ?artworks)
    ?depiction
    (SAMPLE(?artwork) AS ?example_artwork)
  WHERE {
    ?artwork wdt:P180 target:, ?depiction .
    FILTER (target: != ?depiction)
  }
  GROUP BY ?depiction
  ORDER BY DESC(?artworks)
  LIMIT 1000
}  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?artworks)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?artwork") v4("?artworks"):::projected v2("?depiction"):::projected v5("?depictionUrl") v4("?example_artwork"):::projected v6("?example_artworkUrl") c1([http://www.wikidata.org/entity/Q36794]):::iri c4(["bd:serviceParam"]):::iri c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["http://www.wikidata.org/entity/Q36794 != ?depiction"]] f0 --> v2 v3 --"wdt:P180"--> c1 v3 --"wdt:P180"--> v2 bind3[/"count(?artwork)"/] v3 --o bind3 bind3 --as--o v4 bind4[/"sample(?artwork)"/] v3 --o bind4 bind4 --as--o v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c4 --"wikibase:language"--> c6 end bind5[/"concat('#depiction/',substring(str(?depiction),'32^^xsd:integer'))"/] v2 --o bind5 bind5 --as--o v5 bind6[/"concat('#artwork/',substring(str(?example_artwork),'32^^xsd:integer'))"/] v4 --o bind6 bind6 --as--o v6