query-e420066c827316036bec28555b92521f
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item (GROUP_CONCAT(?something; SEPARATOR = ", ") AS ?images) WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "en-GB,en". }
{
SELECT DISTINCT ?item ?something WHERE {
?item p:P31 ?statement0.
?statement0 (ps:P31/(wdt:P279*)) wd:Q23413.
?item p:P7959 ?statement1.
?statement1 (ps:P7959/(wdt:P279*)) wd:Q67479626.
OPTIONAL { {?item wdt:P18 ?something} UNION {?item wdt:P3311 ?something} }
}
}
}
GROUP BY ?item
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?images")
v1("?item"):::projected
v4("?something"):::projected
v2("?statement0")
v3("?statement1")
a1((" "))
a2((" "))
c11(["wd:Q67479626"]):::iri
c4(["en-GB,en"]):::literal
c8(["wd:Q23413"]):::iri
c2(["bd:serviceParam"]):::iri
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
v1 --"p:P31"--> v2
v2 --"p:statement/P31"--> a1
a1 --"p:direct/P279"--> c8
v1 --"p:P7959"--> v3
v3 --"p:statement/P7959"--> a2
a2 --"p:direct/P279"--> c11
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 -."p:direct/P3311".-> v4
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"p:direct/P18"--> v4
end
union0r <== or ==> union0l
end
end
bind1[/"?something"/]
v4 --o bind1
bind1 --as--o v5