query-c79804e4dbe3bcbd380ff65a4e40a02e
TEMPLATE={ "template": { "en": "Creative works with ?country as 'country of origin'" }, "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:P495 ?country. FILTER EXISTS { ?item wdt:P31/wdt:P279* wd:Q17537576. 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": "Creative works with ?country as 'country of origin'" }, "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:P495 ?country.
FILTER EXISTS { ?item wdt:P31/wdt:P279* wd:Q17537576. }
}
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:Q17537576"]):::iri
f0[[" "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P31"--> e0a1
e0a1 --"wdt:P279"--> e0c3
e0v1("?item"):::projected
e0a1((" ")):::projected
e0c3(["wd:Q17537576"]):::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:Q40"])
bind10 --> bind1
bind11(["wd:Q39"])
bind11 --> bind1
bind12(["wd:Q183"])
bind12 --> bind1
v1 --"wdt:P495"--> v2