【发布时间】:2020-03-04 19:29:19
【问题描述】:
我是 dgraph 的初学者,并从 neo4j 转移到 dgraph。我正在编写架构,其中我有不同的社交媒体平台详细信息。
考虑到 facebook,架构将包含个人资料、群组、页面的基本详细信息,以及 fb 个人资料与群组和页面之间的不同关系,例如
profile_a is 'friends_of' profile_b;
user 'likes' page_b;
user is 'member_of' group_a
user 'works_at' place_a
关系将是 twitter 的类似情况
twitter_user 'follows' user_a
user_a 'followed_by' users
我这样做是为了什么
type Person{
name: string @index(exact) .
id: string @index(exact) .
profile: string @index(exact) .
picture_link: string .
status_count: int .
location: string .
tags: string .
user_id: int .
follower_count: string .
friend_count: string .
type: int @index(exact) .
likes : [Page] .
friends_of : [Fb_User] .
members_of : [Group] .
works_at : {
name: string .
}
}
type Fb_User{
name: string @index(exact) .
id: string @index(exact) .
profile: string @index(exact) .
picture_link: string .
status_count: int .
location: string .
type: int @index(exact) .
location: string .
tags: string .
user_id: int .
}
type Group{
name: string @index(exact) .
id: string @index(exact) .
profile: string @index(exact) .
picture_link: string .
group_member : int .
}
type Page{
name: string @index(exact) .
id: string @index(exact) .
profile: string @index(exact) .
picture_link: string .
page_type : int .
}
type Facebook
{
label: string @index(exact)
}
请指导和纠正我的架构结构。期待在pydgraph中实现它
谢谢
得到帮助 https://tour.dgraph.io/schema/1/
我希望架构能够通过 python 代码接受基本细节和关系
【问题讨论】:
标签: python graph graphql dgraph