implementing IS_FRIENDS_WITH

21 views
Skip to first unread message

Paul Lindner

unread,
Oct 6, 2008, 4:37:32 PM10/6/08
to shind...@incubator.apache.org, opensocial-an...@googlegroups.com
Hi,

0.8 defines a IS_FRIENDS_WITH filter, which requires an idSpec value.
How should we shoehorn this into the 0.8.1 world?

For 0.8.1 we have filterBy, filterOp and filterValue.

Here's one possibility:

* Define a friends person field as an array of Id string values
* Use FilterBy=friends, filterOp=contains, filterVal=ID

(with a special hack for OWNER/VIEWER substitution on filterVal)

Or another is just recognizing the isFriendsWith filter name and then
somehow getting an idSpec transmitted over.

Any ideas?


--
Paul Lindner
plin...@hi5.com

Paul Lindner

unread,
Oct 14, 2008, 12:09:26 PM10/14/08
to Paul Lindner, shind...@incubator.apache.org, opensocial-an...@googlegroups.com
Anyone?

Paul Lindner
plin...@hi5.com

Scott Seely

unread,
Oct 27, 2008, 3:48:06 PM10/27/08
to OpenSocial - OpenSocial and Gadgets Specification Discussion
Paul has suggested one mechanism for handling IS_FRIENDS_WITH. Are we
ready to vote on the suggestion?

So far, 1 +1,

On Oct 14, 9:09 am, Paul Lindner <plind...@hi5.com> wrote:
> Anyone?
>
> On Oct 6, 2008, at 1:37 PM, Paul Lindner wrote:
>
>
>
> > Hi,
>
> > 0.8 defines aIS_FRIENDS_WITHfilter, which requires an idSpec  
> > value.  How should we shoehorn this into the 0.8.1 world?
>
> > For 0.8.1 we have filterBy, filterOp and filterValue.
>
> > Here's one possibility:
>
> >  * Define a friends person field as an array of Id string values
> >  * Use FilterBy=friends, filterOp=contains, filterVal=ID
>
> > (with a special hack for OWNER/VIEWER substitution on filterVal)
>
> > Or another is just recognizing the  isFriendsWith filter name and  
> > then somehow getting an idSpec transmitted over.
>
> > Any ideas?
>
> > --
> > Paul Lindner
> > plind...@hi5.com
>
> Paul Lindner
> plind...@hi5.com

Scott Seely

unread,
Nov 3, 2008, 12:34:02 PM11/3/08
to OpenSocial - OpenSocial and Gadgets Specification Discussion
No activity happened on this thread in the past 2 weeks. Calling this
thread dead.

On Oct 27, 11:48 am, Scott Seely <sse...@myspace.com> wrote:
> Paul has suggested one mechanism for handlingIS_FRIENDS_WITH. Are we

Scott Seely

unread,
Nov 5, 2008, 9:08:25 AM11/5/08
to OpenSocial - OpenSocial and Gadgets Specification Discussion
Please ignore this comment on the thread being dead.
> > > plind...@hi5.com- Hide quoted text -
>
> - Show quoted text -

Scott Seely

unread,
Nov 11, 2008, 5:45:37 PM11/11/08
to OpenSocial - OpenSocial and Gadgets Specification Discussion
Paul-- the possibility you showed first seems pretty good. Can you
post a patch to http://wiki.opensocial.org/index.php?title=Implementing_IS_FRIENDS_WITH?
Then, please post to the thread when you have the item up. Thanks!

Scott Seely

unread,
Nov 17, 2008, 4:38:54 PM11/17/08
to OpenSocial - OpenSocial and Gadgets Specification Discussion
Update thread with F2F notes:
After discussion, it appears that the mainline use case for this item
is for mutual friends between two user IDs. Canonical IDs are VIEWER
and OWNER. Paul Lindner owes an update to the thread with this
information.

On Nov 11, 2:45 pm, Scott Seely <sse...@myspace.com> wrote:
> Paul-- the possibility you showed first seems pretty good. Can you
> post a patch tohttp://wiki.opensocial.org/index.php?title=Implementing_IS_FRIENDS_WITH?

Paul Lindner

unread,
Nov 20, 2008, 6:58:11 PM11/20/08
to OpenSocial - OpenSocial and Gadgets Specification Discussion
Hi,

An updated specification is available here:

http://wiki.opensocial.org/index.php?title=Implementing_IS_FRIENDS_WITH

The issue is that it's impossible to pass an IdSpec unless you
serialize it in some way.

So the solution is to use the existing filterBy mechanism to get what
we want.

Specifically we define a new pseudo-field called @friends
then we use the filterOp contains
and the filterValue is the friendId to search for.

The response is the person object if there is a match, and an empty
response if there is not.

Louis Ryan

unread,
Nov 21, 2008, 12:55:03 PM11/21/08
to opensocial-an...@googlegroups.com
Paul,

A few more examples might be useful. For example does 

/people/@me/@friends?filterBy=@friends&filterOp=contains&filterValue=<someuserid>

return all of my mutual friends with <someuser>. If so Im +1 on this.

-Louis

Ram Sharma

unread,
Nov 25, 2008, 7:31:54 AM11/25/08
to OpenSocial - OpenSocial and Gadgets Specification Discussion
Hi All,

As per all the discussion what I got is the Is_friends_with will used
as

filterBy="@firends" , filteOp="contains" and filterValue="UserId"

By using this this filter will mean to get all friends of the viewer
who are also friends with the given userId. right ?

So that indirectly means the mutual firends of viewer and the userId
(a user who id friend of me as well as friend of given userId is
actually the mutual friend of viewer and the given userId). If this is
the case Like what Louis said then also +1 from my side.

We have created a patch for the same for PHP Shindig and attached to
the issue files at:
https://issues.apache.org/jira/browse/SHINDIG-692

Please review the work done and give your comments and feedback.

PS: we have not used any field like friends(array) in Person model. We
have used the database (In our case canonicaljsondb) to get friends of
viewer and given userId. We simply did a intersection on friends list
of Both.

Thanks
Ram

On Nov 21, 10:55 pm, Louis Ryan <lr...@google.com> wrote:
> Paul,
> A few more examples might be useful. For example does
>
> /people/@me/@friends?filterBy=@friends&filterOp=contains&filterValue=<someuserid>
>
> return all of my mutual friends with <someuser>. If so Im +1 on this.
>
> -Louis
>

Lane LiaBraaten

unread,
Nov 25, 2008, 12:00:56 PM11/25/08
to opensocial-an...@googlegroups.com
Since it appears to be what we're all thinking, I've updated the wiki page with the example Louis gave.
http://wiki.opensocial.org/index.php?title=Implementing_IS_FRIENDS_WITH

I'm +1 on this topic, but do we have a volunteer to patch the spec?

-Lane

Bess Ho

unread,
Nov 25, 2008, 7:06:40 PM11/25/08
to opensocial-an...@googlegroups.com
+1
If this helps to retrieve the mutual friends with easy filter.
On Tue, Nov 25, 2008 at 4:31 AM, Ram Sharma <ramsha...@gmail.com> wrote:

Paul Lindner

unread,
Dec 2, 2008, 4:01:48 PM12/2/08
to opensocial-an...@googlegroups.com
Yes, that would be consistent with the proposal.  This assumes that each person object has a pseudo field '@friends' that contains a list of friend IDs.

The filter constructs then search this 'field'.

In practice a container will likely want to intercept this response and process it in a more optimal manner depending on the back-end infrastructure.

Paul Lindner



Paul Lindner

unread,
Dec 2, 2008, 4:14:31 PM12/2/08
to opensocial-an...@googlegroups.com
and I've updated the wiki page with explicit language for the PoCo spec.

On Nov 21, 2008, at 9:55 AM, Louis Ryan wrote:


Paul Lindner



Evan Gilbert

unread,
Dec 3, 2008, 1:12:02 AM12/3/08
to opensocial-an...@googlegroups.com
+1

Louis Ryan

unread,
Dec 3, 2008, 11:14:45 AM12/3/08
to opensocial-an...@googlegroups.com
Reiterating my +1

Ropu's iPhone

unread,
Dec 3, 2008, 12:49:58 PM12/3/08
to opensocial-an...@googlegroups.com, opensocial-an...@googlegroups.com
+1


Sent from Ropu's iPhone
Reply all
Reply to author
Forward
0 new messages