query-d0482dcd86e57e1f5bb30a1a7dd978c6

rq turtle/ttl

PablĂ­sima

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?genderLabel ?countryLabel ?occupationLabel
WHERE
{

{
  SELECT DISTINCT ?item ?gender ?country ?occupation
  WHERE
  {
    ?item wdt:P31 wd:Q5 .
    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/> .
    }
  }
}  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],es,pt,fr,en" . }
}
ORDER BY ?countryLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?country") v1("?countryLabel"):::projected v3("?gender") v2("?item"):::projected v5("?occupation") a1((" ")) c17(["#91;AUTO_LANGUAGE#93;,es,pt,fr,en"]):::literal c12(["wd:Q483501"]):::iri c15(["bd:serviceParam"]):::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 --> v2 f0 --> c2 f0 --> c3 a1 --"schema:about"--> v2 a1 --"schema:isPartOf"--> c3 v2 --"wdt:P31"--> c5 bind1[/VALUES ?gender/] bind1-->v3 bind10(["wd:Q6581072"]) bind10 --> bind1 bind11(["wd:Q1052281"]) bind11 --> bind1 bind12(["wd:Q48270"]) bind12 --> bind1 v2 --"wdt:P21"--> v3 c7 --"wdt:P527"--> v4 v2 --"wdt:P27"--> v4 v2 --"wdt:P106"--> v5 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P279"--> c13 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P279"--> c12 end union0r <== or ==> union0l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c15 --"wikibase:language"--> c17 end