0
votes

I'm completely new to Neo4j, i would use it to calculate implicity affinity between users in my application and use that for social reccomendations.

Briefly, users give feedbacks (boolean value) about news, objects and travels that the application suggests to them.

So i should have in my graph 4 types of nodes:

  1. user
  2. news
  3. object
  4. travel

Every time an user gives a positive feedback for an item (news,travel,object) this event should create two relations into graph: HAS_VOTED (user to item), HAS_BEEN_VOTED (item to user). These relations have a property: vote, that is incremented every time a user gives a positive feedback.

My idea is to use this graph to calculate for very user all paths (using an upper limit on the lenght path) to all other users and use vote relation property to calculate a score for path with same length.

My problem are the high number of cycles, and paths, that should be in this graph, since in my solution every new vote event create two relation from user to item and so a cycle.

This problem could be bring to a perfomance problem in neo4j during paths calculation?

Is this the correct shema design to solve my problem?

Some good advice is welcome.

Thanks in advance.

1

1 Answers

0
votes

While Neo4j requires that a relationship be directional, it can easily traverse a relationship in both directions. Therefore, there is no need (and is inefficient and cumbersome) to use 2 relationships to represent a bidirectional relationship.

So, you could get rid of HAS_BEEN_VOTED, and just use the HAS_VOTED relationship type.

There are a lot of articles online about making recommendations with neo4j. You should do a search and find ones that are helpful to you.

Also, to start you off, you can enter this command in the Neo4j Browser to start a tutorial on personalized recommendations (it might answer most of your questipons):

:play http://guides.neo4j.com/sandbox/recommendations