query-715c25177cb4c2ec6e1aa805fe8537b5

rq turtle/ttl

Detecting misgenderingTop male given names used in females

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?given ?count
WHERE {

SELECT ?given (COUNT(DISTINCT ?item) AS ?count)
WHERE {

  ?item wdt:P21 wd:Q6581072 . # is female
  ?item wdt:P735 ?given .

  ?given wdt:P31 wd:Q12308941 . # has male given name'
  FILTER NOT EXISTS { ?given wdt:P31 wd:Q11879590 . } # not unisex

  # filter out The Peerage entries, too many wrong entries,
  # it should be handled separately
  OPTIONAL { ?item wdt:P4638 ?thepeerageid . }
  FILTER(!BOUND(?thepeerageid))

  # Prioritize cases with sitelinks at the moment
  ?item wikibase:sitelinks ?linkcount .
  FILTER (?linkcount >= 1)
}
GROUP BY ?given

}
ORDER BY DESC(?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?count"):::projected v4("?given"):::projected v5("?item") v2("?linkcount") v3("?thepeerageid") c7(["wd:Q12308941"]):::iri c3(["wd:Q11879590"]):::iri c5(["wd:Q6581072"]):::iri f0[["?linkcount >= '1^^xsd:integer'"]] f0 --> v2 f1[["not bound(?thepeerageid)"]] f1 --> v3 f2[["not "]] subgraph f2e0["Exists Clause"] e0v1 --"wdt:P31"--> e0c2 e0v1("?given"):::projected e0c2(["wd:Q11879590"]):::iri end f2--EXISTS--> f2e0 f2 --> v4 f2 --> c2 f2 --> c3 v4 --"wdt:P31"--> c3 v5 --"wdt:P21"--> c5 v5 --"wdt:P735"--> v4 v4 --"wdt:P31"--> c7 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P4638".-> v3 end v5 --"wikibase:sitelinks"--> v2 bind4[/"count(?item)"/] v5 --o bind4 bind4 --as--o v6