Since I’m a fan of web data portability, there are a bazillion ways you can get digests of your Pownce data.
For contact lists, there are 3 ways: via XFN on your friends page (http://pownce.com/leahculver/friends/), via the API (http://api.pownce.com/users/leahculver/friends.xml), and now via a FOAF file (http://pownce.com/leahculver/foaf/).
When Brad asked to have Pownce support FOAF in particular and I did a lot of searching on the internet for super simple RDF FOAF generators.
Turns out the internet is full of parsers and rather devoid of generators. Ponder that for a second.
Anyways, rdflib does a great job of both but it was tough for me to find any examples of FOAF serialization (besides the image on the front page). Whenever I think it’s difficult to find something by a quick internet search I feel like I should post something about it.
So here’s my FOAF generator: foafutil.py
Note that the user parameter is a Django User model with a custom UserProfile. You can probably easily swap that out with whatever class you’re using to represent users. You could also add more fields since this is a pretty bare-bones example.
I’m off to Social Graph Foo Camp this weekend and since it’s the first Foo Camp I’ve ever been invited to, I’m feeling quite excited about it. Free the social graph!?
Update - Per Tom Morris‘ suggestion, I’ve updated the rdfs:seeAlso links to URIRefs.
8 Comments
Adam
So what exactly IS FOAF? I’ve never quite understood it.
-A
Javitolink
Hi, Adam.
It stands for ‘(F)riend (O)f (A) (F)riend’.
It’s a quick way to discover new people.
Dean Landolt
Thanks for putting this out there, Leah — it’ll definitely come in handy in the future.
I didn’t realize FOAF data had DOBs — w/ all the chatter recently about one-off relationship privacy, I definitely know a few women who would feel pretty violated w/ me broadcasting their age…
Leah
Dean - I know what you mean about the age issue. Pownce only adds the DOB if the user has chosen for their age to be public, otherwise no DOB is in the FOAF.
Joey Primiani
Hey Leah! I just submitted my business plan to YouBeTheVC - hope you enjoy! I’ll also be at FOWA in Miami!! yay, look forward to meeting you. Keep up the great job!
david
So, how was the foo camp?
Uldis Bojars
Good work on the foafutil and adding FOAF to Pownce. Thanks, Leah!
Hope you don’t mind if I email you a couple of suggestions re. FOAF output generated by the script.
Check out a bit more human-readable representation of your FOAF file at - http://tinyurl.com/2njvxx
keith
Dang, you write good, clean code. Impressive for a girl… (only kidding, obviously
Cheers!