query-f1bd86fc09c1c16f380e3f0027f4dbeb

rq turtle/ttl

PablĂ­sima

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
SELECT DISTINCT ?item ?gender ?country ?occupation

WHERE
{
  ?item wdt:P31 wd:Q5 . # humans
  VALUES ?gender { wd:Q6581072 wd:Q1052281 wd:Q48270 }
  ?item wdt:P21 ?gender .
   { SELECT ?country WHERE { wd:Q72829598 wdt:P527+ ?country . } }  ?item wdt:P27 ?country .
  ?item wdt:P106 ?occupation .
  {
    ?occupation wdt:P279* wd:Q483501 .

  }
  UNION
  {
    ?occupation wdt:P279* wd:Q482980 .

  }
  FILTER NOT EXISTS
  {
    [] schema:about ?item ; schema:isPartOf <https://es.wikipedia.org/> .
  }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?country"):::projected v2("?gender"):::projected v1("?item"):::projected v4("?occupation"):::projected a1((" ")) c12(["wd:Q483501"]):::iri c13(["wd:Q482980"]):::iri c3([https://es.wikipedia.org/]):::iri c5(["wd:Q5"]):::iri c7(["wd:Q72829598"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0a1 --"schema:about"--> e0v1 e0a1 --"schema:isPartOf"--> e0c3 e0v1("?item"):::projected e0a1((" ")):::projected e0c3([https://es.wikipedia.org/]):::iri end f0--EXISTS--> f0e0 f0 --> a1 f0 --> c1 f0 --> v1 f0 --> c2 f0 --> c3 a1 --"schema:about"--> v1 a1 --"schema:isPartOf"--> c3 v1 --"wdt:P31"--> c5 bind1[/VALUES ?gender/] bind1-->v2 bind10(["wd:Q6581072"]) bind10 --> bind1 bind11(["wd:Q1052281"]) bind11 --> bind1 bind12(["wd:Q48270"]) bind12 --> bind1 v1 --"wdt:P21"--> v2 c7 --"wdt:P527"--> v3 v1 --"wdt:P27"--> v3 v1 --"wdt:P106"--> v4 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P279"--> c13 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P279"--> c12 end union0r <== or ==> union0l end