FOAF-map

(Looking back at all this about twenty years later: what a privacy nightmare!!)

I started digging more into FOAF ¹ and RDF ².

¹

²

FoafGeoGraph will start with my FOAF file, print my position, and then it will go through all the people I know, and print their position, or if the info is not available, but I have a FOAF file for them, it will fetch their FOAF file file and try to find the position in there.

FoafGeoGraph

Oh and let me tell you, getting the RDF stuff right in code as bad as I expected it to be. UGH!!!

Here’s a sample run, with verbose output to show you how it spiders foaf files and with two degrees.

/home/alex/src/foaf-map $ perl foaf-geo-graph.pl -v -d 2 http://www.emacswiki.org/cgi-bin/alex/download/FOAF
 munging http://www.emacswiki.org/cgi-bin/alex/download/FOAF
Alex Schroeder
 47.3787, 8.5273
Alex Schroeder knows Johan Adler
 no location
Default name: Johan Adler
 munging http://nyfiken.org/foaf.rdf
Johan Adler
 59.1990, 18.0681
Johan Adler knows Larisa Adler
 no location
Default name: Larisa Adler
 munging http://larisa.nyfiken.org/foaf.rdf
 http://larisa.nyfiken.org/foaf.rdf is not a FOAF file: Can't find FOAF file

Johan Adler knows Marianne Gripman
 no location
Johan Adler knows Ingemar Gripman
 no location
Johan Adler knows Helena Gripman
 no location
Default name: Helena Gripman
 munging http://helena.gripman.se/filer/foaf.rdf
 http://helena.gripman.se/filer/foaf.rdf is not a FOAF file: Can't find FOAF file

Johan Adler knows Rye Widell
 no location
Johan Adler knows Peter Lindberg
 no location
Default name: Peter Lindberg
 munging http://tesugen.com/foaf.rdf
 http://tesugen.com/foaf.rdf is not a FOAF file:
not well-formed (invalid token) at line 60, column 12, byte 1936 at /usr/lib/perl5/XML/Parser.pm line 187

Johan Adler knows Alex Schroeder
 no location
Johan Adler knows Håkan Kjellerstrand
 no location
Default name: Håkan Kjellerstrand
 munging http://www.hakank.org/foaf.rdf
Hakan Kjellerstrand
 55.5968, 13.0016
Johan Adler knows Martin Rundkvist
 no location
Alex Schroeder knows Sascha Brawer
 no location
Default name: Sascha Brawer
 munging http://www.brawer.ch/foaf.rdf
Sascha Brawer
 46.9553, 7.4282
Sascha Brawer knows Alex Schroeder
 no location
 found http://www.emacswiki.org/cgi-bin/alex/download/FOAF again, skipping
Sascha Brawer knows Patrik Reali
 no location
Default name: Patrik Reali
 munging http://www.reali.ch/foaf.rdf
Patrik Reali
 no location found in http://www.reali.ch/foaf.rdf, skipping
Alex Schroeder knows Sacha Chua
 no location
Default name: Sacha Chua
 munging http://sacha.free.net.ph/notebook/xml/foaf.rdf
 http://sacha.free.net.ph/notebook/xml/foaf.rdf is not a FOAF file: invalid attribute at line 35 at /usr/local/share/perl/5.8.3/RDF/Core/Parser.pm line 718

Alex Schroeder knows Christophe Ducamp
 no location
Default name: Christophe Ducamp
 munging http://www.elanceur.org/ChristopheDucamp/FoafXtof.rdf
Christophe Ducamp
 49.2728, 1.6159
Christophe Ducamp knows Heather James
 no location
Default name: Heather James
 munging http://peopleaggregator.com/profile?id=524
heather
 no location found in http://peopleaggregator.com/profile?id=524, skipping
Christophe Ducamp knows Mattis Manzel
 no location
Default name: Mattis Manzel
 munging http://mitglied.lycos.de/terrahome/foaf.rdf
 http://mitglied.lycos.de/terrahome/foaf.rdf is not a FOAF file:
duplicate attribute at line 5, column 6, byte 184 at /usr/lib/perl5/XML/Parser.pm line 187

Christophe Ducamp knows Alex Schroeder
 no location
 found http://www.emacswiki.org/cgi-bin/alex/download/FOAF again, skipping
Christophe Ducamp knows Bayle Shanks
 no location
Default name: Bayle Shanks
 munging http://bshanksserver.dyndns.org/bshanks/foaf.rdf
Bayle Shanks
 no location found in http://bshanksserver.dyndns.org/bshanks/foaf.rdf, skipping
Christophe Ducamp knows Sébastien Paquet
 no location
Default name: Sébastien Paquet
 munging http://topicexchange.com/foaf/21
Sebastien Paquet
 no location found in http://topicexchange.com/foaf/21, skipping
Christophe Ducamp knows Lion Kimbro
 no location
Default name: Lion Kimbro
 munging http://speakeasy.org/~lion/foaf.rdf
Lion Kimbro
 47.7166, -122.29501
Alex Schroeder knows Lion Kimbro
 no location
 found http://speakeasy.org/~lion/foaf.rdf again, skipping
Alex Schroeder knows Mattis Manzel
 no location
Default name: Mattis Manzel
 munging http://mitglied.lycos.de/terrahome/foaf.rdf
 http://mitglied.lycos.de/terrahome/foaf.rdf is not a FOAF file:
duplicate attribute at line 5, column 6, byte 184 at /usr/lib/perl5/XML/Parser.pm line 187

Alex Schroeder knows Bayle Shanks
 no location
Default name: Bayle Shanks
 munging http://bshanksserver.dyndns.org/bshanks/foaf.rdf
Bayle Shanks
 no location found in http://bshanksserver.dyndns.org/bshanks/foaf.rdf, skipping
1. xplanet marker file generated by foaf-geo-graph.pl
55.5968 13.0016 "Hakan Kjellerstrand"
49.2728 1.6159 "Christophe Ducamp"
46.9553 7.4282 "Sascha Brawer"
59.1990 18.0681 "Johan Adler"
47.7166 -122.29501 "Lion Kimbro"
47.3787 8.5273 "Alex Schroeder"
1. xplanet arcs file generated by foaf-geo-graph.pl
1. from Christophe Ducamp to Lion Kimbro
49.2728 1.6159 47.7166 -122.29501
1. from Johan Adler to Hakan Kjellerstrand
59.1990 18.0681 55.5968 13.0016
1. from Alex Schroeder to Christophe Ducamp
47.3787 8.5273 49.2728 1.6159
1. from Alex Schroeder to Sascha Brawer
47.3787 8.5273 46.9553 7.4282
1. from Alex Schroeder to Johan Adler
47.3787 8.5273 59.1990 18.0681

Here’s the xplanet setup we need:

`~/.xplanet/config/alex` – getting the cloud map can be tricky. See XPlanetSetup for more. If you don’t have a cloud map, just remove this line.

XPlanetSetup

[earth]
marker_file=foaf-markers
arc_file=foaf-arcs
cloud_map=clouds_2048.jpg

`~/.xplanet/markers/foaf-markers` – copy the appropriate section from the output of the script.

# xplanet marker file generated by foaf-geo-graph.pl
55.5968 13.0016 "Hakan Kjellerstrand"
49.2728 1.6159 "Christophe Ducamp"
46.9553 7.4282 "Sascha Brawer"
59.1990 18.0681 "Johan Adler"
47.7166 -122.29501 "Lion Kimbro"
47.3787 8.5273 "Alex Schroeder"

`~/.xplanet/arcs/foaf-arcs` – copy the appropriate section from the output of the script.

# xplanet arcs file generated by foaf-geo-graph.pl
# from Christophe Ducamp to Lion Kimbro
49.2728 1.6159 47.7166 -122.29501
# from Johan Adler to Hakan Kjellerstrand
59.1990 18.0681 55.5968 13.0016
# from Alex Schroeder to Christophe Ducamp
47.3787 8.5273 49.2728 1.6159
# from Alex Schroeder to Sascha Brawer
47.3787 8.5273 46.9553 7.4282
# from Alex Schroeder to Johan Adler
47.3787 8.5273 59.1990 18.0681

And finally, run xplanet:

xplanet -config alex -latitude=47.3787 -longitude=8.5273 \
    -projection=rectangle -geometry=1024x512 \
    -num_times 1 -output=output.jpg

Here is a sample output file:

FOAF-map output

---

Note to self when editing http://rdfweb.org/topic/Tools, my id is 1089552262.34.22858.

http://rdfweb.org/topic/Tools