query-37718dbd10d9db80f4f7e0040d802aca

rq turtle/ttl

Depicted features

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT
  ?artworks

  ?depicted_feature ?depicted_featureLabel
  (CONCAT("#depictedfeature/", SUBSTR(STR(?depicted_feature), 32)) AS ?depicted_featureUrl)
  ?depicted_featureDescription

  ?example_artwork ?example_artworkLabel
  (CONCAT("#artwork/", SUBSTR(STR(?example_artwork), 32)) AS ?example_artworkUrl)
WHERE {
   {
  SELECT 
    (COUNT(?artwork) AS ?artworks)
    ?depicted_feature
    (SAMPLE(?artwork) AS ?example_artwork)
  WHERE {
    ?artwork p:P180 ?depicted_statement .
    ?depicted_statement pq:P1354 ?depicted_feature .
  }
  GROUP BY ?depicted_feature
}  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; v2("?artwork") v5("?artworks"):::projected v4("?depicted_feature"):::projected v6("?depicted_featureUrl") v3("?depicted_statement") v5("?example_artwork"):::projected v7("?example_artworkUrl") c4(["bd:serviceParam"]):::iri c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal v2 --"p:P180"--> v3 v3 --"p:qualifier/P1354"--> v4 bind2[/"count(?artwork)"/] v2 --o bind2 bind2 --as--o v5 bind3[/"sample(?artwork)"/] v2 --o bind3 bind3 --as--o v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c4 --"wikibase:language"--> c6 end bind4[/"concat('#depictedfeature/',substring(str(?depicted_feature),'32^^xsd:integer'))"/] v4 --o bind4 bind4 --as--o v6 bind5[/"concat('#artwork/',substring(str(?example_artwork),'32^^xsd:integer'))"/] v5 --o bind5 bind5 --as--o v7