Home > linked data > Putting open Facebook data into Linked Data Cloud

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

VN:F [1.9.22_1171]
Rating: 7.5/10 (4 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
Putting open Facebook data into Linked Data Cloud, 7.5 out of 10 based on 4 ratings
Author: Categories: linked data Tags:
  1. April 28th, 2010 at 11:13 | #1

    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!

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  2. April 28th, 2010 at 11:19 | #2

    @Ben Godfrey
    thanks. good suggestion, I will try to work out a solution at noon. right now in data.gov panel in WWW2010.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  3. April 28th, 2010 at 16:51 | #3

    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/

    VA:F [1.9.22_1171]
    Rating: 5.0/5 (1 vote cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  4. April 28th, 2010 at 20:18 | #4

    @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

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  5. Fred Stone
    December 9th, 2010 at 18:42 | #5

    Your demo link is broken.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  6. January 5th, 2011 at 00:13 | #6

    Thanks. The link is back to normal and moved to different location: http://onto.rpi.edu/php-lod/demo/face_lod.html.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  7. September 10th, 2011 at 21:10 | #7

    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?

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  8. emna
    March 21st, 2014 at 09:00 | #8

    hi, i search how i can extract a file RDF from file JSON

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • March 21st, 2014 at 11:51 | #9

      First of all, there isn’t always a 1-to-1 correlation between JSON and RDF. In other words, you can have a JSON object that isn’t RDF but simply key/value pairs. JSON-LD would be a good place to start. If your json object is linked data then there are definitely converters from JSON-LD to RDF. http://www.w3.org/TR/json-ld-api/

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  1. February 27th, 2013 at 01:11 | #1