
Map Your Friend-of-a-Friend Network #99
Chapter 9, Mapping with Other People
|
505
HACK
my @seen = ( );
my @files = (shift);
while (my $traverse = shift @files) {
print "reading $traverse\n";
my @objects;
eval {
@objects = Class::RDF->parse( uri => $traverse );
};
my @follow = grep {$_->rdfs::seeAlso} @objects;
foreach my $url (map {$_->rdfs::seeAlso->uri->value } @follow) {
my ($seen) = grep {$_ eq $url} @seen;
if (not $seen) {
push @files, $url;
push @seen, $url;
}
}
my @air = grep {$_->contact::nearestAirport} @objects;
foreach my $airport (@air) {
eval {
Class::RDF->parse( uri => $air_base.$airport->
airport::iataCode );
};
}
}
While it’s collecting files from the semantic web, this script is looking for
airports in the graphs it gets back. When it finds an IATA code property, it
looks it up at the service (e.g., http://jibbering.com/rdf/airports.1?BRS). This
returns a bigger RDF graph with the airport’s location, time zone, name, and
other features.
Jim Ley used a crawl of the FOAF web and an SVG world base map to draw
the “FOAF people map” shown in Figure 9-16; you can see the SVG version
along with other interesting FOAF experiments at http://www.jibbering.com/.
Making Your Own FOAF World Map
Featured in this book are a couple of different web services that will accept a
feed of points in RDF/XML or RSS and return an interactive map showing
the points plotted over a world map; one is worldKit ...