query-78e1b3c061e682b0295ecb73e61e2334

rq turtle/ttl

Following up on this archived query request from 22/06/23 be written for her last month. this query requested MargaretRDonaldHello, @I've come up with the query below. I hope more experienced Wikidata users will chime in and make it return more hits / run faster / etc.

Use at

PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
SELECT
  ?imageSrc 
  (GROUP_CONCAT(?imageLegendLanguage;separator=",") AS ?allLang)
  WHERE {
     ?statement ps:P18 ?imageSrc; # all images
      pq:P2096 ?imageLegend.      # all their legends
      BIND(LANG(?imageLegend) AS?imageLegendLanguage). # get each legend's language tag (any image/legend w/o a language tag is left out)
  }
  GROUP BY ?imageSrc
  HAVING contains(?allLang,"ko")

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?allLang") v4("?imageLegend") v5("?imageLegendLanguage"):::projected v3("?imageSrc"):::projected v2("?statement") f0[["contains(?allLang,'ko')"]] f0 --> v6 v2 --"ps:P18"--> v3 v2 --"pq:P2096"--> v4 bind1[/"?imageLegend"/] v4 --o bind1 bind1 --as--o v5 bind3[/"?imageLegendLanguage"/] v5 --o bind3 bind3 --as--o v6