Perceive

nearestAirport, and FOAF

In the search for more interesting uses of FOAF, sometime ago I came across someone's FOAF that included some information about the airport that is nearest to them, using the nearestAirport nomenclature.

I was quite interested, as this was something I hadn't seen before, and I like the idea of including all the information possible in my FOAF.

So, a short and dirty tutorial on using the nearestAirport in FOAF:

First, you must include the proper namespaces in your file:


<rdf:RDF 
xmlns:air="http://www.megginson.com/exp/ns/airports#" 
xmlns:contact="http://www.w3.org/2000/10/swap/pim/contact#" 
xmlns:wn="http://xmlns.com/wordnet/1.6/">

The information we are adding uses the contact namespace, and the wordnet namespace, thus we add those namespaces to the beginning of our document.

Next, we add the actual data to our FOAF:


<contact:nearestAirport>
 <wn:Airport air:icao="KLOU" air:iata="SDF"/>
</contact:nearestAirport>

This should be included within your foaf:Person, which defines you.

Of course, you should replace "KLOU" and "SDF" with the Airport codes for the airports nearest you. There are two different airport types, ICAO and IATA. You should include both, when possible. The ar-group has a great database to get this information.

That's it. Now people in the FOAF world will know what airports are closest to you. Why would anyone care, you ask? Well, the latitude and longitude for airports is well known, and it makes for a simple way of finding locations of people on a map. Jim Ley has created an excellent map that does just that - plots people on a map of the world, based on their nearestAirport attributes (requires SVG). Add the nearestAirport information to your FOAF, and wait a few days for his crawler to find you, and you should appear. If you don't, feel free to email me and I may be able to help (I'd hate to dump a bunch of emails directly to Jim).

For reference: My FOAF

So there you have it. More wonderful information that you can add to your FOAF.