query-e1dca9f22c7296201674be44a139def7

rq turtle/ttl

African sportswomen SELECT ?item ?itemLabel ?countryLabel ?occupationLabel ?image WHERE { ?item wdt:P31 wd:Q5; #give me a human wdt:P21 wd:Q6581072; #whose gender (P21) is female wdt:P27 ?country. #and who has a country of citizenship (P27) ?country wdt:P30 wd:Q15. #and that country of citizenship is in the continent (P30) Africa ?item wdt:P106 ?occupation. #and who also has an occupation (P106) ?occupation (wdt:P279*) wd:Q18536342. #which is any subclass of (P279) 'competitive player' MINUS { ?item wdt:P27 wd:Q29999. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr,ar,es". } OPTIONAL { ?item wdt:P18 ?image. } #show an image if there is one }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#African sportswomen
SELECT ?item ?itemLabel ?countryLabel ?occupationLabel ?image WHERE {
  ?item wdt:P31 wd:Q5; #give me a human
    wdt:P21 wd:Q6581072; #whose gender (P21) is female
    wdt:P27 ?country. #and who has a country of citizenship (P27)
  ?country wdt:P30 wd:Q15. #and that country of citizenship is in the continent (P30) Africa
  ?item wdt:P106 ?occupation. #and who also has an occupation (P106)
  ?occupation (wdt:P279*) wd:Q18536342. #which is any subclass of (P279) 'competitive player'
  MINUS { ?item wdt:P27 wd:Q29999. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr,ar,es". }
  OPTIONAL { ?item wdt:P18 ?image. } #show an image if there is one
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?country") v4("?image"):::projected v1("?item"):::projected v3("?occupation") c10(["wd:Q18536342"]):::iri c15(["#91;AUTO_LANGUAGE#93;,en,fr,ar,es"]):::literal c4(["wd:Q6581072"]):::iri c7(["wd:Q15"]):::iri c11(["wd:Q29999"]):::iri c13(["bd:serviceParam"]):::iri c2(["wd:Q5"]):::iri v1 --"wdt:P31"--> c2 v1 --"wdt:P21"--> c4 v1 --"wdt:P27"--> v2 v2 --"wdt:P30"--> c7 v1 --"wdt:P106"--> v3 v3 --"wdt:P279"--> c10 subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P27"--> c11 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c13 --"wikibase:language"--> c15 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P18".-> v4 end