What is the {legal state} with the {MAX(marriageable age)} whose {diplomatic relation} is {Bangladesh}  ?
Which Legal State, that has diplomatic relations with Bangladesh has the highest marriage age?
What Legal State, with diplomatic relations with Bangladesh has the highest marriage age?
SELECT ?y WHERE { ?y rdf:type ontology:Rechtsstaat . ?y property:marriageable_age ?r . ?y property:diplomatic_relation resource:Bangladesh }
select ?ent where {
?ent <http://www.wikidata.org/entity/P31> <http://wikidata.dbpedia.org/resource/Q4209223>.

?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/P3000>.
?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/P530> .
?statement2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q902> .

}
ORDER BY DESC(?obj1)
LIMIT 5
select ?ent where { ?ent wdt:P31 wd:Q4209223 . ?ent wdt:P3000 ?obj . ?ent wdt:P530 wd:Q902 } ORDER BY DESC(?obj)LIMIT 5 
Austria Brazil Senegal Senegal