This is a question kind of related to foaf application but not FOAF itself.
Say I have a Friend Table where there are basically two fields.
UserID
FriendID
How do i show the path between two users in the tribe.net "friend who has a friend who has a friend" way?
-
Re: connection paths between users
Sat, October 29, 2005 - 9:53 AMuse a shortest-path algorithm on a graph constructed out of the friend table.
here's an example of a (weighted) shortest path algorithm:
www.soi.wide.ad.jp/class/99...3/07.html -
-
Re: connection paths between users
Sat, October 29, 2005 - 6:17 PM
i work in php and sql.
while i am aware that the algorithm is not language specific.. it doesn't do much to explain even how to build this graph out of the friend table.
also it seems this algorithm takes into account different distances between nodes.. not so important for a friend table.
can anyone tell me more specifically how i would approach this problem?
does anyone here know the schema for the tribe.net friend table?
how would you consrtuct a graph of the friend table?
thanks!
-
-
Re: connection paths between users
Tue, November 1, 2005 - 2:25 PM
I'm slowly working through this..
So i guess this "graph" is basically just a multi dimmensional array with all my users in it and who all their friends are?
If anyone as any code examples of this (especially in PHP) i would be super stoked.
Also ideas on how to cache all this so it doesn't slow the entire server down by selecting the same thing again and again..
thanks! -
-
Re: connection paths between users
Wed, November 2, 2005 - 12:56 AMUsing and aggregating FOAF is basically a Google sized problem. Made worse because there's a lot of non-standard FOAF out there and a lot of FOAF that is basically meaningless. For the second consider all the FOAF from Livejournal that consists of "Here's my nick and my page. Here's a long list of nicknames and their pages". There's precious little actual data about any of them.
If you look at a single FOAF file about A you can answer "Who does A know" but you can't answer "Who says they know A" The only way to do that is to build a cached database of the FOAF universe. Now you're deep into scutter design, cacheing, expiring and syncing data, and SQL database design for RDF triples. If you just store triples, you'll have a *very large* number of them. Getting any real data out of this is going to involve some nasty, nasty SQL queries that will run slow. If you normalise the data to solve a particular problem, then you're giving up other access routes. Particularly access routes that you don't know about yet.
So all in all it's an interesting computer science problem but damn hard.
I got quite a ways down building a site loosely called "Is my FOAF Hot Or Not?" I stumbled and fell at the Scutter problem.
In the end I've decided that FOAF is most interesting as a data transfer format from one system to another. At which point, microformats like hCard are more interesting, although they don't have anything comparable to the "foaf:knows" format.
-
-
Re: connection paths between users
Wed, November 2, 2005 - 5:35 PMcombine hCard with XFN and you've got your very own distributed social network. -
-
Re: connection paths between users
Wed, November 2, 2005 - 8:25 PM
I already have a table full of the friend info.
I'm not trying to do it from FOAF files right now.
i have no idea what hCard or XFN are
-
-
-
-
-