Putting open Facebook data into Linked Data Cloud
April 28th, 2010
I recently build a proof-of-concept demo on getting Facebook data (public data only) into LOD their recently announced Graph API. The demo is available at http://sam.tw.rpi.edu/ws/face_lod.html.
It is fairly straightforward to convert the JSON object into RDF and make the URI dereferenceable. Now the data are linkable, but not yet linked to other LOD data.
I did see some issues when I was assigning rdf properties. Here is an example JSON from http://graph.facebook.com/cocacola
{
"id": "40796308305",
"name": "Coca-Cola",
"picture": "http://profile.ak.fbcdn.net/object3/1853/100/s40796308305_2334.jpg",
"link": "http://www.facebook.com/coca-cola",
"category": "Consumer_products",
"username": "coca-cola",
"products": "Coca-Cola is the most popular and biggest-selling soft drink in history, as well as the best-known product in the world.\n\nCreated in Atlanta, Georgia, by Dr. John S. Pemberton, Coca-Cola was first offered as a fountain beverage by mixing Coca-Cola syrup with carbonated water. Coca-Cola was introduced in 1886, patented in 1887, registered as a trademark in 1893 and by 1895 it was being sold in every state and territory in the United States. In 1899, The Coca-Cola Company began franchised bottling operations in the United States.\n\nCoca-Cola might owe its origins to the United States, but its popularity has made it truly universal. Today, you can find Coca-Cola in virtually every part of the world.",
"fan_count": 5425800
}
1. The JSON file from Facebook is not using the exact Open Graph Protocol terms -below is the mapping
name => og:title category => og:type picture => og:image link => og:url
2.2 we can reuse FOAF and DCTerms to cover some terms used in Facebook data – below is the mapping
picture => foaf:depiction name => foaf:name from => dcterms:source id => dcterms:identifier created_time => dcterms:created updated_time => dcterms:modified category => dcterms:type link => foaf:homepage
Li Ding@RPI April 28, 2010
Congrats on getting this up so quickly. It’s really great.
I’d like to point to my profile from my own FOAF. Would you recommend rdfs:seeAlso for this?
A small suggestion, would it make more sense to create a foaf:OnlineAccount for Facebook profile, instead of using foaf:homepage? I already have such a definition in my FOAFile, but the combination of your auto-generated foaf:OnlineAccount and rdfs:seeAlso would remove the need to maintain that by hand. That would be great!
@Ben Godfrey
thanks. good suggestion, I will try to work out a solution at noon. right now in data.gov panel in WWW2010.
I have made some suggestions you may want to look at regarding the RDF data generated, see :
http://www.w3.org/mid/EMEW3|4781050fefe0f66067ed5a2cdbb727dam3RLE506mmt04r|ecs.soton.ac.uk|859C29FB-05FA-46BB-933B-4CB2501D1897@ecs.soton.ac.uk
Ben, regarding the rdfs:seeAlso link, if your foaf file shares any foaf IFPs (http://mmt.me.uk/blog/2009/09/07/foaf-ifps/) which are also present in the rdf generated by the rpi foaf service you can seeAlso and the foaf:People should join up. Otherwise you may have to owl:sameAs your foaf:Person URI with the Person URI generated by the service above. For the semantic of rdfs:seeAlso are not very strong.
Regarding the change of the facebook profile page from foaf:homepage to the OnlineAccount triples, I would say that the foaf:homepage (being an IFP) is a useful identifier to have included in the rdf generated by Li’s code. As it can be used to merge your foaf person URI with the outputted by rpi fb service.
Great work!
Mischa
P.S. You may want to have a look at the foaf validator service I put up a while ago now http://foaf.qdos.com/validator/
@Mischa Tuffield
Mischa, thanks for the comment. I summarize your suggestions in the email with my response:
1. add type foaf:Person — agreed, but I don’t have enough information from public data… (I lied, I can inferred that from foaf:firstName). Note that some fb pages are not person, e.g. Coca Cola.
2. add foaf:primaryTopic triple — done
3. add type foaf:PersonalProfileDocument — used foaf:Document
4. use foaf:givenname and foaf:familyname — done
5. xsd:dateTime — agreed, but it takes a little more time to get there.
6. avatar URI — no action. it is not part of public fb data.
As for OnlineAccount, it is a complex issue. We really don’t want to mess up reference to a person to his/her account. My choice on foaf:homepage is conservative. I would like to learn more about the community common-sense. I know my gmail account is a email, but what should be considered as the account name of facebook?
Regarding to the difference between rdfs:seeAlso and owl:sameAs, my other blog, Sameas Network also reported some interesting findings on owl:sameAs usage.
The FOAF validator is neat and very useful. It would be also useful to suggest fix (what triples should be added).
best,
Li
Your demo link is broken.
Thanks. The link is back to normal and moved to different location: http://onto.rpi.edu/php-lod/demo/face_lod.html.
good article! {Thanks, where is the facebook like button ?|This is exactly something I must do more research into, thank you for the publish.|Can I reproduce your article?