JnBrymn / minglbot

0 stars 0 forks source link

Make "in between" function (ex. match A-->B<--C return B) #4

Closed JnBrymn closed 10 years ago

JnBrymn commented 10 years ago

Given a group of twitter users A, we can only find friends of A or followers of A. It would be nice to have a function so that given groups of twitter users A and B you can find X:

A-[:FOLLOWS]->X<-[:FOLLOWS]-B
A<-[:FOLLOWS]-X<-[:FOLLOWS]-B
A-[:FOLLOWS]->X-[:FOLLOWS]->B
A<-[:FOLLOWS]-X-[:FOLLOWS]->B
JnBrymn commented 10 years ago

Here is our current pattern:

def get_relations(self,
            users,
            direction, #can be friends or followers
            num_to_use=float("inf"),
            limit=100,
            min_num_mutual_relations=1
            )

Following in this pattern:

def get_two_sided_relations(self,
            users_left,
            direction_left, #can be friends or followers
            users_right,
            direction_right, #can be friends or followers
            num_to_use=float("inf"),
            limit=100,
            min_num_mutual_relations=1
            )

The visual here is that you're fulfilling this relationship:

(users_left)-[:direction_left]-(target)-[:direction_right]-(users_right)
JnBrymn commented 10 years ago

Closed in favor of simpler yet still more general ideas coming out of #18