We want to show the 25 Dutch municipalities with the largest surface. Unfortunately, GeoSPARQL does not have an area function. We therefore decided to implement this function ourselves in SPARQL. We use the geof:envelope function in order to extract the closest bounding box of a municipality, for which we can calculate the area using simple arithmetic and geometric conversion (from long/lat distance to meters). The following shows the shape of Baak and the smallest bounding box that holds it:
We can now sort the municipalities based on their surface. The following gives an overview of the 25 largest municipalities. Zeewolde is larger than Amsterdam!
The same result can also be shown on a map. Notice that big municipalities often have a large water surface.
Using SPARQL federation, we can dynamically pull in the population numbers for each municipality. This allows us to display the 25 most populous municipalities. With YASGUI, we are able to put these results on a map and show nice popups per result. The popup shows the name of the municipality, the population, the surface, and also links to the RDF resource (using URI dereferencing).