query-c8a13aa9c5697e451e2c26ffc4029bbd
...and who have a photo11 results (image grid)
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#>
#defaultView:ImageGrid
SELECT ?item ?itemLabel ?image ?school ?schoolLabel {
{
SELECT ?item (SAMPLE(?school) AS ?school) (SAMPLE(?image) AS ?image) {
?item wdt:P31 wd:Q5;
wdt:P19 ?place;
wdt:P69 ?school;
wdt:P18 ?image .
?place (wdt:P17|wdt:P131)* wd:Q1246 .
MINUS { ?school (wdt:P17|wdt:P131)* wd:Q1246 } .
} GROUP BY ?item
} .
SERVICE wikibase:label { bd:serviceParam wikibase:language "sq,sr,en" } .
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?image"):::projected
v1("?item"):::projected
v2("?place")
v5("?school"):::projected
c10(["bd:serviceParam"]):::iri
c2(["wd:Q5"]):::iri
c12(["sq,sr,en"]):::literal
c7(["wd:Q1246"]):::iri
v1 --"wdt:P31"--> c2
v1 --"wdt:P19"--> v2
v1 --"wdt:P69"--> v5
v1 --"wdt:P18"--> v5
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P131"--> c7
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P17"--> c7
end
union0r <== or ==> union0l
end
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
v5 --"wdt:P131"--> c7
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v5 --"wdt:P17"--> c7
end
union1r <== or ==> union1l
end
end
bind3[/"sample(?school)"/]
v5 --o bind3
bind3 --as--o v5
bind4[/"sample(?image)"/]
v5 --o bind4
bind4 --as--o v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end