query-f52e5d78eb3815811d15686635d66261

rq turtle/ttl

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:Q183} ?item wdt:P17 ?country. FILTER EXISTS { ?item wdt:P31/wdt:P279* wd:Q811979. hint:Prior hint:gearing "forward". } }

Use at

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:Q183}
  ?item wdt:P17 ?country.
  FILTER EXISTS { ?item wdt:P31/wdt:P279* wd:Q811979.  }
}

Query found at

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:Q183"]) bind10 --> bind1 v1 --"wdt:P17"--> v2