query-252b0bd5fd32fd94de2fe9e2e2be0eae

rq turtle/ttl

TEMPLATE={ "template": { "en": "Entities with a Cultural heritage status located in ?country" }, "variables": { "?country": { "query": "SELECT ?id WHERE { ?id wdt:P31 wd:Q6256. }" } } } SELECT DISTINCT ?item WHERE { VALUES ?country {wd:Q40 wd:Q39 wd:Q183} ?item wdt:P17 ?country. FILTER EXISTS { ?item wdt:P1435 ?heritage. } }

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
#TEMPLATE={ "template": { "en": "Entities with a Cultural heritage status located in ?country" }, "variables": { "?country": { "query": "SELECT ?id WHERE { ?id wdt:P31 wd:Q6256. }" } } }
SELECT DISTINCT ?item WHERE {
  VALUES ?country {wd:Q40 wd:Q39 wd:Q183}
  ?item wdt:P17 ?country.
  FILTER EXISTS { ?item wdt:P1435 ?heritage. }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?country") v2("?heritage") v1("?item"):::projected f0[[" "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P1435"--> e0v2 e0v2("?heritage"):::projected e0v1("?item"):::projected end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> v2 v1 --"wdt:P1435"--> v2 bind1[/VALUES ?country/] bind1-->v3 bind10(["wd:Q40"]) bind10 --> bind1 bind11(["wd:Q39"]) bind11 --> bind1 bind12(["wd:Q183"]) bind12 --> bind1 v1 --"wdt:P17"--> v3