How to store social network's actions in NEO4J?

喜夏-厌秋 提交于 2020-02-06 05:06:26

问题


We are going to use NEO4J for our social network database and we have common social networks actions such as following, link, comment, posts and so on... .

Now I want to know is this correct, we are doing:

Comment: user_comment is a node and has a relation with post node, relation name is comment


Like: Like is a relation, the relation name is like and a post has a relation with a user, the relation name is like


Location: Each post can have a location, then post node has a where relation with location node. (We use Google map API for locations)


tags: Each can have some tags, if tag is exist as a node we just define a relation to tag, then post node has tag relation with tag node


media: media node has media relation with post node

OK, just please let me know are the above definition and relationships correct or we can do something else?

For example if is this true that like action (favorite) should be a relationship between users and post? or we can do something else? and so on for other nodes in above...


回答1:


Sounds sensible.

You also have the option to just store latitude, longitude on your post nodes.

The actual model depends more on your use-cases.

Yes favorite / like would be a relationships.



来源:https://stackoverflow.com/questions/37374675/how-to-store-social-networks-actions-in-neo4j

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!