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.

Leave a Reply

Your email address will not be published. Required fields are marked *