query-48d55ae4bc6b4a6c3c92d1675ebced80

rq turtle/ttl

TODO

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#>
#Airport names
#defaultView:Map{"layer":"?gender"}
SELECT ?airport ?airportLabel ?location ?person ?personLabel ?gender WHERE {
  ?airport wdt:P31/wdt:P279* wd:Q1248784;
            wdt:P625 ?location;
            wdt:P138 ?person.
  ?person wdt:P31 wd:Q5.
  OPTIONAL {
    ?person wdt:P21/wdt:P279* wd:Q6581072.
    BIND("female"@en AS ?female)
  }
  OPTIONAL {
    ?person wdt:P21/wdt:P279* wd:Q6581097.
    BIND("male"@en AS ?male)
  }
  OPTIONAL {
    ?person wdt:P21 ?gender.
    MINUS { ?gender wdt:P279* wd:Q6581097. }
    MINUS { ?gender wdt:P279* wd:Q6581072. }
    FILTER(!ISBLANK(?gender))
    BIND("other"@en AS ?other)
  }
  BIND(COALESCE(?female, ?male, ?other, "unknown"@en) AS ?gender)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Query found at