首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >用于neo4j DB的良好模式

用于neo4j DB的良好模式
EN

Stack Overflow用户
提问于 2013-12-23 21:35:42
回答 1查看 251关注 0票数 0

基于电话簿的社交共享网络的最佳设计是什么?

背景: App同步联系人的电话簿和用户的社交网络,并构建图表并给出建议。

用例: 1.向电话簿中的人推荐朋友,共同的朋友。2.最初,用户连接到的节点不多,因此可能是

代码语言:javascript
运行
复制
case you have lot of friends but very few of them are social friends. Does it make sense    to have new relationship for every social ID (be bbm, FB, linkedin) 3. We will build the network through which old user gets notification when new user joins     any of social network and register to our app. 4. Pick of the day - based on mutual friends (degree and social interest and country), user    can search country wise social IDs. 5. User always search people from 1 country or its connected node (upto 4 degree) based on     male/female and age filter. 6. Status update would be notified to other connected nodes with social IDs.

模式:国家(每个国家1个关系或存储桶)。朋友(所有在电话簿中的人)-电话号码作为关键。社交朋友(每个社交网络公司1个关系或桶-当您的电话簿中的某人更新我们网站上的社交链接时,将立即更新关系)。1男性的关系-帮助过滤和挑选建议。1女性帮助筛选和挑选建议的关系。

将朋友和社交朋友也添加为关系有意义吗?

EN

回答 1

Stack Overflow用户

发布于 2014-01-03 07:21:02

通常你会这样做:

代码语言:javascript
运行
复制
(u:User { phone : "phone#" })-[:ON_PHONE]->(u2:User { phone : "phone#" })

(u:User { phone : "phone#" })-[:KNOWS]->(u2:User:Facebook { phone : "phone#", fbid: "fbid" })

如果你想保留社交网络连接的记录信息,你可以像这样向你的图表添加额外的链接:

代码语言:javascript
运行
复制
(u:User { phone : "phone#" })-[:KNOWS_ON_FB]->(:FacebookUser {fbid:"fbid"})<-[:ON_FB]-(u2:User { phone : "phone#", fbid: "fbid" })

我认为在大多数情况下,你不需要保存记录,应该只关注你可以更新的图表的“实时/当前”结构。

如果您有用户的facebook、linkedin等信息,则可以向用户添加其他标签,然后添加其他索引:

代码语言:javascript
运行
复制
create index on :User(phone)
create index on :Facebook(fbid)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20744677

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档