query-b7bba8e968fe341ba1ddb8f6d0fef3f5

rq turtle/ttl

Exhibitions

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/Q454670>

SELECT 
  ?artworks

  ?exhibition ?exhibitionLabel
  (CONCAT("#exhibition/", SUBSTR(STR(?exhibition), 32)) AS ?exhibitionUrl)
  ?exhibitionDescription

  ?example_artwork ?example_artworkLabel
  (CONCAT("#artwork/", SUBSTR(STR(?example_artwork), 32)) AS ?example_artworkUrl)

WHERE {
   {
  SELECT 
    (COUNT(?artwork) AS ?artworks)
    ?exhibition
    (SAMPLE(?artwork) AS ?example_artwork)
  WHERE {
    ?artwork wdt:P170 target: ;
             wdt:P608 ?exhibition .
  }
  GROUP BY ?exhibition
}  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en,cz,da,de,fr,nb,nn,sv". }
}
ORDER BY DESC(?artworks)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?artwork") v4("?artworks"):::projected v4("?example_artwork"):::projected v6("?example_artworkUrl") v3("?exhibition"):::projected v5("?exhibitionUrl") c5(["bd:serviceParam"]):::iri c7(["#91;AUTO_LANGUAGE#93;,mul,en,cz,da,de,fr,nb,nn,sv"]):::literal c2([http://www.wikidata.org/entity/Q454670]):::iri v2 --"wdt:P170"--> c2 v2 --"wdt:P608"--> v3 bind2[/"count(?artwork)"/] v2 --o bind2 bind2 --as--o v4 bind3[/"sample(?artwork)"/] v2 --o bind3 bind3 --as--o v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end bind4[/"concat('#exhibition/',substring(str(?exhibition),'32^^xsd:integer'))"/] v3 --o bind4 bind4 --as--o v5 bind5[/"concat('#artwork/',substring(str(?example_artwork),'32^^xsd:integer'))"/] v4 --o bind5 bind5 --as--o v6