RDF export of Flickr profiles with FOAF and SIOC

I really think that the Semantic Web, and especially FOAF and SIOC can be an answer to the social graph and distributed social networks, as explained (and drawn) there: do not rely on proprietary APIs, but provide data in a way that can be universally linked and understood by software agents.

There are already RDF exporters for Twitter or Facebook, and here’s my contribution to the Giant Global Graph: a Flickr exporter, exporting accounts and groups - if you want some data about your pictures, check flickurl.

It uses the phpFlickr API and exports only publicly available data, to be compliant with Flickr privacy settings (i.e. if you setup your account so that not connected users cannot see it in any contact list, it won’t appear in those contact lists RDF exports).

Basically, it exports one RDF file per user, including one foaf:Person and a related sioc:User - with basic properties (sioc:name, sioc:avatar) as well as a link to his image gallery using the SIOC types ImageGalery class -, and exports the relationships (foaf:knows) with other users, and groups he’s member of (sioc:member_of). Groups are exported is another file, with related informations (dc:description, foaf:depiction …). Files are related with seeAlso links.

In order to be compliant with the Linked Data principles, the script also defines a URI for each foaf:Person, so that anyone can link to it from his FOAF profile, using this pattern within his own foaf:Person description:

<owl:sameAs rdf:resource="http://apassant.net/home/2007/12/flickrdf/people/flickr_id"/>

It also defines an URI for each sioc:User and sioc:UserGroup. I could have used the Flickr account URL, but I think that’s better to make the difference between the account itself, and the homepage of this account, same for the groups.

URIs are defined as follows:

While data is available at:

Eg with my profile:

It uses content-negociation and 303 redirections to the RDF file or to Flickr.com, depending if you access the page with an RDF-compliant browser or not.

Finally, profiles are also linked to existing URIs thanks to:

Please note that each created page is kept on the server. If you want to rebuild one, go to the service homepage and create a profile (you’ll see it also work with user names if you don’t know user id but be careful the user name is not the screen name). A dataset of created profiles should be available soon.

Edit 22/12/2006: Check this post for more details on issues with how to deal with user name / user ID.

Comments

10 Responses to “RDF export of Flickr profiles with FOAF and SIOC”

  1. Morten Høybye Frederiksen homepageblog on December 18th, 2007 11:14 pm

    Nice work!

    A few comments:
    - You need to prepend “mailto:” before computing the mbox_sha1sum.
    - The admin:generatorAgent should be changed.

    I’ll be adding a link from my FOAF file…

    BTW: What do you mean by “A dataset of created profiles should be available soon.”? Since I will add a link to my FOAF file, a semantic crawler should create the entire network quite soon because of the seeAlso’s, right?

  2. Alex on December 19th, 2007 12:36 am

    Thanks for your feedback (and for using OpenID to connect, so I can retrieve your FOAF profile !)

    - The mbox_sha1 value is the one returned by the flickr API, so I can’t do anything for that :/ Do you have any reference teling that mailto: should be added before computing it so that I can submit a bug ?

    - generatorAgent have been changed, I’ll recreate existing files

    - By dataset, I mean providing a .tgz with existing files, for those who want to do SNA, statistics … But indeed, a crawler should create this network if it goes thru the seeAlso links (yet, I think you have to set the crawler timeout as it may take some time to create the files)

  3. Morten Høybye Frederiksen homepageblog on December 19th, 2007 12:42 pm

    Ah, didn’t realize that the mbox_sha1sum comes precomputed from flickr. Smart — if it’s correct…

    As for a reference, see the term documentation for mbox_sha1sum: http://xmlns.com/foaf/spec/#term_mbox_sha1sum — it even includes a reminder for this case. :)

  4. Tim Berners-Lee homepage on December 23rd, 2007 12:09 am

    This is great. I wonder how connected the graph is, whether a crawl will pull in vast amounts of flickr or whether it is in little islands.
    So, now, people can effectively use flickr to host their FOAF page?

    (I’m partly leaving hte comment to see whether you pick up my FOAF info … that is net too)

    I wonder what it would take to persuade flikr to host it themselves.

  5. Les petites cases on December 24th, 2007 7:43 pm

    FOAF : le réseau social garanti sans pub !…

    Vous en avez marre des pubs
    intempestives de Facebook, vous n’arrivez plus à gérer
    à la fois vos profils sur Linked in et Viadeo, vous vous dites
    que Google a suffisamment d’informations sur vous pour ouvrir un
    compte sur Orkut et vous voulez gard…

  6. Alex on January 3rd, 2008 6:03 pm

    Morten> Thanks for the link, I mailed it to the API list and flickr staff fixed the bug really quickly. I’ll try to re-generate already created files so that they’ll contain the good sha1

    Tim> Indeed people can have a URI - and a basic profile - thanks to flickr with the exporter. Regarding the networks, I currently have about 2000 created profiles, so it would be time to check that. Also, I think that a next interesting step would be to mash up those profiles with FOAF data from facebook, twitter … to see if those distributed graphs share common paths between users and their relationships.
    And well, maybe your www08 keynote could be a way to convice flickr and other “social graph providers” to open their data ;)

  7. Morten Høybye Frederiksen homepageblog on January 4th, 2008 10:21 am

    Good job, it looks good now!

  8. http://geocities.com/rmarkwhite/ homepage on January 30th, 2008 7:29 am

    Thank you so very much for the script that writes a foaf file from your flickr profile.

  9. RDFa profile and new URI : Alexandre Passant on March 11th, 2008 10:02 pm

    […] combining some rewrite rules that Ivan Herman defined for the SW Faq and the .htaccess used for the Flickr wrapper. My old foaf.rdf file is also now redirected to this extracted profile, and I’m using an […]

  10. Nodalities » Blog Archive » This Week’s Semantic Web on April 17th, 2008 7:29 pm

    […] The Linking Open Data dataset cloud - with new additions from AudioScrobbler/Last.FM, QDOS, Flickr exporter and an major update for […]

Leave a Reply

You must be logged in to post a comment.