User:TweetsFactsAndQueries/Queries/wealthiest queer people

Originally posted on Twitter and on Mastodon.

SELECT ?person ?personLabel ?netWorthUSD ?orientationLabel ?genderLabel WHERE {
  ?person wdt:P31 wd:Q5;
          p:P2218/psv:P2218 [
            wikibase:quantityAmount ?netWorthUSD;
            # wikibase:quantityUnit wd:Q4917
          ].
  OPTIONAL { # non-heterosexual
    ?person wdt:P91 ?orientation.
    ?orientation wdt:P279* wd:Q339014.
  }
  OPTIONAL { # non-cisgender male/female
    ?person wdt:P21 ?gender.
    FILTER(?gender NOT IN (wd:Q6581097, wd:Q6581072))
  }
  FILTER(BOUND(?orientation) || BOUND(?gender))
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?netWorthUSD)
LIMIT 50
Try it!