cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Modeling posts and users and how they're connected

geronimo4j
Graph Buddy

I have Posts and Users in what I'm thinking is so far a social network graph. Users can author Posts. Users can follow other users.

Assuming a user follows another user who just made a post, do you create that relationship?

Like do you say, for all followers of the author, mark a relationship between their Post and that User?

My thought process is just, when you want to get all Posts for people you follow, those relationships should be already? Is that silly?

2 REPLIES 2

clem
Graph Steward

If you can draw a picture on a white board with circles being nodes and arrows being relationships, you can build it in Neo4J (with a bit of programming and/or data importing.)

So, here Nodes would be User and Post, relationships would be User WROTE Post, User FOLLOWS User.

The queries you can do follows (fairly) naturally from the picture once you get the hang of it.

Hi @geronimo4j,

Here is the initial draft version of the schema -

call db.schema.visualization()
2X_7_714f8d168176ccc6d05b2d532192983af7144ae9.png

I have created some JSON schema in neo4j/community/data_model_userpost at master · dominicvivek06/neo4j · GitHub

"Assuming a user follows another user who just made a post, do you create that relationship?" -> Is this automatic, or only when the user wants he will follow the other user ?