Mapping DBPedia geodata in Drupal

In an attempt to learn more about how to best and seamlessly import external geo data and map them in Drupal I recently mapped all the German soccer stadiums, that are listed in Wikipedia, and which I harvested from from DBpedia (as in the following screenshot).

This is how it worked for me.

I used the following SPARQL query to download the data.


PREFIX geo:
SELECT ?subject ?lat ?long
WHERE {
?subject
?subject geo:lat ?lat
?subject geo:long ?long
}

Note that here I opted to select the lat long fields, but the data are also provided as WKT.

To be submitted directly as URL and access an XML version of the query results this query needs to be encoded into a URL that starts with

http://dbpedia.org/sparql?format=XML&default-graph-uri=......

I basically copied and pasted the link from the query builder and edited it to return XML. The following link will take you there: http://goo.gl/8KHmW

Next, set up an appropriate content type in Drupal, and set up a view with OpenLayers, both described elsewhere.

Lastly use the Feeds Module and teh Feeds XML add on and use the XML parser to read in the data. Here is a snippet of the results.

So configuration of the Feeds Importer is as follows.

Node Processor:

Node Processor Mapping:

The XML Parser

No TweetBacks yet. (Be the first to Tweet this post)