Semantic Maps – The first query

From the archive: written in 2009 and kept for the record. Much of it is out of date.

Today I worked on the googlemap format for semantic ask queries and the hook for the coordinates form input type, both in Semantic Maps.

The googlemap format for semantic ask queries enables users to query coordinate data and let it be displayed on a googlemap, in the form of markers. This is now largely working, although there is still some work on the parameters, and there is an issue with a lame JavaScript bug.

The form input type for coordinates is an extension hook for Semantic Forms, with other words, a function that returns the HTML for a property of type coordinate in a form. This is completely working with Google Maps. It’s possible other map and geocoding services will be added later, although this will probably have to wait until after the first release of SM.

Here you have an example of an ask query that results into the underneath map:

{{#ask:[[Category:Locations]]|?Has coordinates|format=googlemap|width=610|height=500}}

Semantic Maps displaying queried coordinate data onto a Google map

Note that both these groups of code are heavily based on work by Robert Buzink and Yaron Koren.

Jeroen De Dauw is founder and CEO of Professional Wiki and builds NeoWiki. More about me. Reply by email or on Mastodon, Bluesky or X.