What is the {dependency of Norway} with the {MAX(coastline)} whose {capital} is {weather station}  ?
What is the dependency of Norway with the longest coastline and a weather station as a capital?
Which dependency of Norway with a weather station as a capital has the longest coastline ?
SELECT ?b WHERE { ?b rdf:type ontology:dependency_of_Norway . ?b property:coastline ?n . ?b property:capital resource:weather_station }
select ?ent where {
?ent <http://www.wikidata.org/entity/P31> <http://wikidata.dbpedia.org/resource/Q5260616>.

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

}
ORDER BY DESC(?obj1)
LIMIT 5
select ?ent where { ?ent wdt:P31 wd:Q5260616 . ?ent wdt:P5141 ?obj . ?ent wdt:P36 wd:Q190107 } ORDER BY DESC(?obj)LIMIT 5 