我是 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_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 代码接受基本细节和关系的模式