What is the {territory of Australia} with the {MAX(age of consent)} whose {public holiday} is {Queen's official birthday}  ?
which Australian Territory has the highest age of consent and a Public Holiday on the Queen's birthday?
What is the territory of Australia with the highest age of consent whose public holiday is Queen's official birthday?
SELECT ?a WHERE { ?a property:public_holiday resource:Queen's_official_birthday . ?a rdf:type ontology:territory_of_Australia . ?a property:age_of_consent ?r }
select ?ent where {
?ent <http://www.wikidata.org/entity/P31> <http://wikidata.dbpedia.org/resource/Q14192199>.

?statement1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> ?ent .
?statement1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P2999>.
?statement1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj1.

?statement2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> ?ent .
?statement2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P832> .
?statement2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q2564633> .

}
ORDER BY DESC(?obj1)
LIMIT 5
select ?ent where { ?ent wdt:P31 wd:Q14192199 . ?ent wdt:P2999 ?obj . ?ent wdt:P832 wd:Q2564633 } ORDER BY DESC(?obj)LIMIT 5 
Northern Territory Australian Capital Territory