« CommunityOne call... | Main | Atom news: Apache... »

SocialSite's Flexible Relationship model

Friend Wheel
Image by flawedartist

We're designing Project SocialSite to support the needs of any site that wishes to add Social Networking features and support OpenSocial. That means we have to be flexible.

We can't hard-code the names of different types of relationships because some sites might want to call friends "buddies" and some might call them "connections." Some sites might want multiple levels of relationships, with some relationships being considered stronger than others, like on Flickr where you have contacts, friends and family. Some sites might want to allow one-way relationships, as Twitter does with "followers," but some sites might want to require that relationships be two-way, as Facebook does.

We want SocialSite to have a Flexible Relationship model that a site operator can tweak to suit the unique requirements of her site's community. We've settled on a model based on relationship types and named levels. In this post, I'll review this new model that we have designed in hopes of getting some feedback, push-back and other good things that might help us refine our model.

I) Relationship Types

SocialSite is designed to support the types of personal relationship shown below. This doesn't include group relationships, which are handled separately.

  • One-way relationship: A relationship from one person to another person that is not reciprocated. For example, Fred has a relationship with Bob, but Bob has no relationship with Fred. Another example: a follower relationship as you see in Twitter.
  • Two-way relationship: A relationship from one person to another that is reciprocated. For example, Fred has a relationship with Bob and Bob also has one with Fred. Another example is Facebook, which requires friendship relationships to be two-way.
  • Mutual relationship: Fred and Bob have a two-way relationship and have agreed on a "how we know each other" message. This is more meaningful than a two-way relationship, because the two parties have agreed on some shared item of information about the relationship like "we met at band camp."

II) Relationship Levels

SocialSite can be configured to support multiple relationship levels like Flickr's contacts, friends and family levels. Users can use these levels when sharing information, e.g. share a photo only with relationships of family-level or higher. I'll explain how the configuration works, but first let's define what we mean by relationship level.

Relationship Level

A Relationship Level is a named integer index that is assigned by one person to indicates the strength of a relationship with another person. People only know the levels that that they have assigned to relationships, so one person in a relationship won't feel slighted if the other party thinks less of the relationship than they do. For example, Fred might consider Bob to be a level 2 "Close Friend" but Bob considers Fred only a level 1 "Acquaintance" relationship. Fred won't learn about this (unless Bob tells him).

You can configure the relationships levels and names supported by SocialSite via the property 'socialsite.relationship.levels'. You simply provide a comma separatied list of the I18N keys of the relationship level names, in order from no-relationship to the strongest level. Here is the default setting, which establishes three relationship levels 0=none, 1=contact and 2=friend:

  socialsite.relationship.levels=\
  relationshipLevel.none,\
  relationshipLevel.contact,\
  relationshipLevel.friend
OpenSocial

OpenSocial doesn't define differently named relationship levels like we do, so we need to do some mapping. OpenSocial has one type and one level of relationship called "friend." So, to map SocialSite relationships to OpenSocial, we have introduced the notion of a friendship level.

Friendship level

Friendship level is an integer configuration property which indicates the relationship level that is considered to be the friendship relationship across a SocialSite system. Relationships at or above this level are considered to be friends when returning data via OpenSocial APIs. Also, when you add a relationship at friendship-level or above, the other party will be notified and given the opportunity to add you as a friend too. You can configure the friendship level via the property below:

  socialsite.relationship.friendshiplevel=2

It's good to have the flexibility to support both one and two-way relationships, but we can't assume that all sites will want both. Some social network services, like Facebook, require that friendship-level relationships be two-way, i.e. both parties must agree that they are friends. To make such a setup possible with SocialSite, we've introduced the configuration property below:

  socialsite.relationship.twoway.requiredForFriendship=true

If that property is true, then any relationship that is considered a friendship (relationship level >= friendship level) must be a two-way relationship. So, when you add a relationship at friend-level or above, the other party must reciprocate or the relationship will not be created.

III) Example SocialSite configurations

To better explain how SocialSite Flexible Relationships work, here are some example configurations that configure SocialSite to behave like well-known social network services.

-like configuration. Flickr supports relationship levels of Contact, Friend and Family. It's possible for you to consider somebody to be Family, while they only consider you only to be a Contact. Any level relationship is considered to be a friendship relationship, for the purposes of OpenSocial.

  socialsite.relationship.levels=\
     relationshipLevel.none,\
     relationshipLevel.contact,\
     relationshipLevel.friend,\
     relationshipLevel.family
  socialsite.relationship.friendshiplevel=1
  socialsite.relationship.twowayRequiredForFriendship=false

-like configuration. Twitter supports one relationship level and that is follower. Its possible for you to follow somebody that does not follow you.

  socialsite.relationship.levels=\
     relationshipLevel.none,\
     relationshipLevel.follower
  socialsite.relationship.friendshiplevel=1
  socialsite.relationship.twowayRequiredForFriendship=false

-like configuration: Facebook supports one relationship level and that is friend. Friendships are required to be two-way, so we have this:

  socialsite.relationship.levels=\
     relationshipLevel.none,\
     relationshipLevel.friend
  socialsite.relationship.friendshiplevel=1
  socialsite.relationship.twowayRequiredForFriendship=true

The default SocialSite configuration. We're considering the below settings for our default configuration. This would allow you to have contacts, with which you can share information but who are not considered friends and would not show up in your friends list or be returned as friends via the OpenSocial APIs.

  socialsite.relationship.levels=\
     relationshipLevel.none,\
     relationshipLevel.contact,\
     relationshipLevel.friend
  socialsite.relationship.friendshiplevel=2
  socialsite.relationship.twowayRequiredForFriendship=true

IV) Wrapping up...

That just about covers it, so I'm going to wrap up now. Most of the above is now implemented in SocialSite, but none of this stuff is carved in stone. So your feedback is more than welcome, either here or on the SocialSite development or user mailing lists.

Comments:

Hi Dave, I'm about to dig into the SocialSite and explore the endless of possibilities implemented:) In which file do you configure all this relationship things? I haven't been able to discover it yet. Best regards, Viggo

Posted by Viggo on July 19, 2009 at 09:56 AM EDT #

How do I become a member of SocialSite? Thank you, Turtledove.

Posted by Turtledove on August 12, 2009 at 06:39 PM EDT #

Post a Comment:
  • HTML Syntax: Allowed

« CommunityOne call... | Main | Atom news: Apache... »

Welcome

You're viewing a weblog entry titled SocialSite's Flexible Relationship model. If you like this entry you might want to:

This is just one entry in the weblog Blogging Roller. You may want to visit the main page of the weblog

Related entries

Below are the most recent entries in the category Social Software, some may be related to this entry.