query-45503492bcd184ac29529ba4b43d7ba0
TEMPLATE={ "template": { "en": "Architectural structures located in ?country" }, "variables": { "?country": { "query": "SELECT ?id WHERE { ?id wdt:P31 wd:Q6256. }" } } } SELECT DISTINCT ?item WHERE { VALUES ?country {wd:Q39} ?item wdt:P17 ?country. FILTER EXISTS { ?item wdt:P31/wdt:P279* wd:Q811979. hint:Prior hint:gearing "forward". } }
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
#TEMPLATE={ "template": { "en": "Architectural structures located in ?country" }, "variables": { "?country": { "query": "SELECT ?id WHERE { ?id wdt:P31 wd:Q6256. }" } } }
SELECT DISTINCT ?item WHERE {
VALUES ?country {wd:Q39}
?item wdt:P17 ?country.
FILTER EXISTS { ?item wdt:P31/wdt:P279* wd:Q811979. }
}
Query found at
- https://www.wikidata.org/wiki/User:Jean-Fr%C3%A9d%C3%A9ric/Austria_contest_ideas_bis
- https://www.wikidata.org/wiki/Wikidata:Tenth_Birthday/DACH_Culture_Contest/queries
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?country")
v1("?item"):::projected
a1((" "))
c3(["wd:Q811979"]):::iri
f0[[" "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P31"--> e0a1
e0a1 --"wdt:P279"--> e0c3
e0v1("?item"):::projected
e0a1((" ")):::projected
e0c3(["wd:Q811979"]):::iri
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> a1
f0 --> c2
f0 --> c3
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
bind1[/VALUES ?country/]
bind1-->v2
bind10(["wd:Q39"])
bind10 --> bind1
v1 --"wdt:P17"--> v2