query: embed.html## ratio of female characters per fictional universe
  # (assuming that any item with “from fictional universe” and “sex or gender” is a fictional character)
  SELECT ?universe ?universeLabel ?percentString ?females ?total WHERE { # add ?percent if you want to sort in the table
    {
      SELECT ?universe (SUM(?female) AS ?females) (COUNT(*) AS ?total) WHERE {
        ?character wdt:P1080 ?universe;
                   wdt:P21 ?gender.
        BIND(IF(?gender IN (wd:Q6581072, wd:Q1052281), 1, 0) AS ?female)
      }
      GROUP BY ?universe
    }
    BIND(?females/?total AS ?ratio)
    BIND(100*?ratio AS ?percent)
    BIND(CONCAT(SUBSTR(STR(?percent), 1, 5), "%") AS ?percentString)
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  }
  ORDER BY DESC(?total)