Here is what we have right now:
- idSpec = array of ids, viewer, owner, viewerfriends, ownerfriends --
not a real js object
- newFetchPeopleRequest takes in an idSpec to tell it which people to fetch.
- another wip proposal of 0.8 is to add the filter "isFriendsWith" and
another idSpec that a person has to be friends with
Here is something we could do instead:
idSpec becomes a real object "opensocial.idSpec" with three fields:
- userId
- groupid
- networkDistance (? - see below)
This would change the old idSpecs as follows:
"VIEWER" = {userId : VIEWER}
"VIEWER_FRIENDS" = {userId : VIEWER, groupId : FRIENDS}
123 = {userId : 123}
123's friends(not possible before) = {userId : 123, groupId: FRIENDS}
Containers could support additional groupIds, allowing opensocial to
slowly add support for that type of functionality as well. We could
also use a "networkDistance" field to idSpec which would then allow
you to do friends of friends:
"VIEWER's friends of friends" = {userId : VIEWER, groupId : FRIENDS,
networkDistance: 1}
I'm not sure if the networkDistance makes sense for non FRIENDS groups though.
(but we do get to move it out of the isFriendsWith filterOptions if we
put it in the idSpec object as well)
The isFriendsWith filter still makes sense with this new object but it
has more power. You can ask for the friends that bob and suzie both
share:
idSpec = {userId: bob, groupId : FRIENDS} filterType = isFriendsWith
filterOptions = {idSpec: {userId: Suzie, groupId: FRIENDS} }
or maybe even all of suzie's friends that are friends with people on
the soccer team
idSpec = {userId: suzie, groupId : FRIENDS} filterType =
isFriendsWith filterOptions = {idSpec: {groupId: SOCCER_TEAM} }
Some of these requests could get extremely complicated, but each
container will always be able to choose to support only what it wants
to support. A container also always has the right to deny access to
someone's data, group membership or anything else. I think this simply
will make opensocial more flexible for those containers who really
like network connections and support friends of friends and other such
things.
Alright, so after all that, what do you think?
And please chime in if you have a simpler yet just as flexible idea!
Thanks.
- Cassie
Hmm... I'm sot sure whether it is inclusive. When you want to fetch
someone's friend of a friends do you also want their friends? (Anybody
writing gadgets have an opinion here?)
- Cassie
I am wondering if application developers really want to use friend's
friend list fetching functionality. Container developers either.
I can't imagine any cases where app developers need to use the list
except for spam purpose.
Say if you have 100 friends who have 100 friends each. It's gonna be
list of 10,000 people which seems to be a good load both on client
side and server side.
Practical use case I can imagine for something like this is for
example, an app that shares user's photo for the network distance of
2. It's not general to use real name for social network sites in
Japan, that if you want your friend(who is not in relationship yet) to
find you, you may want to share your picture to friend's friend
distance.
The point is, the API app developer need is to see if the VIEWER is
friend's friend of the OWNER. Not the whole list of friend's friend.
What do others think?
2008/4/4, Cassie <do...@google.com>:
I agree that just plainly asking for a second degree network doesn't
make sense; my Hyves 2nd degree network is 80k+ people, and I'm not a
huge friend-collector by far. It would only make sense in combination
with meaningful filters, or limits and order-by's:
- - Give me all 2nd degree friends that have the app installed
- - Give me all 2nd degree friends who have updated their presence in the
last 10 minutes
- - Give me the 100 2nd degree friends with the most pictures
Problem is that these calls can only be served efficiently by the
container if it is optimized for it. In practice this will mean that
many containers will not support these features.
I like making the syntax available for containers that support them,
while not requiring any support.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFH9jG+qCQnCrE98GgRAvltAKCXuHA4Rpjjc80JGwOcoKHXc7nrSQCeJpgM
HmbxELnIOxtkopndsgljb+I=
=I0Bn
-----END PGP SIGNATURE-----
Reinoud - I definitely agree with what you said. This syntax wouldn't
make sense without filters, which is why containers can always deny
any request they don't want to fulfill.
So overall it looks like Louis and Reinoud think this is okay, Eiji is
on the fence and Evan had a different idea. Evan and others, should we
move forward with the following spec change or go another route?
Spec change for this would be:
1. Add a new opensocial.IdSpec object.
opensocial.IdSpec = function() {};
opensocial.IdSpec.Field = {
USER_ID : 'userId',
GROUP_ID : 'groupId',
NETWORK_DISTANCE : 'networkDistance',
}
opensocial.IdSpec.prototype.getField = function(key) {};
2. Change all IdSpec references to be opensocial.IdSpec
3. Change the filtering proposal to get rid of the networkDistance
param as it is now within the idSpec
Thanks.
- Cassie
Ok I can see the benefits as well. Let's make the NETWORK_DISTANCE
feature optional for the container.