query-34f48425d6ac9134f6f5603ccd09eb7f
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 ?fonds ?fondsLabel ?depicted ?depictedLabel ?whatLabel WHERE {
VALUES ?what { wd:Q16917 wd:Q515 } # hospital, city
?fonds wdt:P31 wd:Q3052382 .
?fonds wdt:P126 wd:Q7106994 .
?depicted wdt:P1299 ?fonds .
?depicted wdt:P31/wdt:P279* ?what . #if you want to include subclasses
# ?depicted wdt:P31 ?what . #if you don't want to include subclasses
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY ?fondsLabel ?depictedLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?depicted"):::projected
v2("?depictedLabel"):::projected
v4("?fonds"):::projected
v1("?fondsLabel"):::projected
v3("?what")
a1((" "))
c8(["bd:serviceParam"]):::iri
c2(["wd:Q3052382"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c4(["wd:Q7106994"]):::iri
bind0[/VALUES ?what/]
bind0-->v3
bind00(["wd:Q16917"])
bind00 --> bind0
bind01(["wd:Q515"])
bind01 --> bind0
v4 --"wdt:P31"--> c2
v4 --"wdt:P126"--> c4
v5 --"wdt:P1299"--> v4
v5 --"wdt:P31"--> a1
a1 --"wdt:P279"--> v3
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end