query-6132ca7f5dcbebf96842fe7eeb18398a
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?itemDescription ?images ?a 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
{
{ SELECT DISTINCT ?item ?imagelist
WHERE {
{?item wdt:P17 wd:Q145.}
?item wdt:P31 wd:Q532.
?item wdt:P18 ?imagelist.
?item wdt:P18 ?image2.
filter(str(?imagelist) != str(?image2))
} ORDER BY ?item (lcase(str(?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_42b5416610844a34809f33a099ae9de198873")
v4("?image2")
v3("?imagelist")
v6("?images"):::projected
v2("?item"):::projected
c8(["wd:Q532"]):::iri
c2(["bd:serviceParam"]):::iri
c4(["en-GB,en"]):::literal
c6(["wd:Q145"]):::iri
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
f0[["str(?imagelist) != str(?image2)"]]
f0 --> v3
f0 --> v4
v2 --"wdt:P17"--> c6
v2 --"wdt:P31"--> c8
v2 --"wdt:P18"--> v3
v2 --"wdt:P18"--> v4
bind2[/"?imagelist"/]
v3 --o bind2
bind2 --as--o v5
bind3[/"replace(,'http://commons.wikimedia.org/wiki/Special:FilePath/','')"/]
null --o bind3
bind3 --as--o v6