Semantic Maps

Manual on MediaWiki Extensions
List of MediaWiki Extensions

Semantic Maps
Release status: beta

Description Allows users to edit and display semantic coordinate data using multiple mapping services.
Author(s) Jeroen De Dauw, Yaron Koren, Robert Buzink and Matt Williamson
Last Version 0.1 (2009-07-21)
MediaWiki 1.9.* or greater
License GPL
check usage (experimental)

Semantic Maps is an extension that adds semantic capabilities to the Maps extension, and therefore provides the ability to add, view and edit coordinate data stored through the Semantic MediaWiki extension, using multiple mapping services. These include Google Maps, OpenLayers and Yahoo Maps. Semantic Maps and Maps are based on Semantic Google Maps and Semantic Layers, and are meant to replace these extensions. For this extension to work, you need to have both Semantic MediaWiki and Maps installed. Examples of how to use Semantic Maps can be found here.




[edit] Overview

Semantic Maps and Map provide a map interface to the Semantic MediaWiki Geographic coordinate property type, through the following features:

  1. Display of coordinates. See the usage of Maps for more info.
  2. Aggregation of coordinates. Each mapping service has it’s own special output format, that can be used in Semantic MediaWiki queries, allowing a set of coordinate data stored on multiple pages to be displayed together on a single map.
  3. Insertion of coordinates. Semantic Maps provides custom Semantic Forms input types. These input types display a map with a geocoder in a form to make the insertion (and editing) of coordinates easy for users.

[edit] Download and installation

[edit] Downloads

Notice: Semantic Maps and Maps will always be released together. It is highly recommended to use the version of maps released together with the version of Semantic Maps you have.

You can also download the code directly via SVN from the MediaWiki source code repository, at From a command line, you can call the following:

svn checkout

[edit] Installation instructions

Make sure you have Semantic MediaWiki and Maps successfully installed before proceeding with the installation. Once you have downloaded the code, place the ‘SemanticMaps’ directory within your MediaWiki ‘extensions’ directory. Then add the following code to your LocalSettings.php file after the lines that install Maps:

require_once( "$IP/extensions/SemanticMaps/SemanticMaps.php" );

The inclusion of extensions should happen in this order: Semantic MediaWiki, Semantic Forms (if you use it), Semantic Maps. Note, again, that Maps should also precede Semantic Maps. See the installation instructions of Maps for info about the API keys.

[edit] Upgrading from Semantic Google Maps

If you have Semantic Google Maps installed, and want to upgrade to Semantic Maps, these are the steps you need to follow:

  • Remove the SemanticGoogleMaps directory from your extension directory.
  • Remove (when you use it) Google Geocoder in a similar fashion.
  • Upload both Maps and Semantic Maps to your extension directory.
  • Make sure your API keys are in the right place (the variable $wgGoogleMapsKey will need to be renamed, or copied, to $egGoogleMapsKey).
  • Change all #semantic_google_map parser functions with #display_point.
  • Add parameter names to the value of the #display_point calls.

After doing all these steps, you should be done. Maps and Semantic Maps are designed to be backward compatible with SGM, so all SGM code should work on Semantic Maps. If you encounter some problem though, please let the extension developers know.

[edit] Usage

Semantic Maps showing a Yahoo! Maps map with markers representing queried coordinate data.

If you are new to both Maps and Semantic Maps, it is highly recommended you read how to use Maps first.

[edit] Display multiple points

You can set a Semantic MediaWiki #ask query to display its results as a map, by setting « format=mapservice », in which ‘mapservice’ is the mapping service you want to use. You can use all of the available mapping services of Maps. See the Map formats list for the exact names of the formats. One of the properties queried and displayed must be of type ‘Geographic coordinate’ for this query to work; this property is what will determine the location of each point on the map. Clicking on each point will display a label holding the name of the page, along with any other queried information; clicking on the page name will bring the user to that page. The zoom level of the map will be the closest one possible that shows all the points.

Both maps that result from the following code will have markers on the same locations, but will use different mapping services. To recreate such a result, you simply make a category with the name Locations, which has a property ‘Has coordinates’, of type Geographic coordinate. Demo with the example.

{{#ask:[[Category:Locations]]|?Has coordinates|format=map}}

[edit] Map formats

Semantic Maps adds multiple result formats to the ones made available by Semantic MediaWiki. The result format for a certain query map can be set with the format parameter in your #ask query. The underneath list contains the available result formats. You can also specify the service by adding the service parameter.

Some examples:

{{#ask:[[Category:Locations]]|?Has coordinates|format=googlemaps}}
{{#ask:[[Category:Locations]]|?Has coordinates|format=yahoomaps}}
{{#ask:[[Category:Locations]]|?Has coordinates|format=map|service=yahoomaps}}

Each service has it’s own unique functionality. Click the service name above for an overview of these features. See the map properties below for the common parameters.

[edit] Map properties

You can add seven additional parameters to the query, to change the appearance and usage of the resulting map.

To make it really easy for you, Semantic Maps uses the same names as Maps (see Map’s map properties), for both the result formats and form inputs. There are however some differences, as listed below:

  • centre= or center= – the coordinates of the map’s centre. When not provided in a query, the map will centre itself to show all points.
  • zoom= – When not provided in a query, this will default to the maximal zoom that allows all points to be displayed.

Here is an example of an #ask query that uses the ‘googlemaps’ format (view demo’s):

|?Has coordinates

[edit] Querying non-coordinate data

Semantic Maps displaying a Google Maps map with Google Earth map type and a marker with pop-up representing queried data.

Semantic Maps supports the display of queried non-coordinate data. All queried properties that are not coordinates will be displayed in a pop-up balloon that will appear when clicking the marker representing the location of their corresponding coordinates. If there is a page associated with one of the non-coordinate values, the value will be linked to it.

[edit] Form Inputs

Semantic Forms showing a Google Maps map and geocoding features provided by a hook of Semantic Maps.

Semantic Maps provides multiple form inputs. Form inputs are hooks for Semantic Forms. Every mapping service has it’s own form input. The form input type is determined with the input type parameter.

  • input type=map – the default mapping service will be used.
  • input type=googlemaps – Google Maps service.
  • input type=yahoomaps – Yahoo Maps service.
  • input type=openlayers – OpenLayers service.

Each service has it’s own unique functionality. Click the service name above for an overview of these features. See the map properties below for the common parameters.

[edit] Settings

Semantic Maps allows you to configure a variety of settings, and so affect how the extension works. All settings are located in Maps_Settings.php, in the root of the Maps extension. Currently, Semantic Maps does not add any settings to the ones of Maps. Please refer to the Maps Settings for an overview of these settings, and instructions of how to modify them.

[edit] Version

Semantic Maps is currently at version 0.1, the first public release. It should still be considered beta, since issues are to be expected. However, it has been tested quite thoroughly, and should not cause any big problems. An update to this version can be expected within a few weeks, adding more functionality, fixing bugs and improving the overall extension structure.

[edit] Planned features

Curious about the upcoming features in the next release? The future work page contains on overview of the planned features, and the proposals that have been turned down.

Cet article a été publié dans Uncategorized. Ajoutez ce permalien à vos favoris.

Laisser un commentaire

Entrez vos coordonnées ci-dessous ou cliquez sur une icône pour vous connecter:


Vous commentez à l'aide de votre compte Déconnexion / Changer )

Image Twitter

Vous commentez à l'aide de votre compte Twitter. Déconnexion / Changer )

Photo Facebook

Vous commentez à l'aide de votre compte Facebook. Déconnexion / Changer )

Photo Google+

Vous commentez à l'aide de votre compte Google+. Déconnexion / Changer )

Connexion à %s