query-8a730ec50e598284dbe71ce3ff6989ca

rq turtle/ttl

TEMPLATE={ "template": { "en": "Human creators 'from' country ?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:P27 ?country. } UNION { ?item wdt:P19 ?birth. ?birth wdt:P17 ?country. } ?item wdt:P31 ?Q5. FILTER(EXISTS { ?item (wdt:P106/(wdt:P279*)) wd:Q2500638. 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": "Human creators 'from' country ?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:P27 ?country. }
  UNION
  {
    ?item wdt:P19 ?birth.
    ?birth wdt:P17 ?country.
  }
  ?item wdt:P31 ?Q5.
  FILTER(EXISTS {
    ?item (wdt:P106/(wdt:P279*)) wd:Q2500638.

  })
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?Q5") v3("?birth") v2("?country") v1("?item"):::projected a1((" ")) c3(["wd:Q2500638"]):::iri f0[[" "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P106"--> e0a1 e0a1 --"wdt:P279"--> e0c3 e0v1("?item"):::projected e0a1((" ")):::projected e0c3(["wd:Q2500638"]):::iri end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> a1 f0 --> c2 f0 --> c3 v1 --"wdt:P106"--> 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 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P19"--> v3 v3 --"wdt:P17"--> v2 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P27"--> v2 end union0r <== or ==> union0l end v1 --"wdt:P31"--> v4