query: PREFIX wd: <http://www.wikidata.org/entity/>
  PREFIX wdt: <http://www.wikidata.org/prop/direct/>
  PREFIX wikibase: <http://wikiba.se/ontology#>
  PREFIX p: <http://www.wikidata.org/prop/>
  PREFIX v: <http://www.wikidata.org/prop/statement/>
  PREFIX q: <http://www.wikidata.org/prop/qualifier/>
  PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
  PREFIX ps: <http://www.wikidata.org/prop/statement/>
  PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
  
    # Query to return max/min lat/long for Netherlands
  
      SELECT (COUNT(?a) AS ?count) (MIN(?lat) AS ?min_lat) (MIN(?long) AS ?min_long) (MAX(?lat) AS ?max_lat) (MAX(?long) AS ?max_long)  WHERE {
         ?a wdt:P17 wd:Q55 .  # country = Netherlands
        
         ?a p:P625 ?statement . # coordinate-location statement
         ?statement psv:P625 ?coordinate_node .
         ?coordinate_node wikibase:geoLatitude ?lat .
         ?coordinate_node wikibase:geoLongitude ?long .
        
         {
            SELECT ?a (COUNT(?a) AS ?count_stmt) WHERE {
                ?a wdt:P17 wd:Q55 .
                ?a p:P625 ?statement 
           } GROUP BY ?a HAVING (?count_stmt < 2)
         }
  
         SERVICE wikibase:label {
            bd:serviceParam wikibase:language "en" .
         }
      } 