query-98c21cd8d8cd591f5e581d0dc6cf47c0

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?itemDescription ?images WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en-GB,en". }
  {
    SELECT DISTINCT ?item 
      (REPLACE(GROUP_CONCAT(DISTINCT ?imagelist; SEPARATOR = ","),"http://commons.wikimedia.org/wiki/Special:FilePath/","") AS ?images)
      WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en-GB,en". }
      ?item p:P31 ?statement0.
        ?statement0 (ps:P31/(wdt:P279*)) wd:Q1785071.
      ?item wdt:P17 wd:Q145.
      OPTIONAL {?item wdt:P18    ?imagelist}
    }
    GROUP BY ?item
  }
} order by ?images

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?_anon_42b5416610844a34809f33a099ae9de1140535") v4("?imagelist") v6("?images"):::projected v2("?item"):::projected v3("?statement0") a1((" ")) c2(["bd:serviceParam"]):::iri c4(["en-GB,en"]):::literal c8(["wd:Q1785071"]):::iri c10(["wd:Q145"]):::iri subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end v2 --"p:P31"--> v3 v3 --"p:statement/P31"--> a1 a1 --"p:direct/P279"--> c8 v2 --"p:direct/P17"--> c10 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P18".-> v4 end bind1[/"?imagelist"/] v4 --o bind1 bind1 --as--o v5 bind2[/"replace(,'http://commons.wikimedia.org/wiki/Special:FilePath/','')"/] null --o bind2 bind2 --as--o v6