0
votes

I try to get a collection of nodes in my neo4j project

my db try describe connection between users and movies by rating

so i link the users to the movie with link "RATED" that have a rating value(1-5)

in addition i linked the users with themselves with "SIMILARITY" link

now i have groups of users that have liked between them

the groups of users

i want to see for each group of similarity users:group of movies that liked that movies(liked = rating>=4)

example

in this example my result is:Outbreak,Dance With Wolves,Disclosure

1
And how do you try to get the result?stdob--
do you use some community algorithm to try and define your groups of similar people ?Tomaž Bratanič
i dont know how to build the query that return me the groups of movies(for each similarity users group)oshri rehani
how do you get similarity users group ? Just having a relationship with similarity between users is not enough.Tomaž Bratanič
i was created the similarity relationship between the users: user similar to other user : if they have at least 50% common movies that they likedoshri rehani

1 Answers

0
votes

Now that you have created a direct relationship SIMILAR between users, you must run a community detection algorithms, so that it defines different groups of users. You can run it using apoc.algo functions using apoc plugin for neo4j.

CALL apoc.algo.community(25,['User'],'community','SIMILAR','BOTH',1,10000)

Now that you have defined your user groups with community detection algorithm you can simply query what different groups of users like

//You can also set additional filters when matching movies groups liked
MATCH (user:User)-[rel:LIKED]->(m:Movie) where rel.rating > 3.5
RETURN distinct(user.community) as group,collect(m.title) as movies

Know that this is a very simple version of how you can implement this. I suggest you check out this graphgist and maybe this video.

Hope this helps