Forum OpenACS Q&A: Friendster style community

Collapse
Posted by Matthew Terenzio on
I haven't used OpenACS in years and it looks like a lot of progress has been made. Congrats.

I'm going to download and try out the latest version today because I'm looking into developing a "Friendster" style community where users are hooked up with "friends of a friend". In other words, user 1 can contact user 3 because they both know user 2.

Off the bat, do you think OpenACS is the right tool for such a community?

Do you think this functionality would be a permissions thing?

Thanks,
the site looks great.

Collapse
Posted by Lars Pind on
Hi Matthew,

1) Yes, absolutely. It's an area that I'm myself very interested in exploring further.

2) No, I don't think it can realistically be done with permissions. I haven't given this much thought, but you probably need to maintain a table with the degree of separation between a given pair of users. Jeff Davis would be the perfect guy to help you figure out how to do that ;)

/Lars

Collapse
Posted by Carl Robert Blesius on
Also... make sure to touch base with David Kuczek.

https://openacs.org/shared/community-member?user_id=6529

He has built something like Friendster in Germany based on a 3.x version of OpenACS I think.

Collapse
Posted by Tilmann Singer on
I think that the acs_rels system of openacs could be a very good foundation for it. At least that seems to be a use case where having the ability to permission and otherwise explicitely deal with relationships actually make sense, so the implementation of acs_rels as acs_objects is very useful in this case.

And if the levels of separation between users that you query for remain low (I remember that friendster seldom goes deeper than 4 levels), it should be possible to do queries by joining acs_rels against itself a few times - as often as many levels you are interested in.

Collapse
Posted by Vlad Seryakov on
Hello Matthew, Are you going to implement something like this:
http://www.crystalballinc.com/iku/

I wrote it several months ago but did not continue. It is Aolserver based, but not OACS.

Collapse
Posted by Matthew Terenzio on
Thanks all,

Vlad, thats interesting. Did you write it in Tcl?

I'm basically interested in creating a controllable network, where you add a member to your personal network, based on implied or implicit references from your circle of trust.

What reminded me of OpenACS was remembering Philip Greenspun's(or whoever wrote the original bboards) bozo button.

That's what I mean about controllable. being able to zap people out of your network even if they are within a few levels of your circle.
For instance, an ex-girlfriend(or boy) 😉

Collapse
Posted by Vlad Seryakov on
Yes, it is written in Tcl and my own web framework package
Collapse
Posted by David Kuczek on
I think that we should really have a working "social networking" package. It would give us a competitive adventage towards other products. I do run a friendster clone in Germany and it really is interesting how social networking works or doesn't work within a different cultural set... I believe that this whole social networking arena will grow pretty sweetly in the future. I mean concerning innovative products, not only dating 😉

My current approach (some wiiiiild tcl hack 😉 is not too efficient, so after reading Tilmann's post I set up a quick query that returns a relationship matrix up to the 3rd depth including permissions. Funny that this idea didn't appear to me earlier... well:

#####

My table looks like this:

              Table "freunde"
    Column    |    Type    |  Modifiers
--------------+--------------+-------------
user_id      | integer      |
freund_id    | integer      |
approved_p  | character(1) | default 'f'
f_approved_p | character(1) | default 'f'

#####

My new query looks like this:

select
f1.user_id,
f1.freund_id as freund_id_1,
f2.freund_id as freund_id_2,
f3.freund_id as freund_id_3,
(
case when f2.freund_id is null and f3.freund_id is null then 1
else
case when f2.freund_id is not null and f3.freund_id is null then 2
else
case when f2.freund_id is not null and f3.freund_id is not null then 3
end end end
) as depth
from freunde f1
  left outer join freunde f2 ON f1.freund_id = f2.user_id
    and f2.freund_id != f1.user_id
    and f2.approved_p = 't'
    and f2.f_approved_p = 't'
  left outer join freunde f3 ON f2.freund_id = f3.user_id
    and f3.freund_id != f2.user_id
    and f3.freund_id != f1.user_id
    and f3.approved_p = 't'
    and f3.f_approved_p = 't'
where f1.user_id = 3
and  f1.approved_p = 't'
and  f1.f_approved_p = 't'
order by depth asc

#####

Question 1:
I was just thinking about adding an extra column called unique_freund_id, which would show the last freund_id in a row whenever this freund_id has not yet been show in a previous row. How could you do that? This way you would automatically have a list of freund_ids (=user_ids) that are in your network up to depth xy

Question 2:
Would this scale with lets say 100.000 users 😊??? If not, how could we tune this query?

#####

Cheerio. I get back to studying for my financial markets exam 😉

Collapse
Posted by David Kuczek on
Please consider that I have redundand information in my freunde table, which means that I have two rows inserted for one relation. I.E. for user_id = 3 and 10

user_id freund_id approved_p f_approved_p
3  10  t  t
10  3  t  t

This made it easier to set up the queries in the beginning as you wouldn't have to query "where (user_id = xy or freunde_id = xy)" etc. Loads of reduced complexity! But as this puppy should also scale, we should think about rewriting it.

Question 3
Would it be more efficient to only have one row for every relation in the database? Any examples of a query that would manage relations and permissions with only one row?

Collapse
Posted by Volodja Vorobey on
FYI - AIESEC International got into EU-funded project that will include development of social/business networking tools of the likes of friendster.com, linkedin.com, itsnotwhatyouknow.com, etc. AIESEC is using OpenACS for its www.aiesec.net 100.000+ members system and is developing OpenACS-based system for alumni. Developments should start in autumn 2004. Unless Commission changes its opinion on the project, of course :)

Would be interesting to follow on this discussion to ensure that code developed in not too-AIESEC specific [or accommodates requirements of other potential users, to put it in other way].