query: # UK statues and whether they are of nobles and/or women
  #defaultView:Map{"hide": ["?layer"]}
  SELECT
  ?statue ?statueLabel (SAMPLE(?statueLocation) AS ?statueLocation_) (SAMPLE(?statueImage) AS ?statueImage_)
  ?person ?personLabel
  (IF(?female, "female"@en, "not female"@en) AS ?femaleLabel)
  (IF(?hasNobleTitle, "has noble title"@en, "has no noble title"@en) AS ?hasNobleTitleLabel)
  (CONCAT(?femaleLabel, ", "@en, ?hasNobleTitleLabel) AS ?layer)
  WHERE {
    ?statue wdt:P31/wdt:P279* wd:Q860861;
            wdt:P17 wd:Q145;
            wdt:P180|wdt:P547 ?person.
    ?person wdt:P31 wd:Q5.
    BIND(EXISTS { ?person wdt:P21/wdt:P279* wd:Q6581072. } AS ?female)
    BIND(EXISTS { ?person wdt:P97 ?nobleTitle. } AS ?hasNobleTitle)
    OPTIONAL { ?statue wdt:P625 ?statueLocation. }
    OPTIONAL { ?statue wdt:P18 ?statueImage. }
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  }
  GROUP BY ?statue ?statueLabel ?person ?personLabel ?female ?hasNobleTitle