本文介绍了如何在NEO4J中存储社交网络的行为?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们将使用NEO4J作为我们的社交网络数据库,我们有常见的社交网络操作,如以下,链接,评论,帖子等。

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:

Like:关系名称是类似的,并且一个帖子与用户具有
关系,关系名称类似于

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

位置:每个帖子可以有一个位置,然后帖子节点与位置节点具有where关系。 (我们使用Google地图API查找位置)

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

标签:每个标签都可以有一些标签,如果标签作为节点存在,我们只需定义一个与标签的关系,然后post节点与标签节点具有标签关系

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

例如,如果这是真的,喜欢的动作(喜欢)应该是用户和帖子之间的关系?或者我们可以做别的事情?对于上面的其他节点,依此类推...

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...

推荐答案

听起来很明智。

您还可以选择只在您的帖子节点上存储纬度,经度。

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.

这篇关于如何在NEO4J中存储社交网络的行为?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 05:12