今天试了一下使用中文的边插入dgraph,我的插入语句为:

{
"set": [{
"uid": "_:111",
"dgraph.type": "Person",
"name": "高绍和",
"董事长":{
"uid": "_:222",
"name": "金钟科技",
"dgraph.type": "Company"
}
}]
}

接下来我的查询语句为:

{
getPerson(func: eq(name, "高绍和")) {
name
uid
}
}

查询出来的结果为:

dgraph 插入中文的边,然后检索中文的边_查询语句

查询的时候要加入<>,不然就报错了哈,是不是很简单呢。

参考文献

[1]. In the Mutate page can Name edges in Chinese, but can't use Chinese in the query page to retrieve edge. ​​https://github.com/dgraph-io/dgraph/issues/4914​