问题
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