incubator-hugegraph icon indicating copy to clipboard operation
incubator-hugegraph copied to clipboard

根据文档刚刚部署HugeGraph-studio,操作报错不太明白,望大神指点

Open jackchen-c opened this issue 7 years ago • 1 comments

代码如下: knows = graph.schema().edgeLabel("knows").sourceLabel("person").targetLabel("person").properties("date").ifNotExist().create()

marko = graph.addVertex(T.label, "person", "name", "marko", "age", 29, "city", "Beijing") vadas = graph.addVertex(T.label, "person", "name", "vadas", "age", 27, "city", "Hongkong") marko.addEdge("knows", vadas, "date", "20160110") 报错如下: Error! All non-null property keys: [weight, date] of edge label 'knows' must be setted, but missed keys: [weight]

jackchen-c avatar Jun 14 '19 09:06 jackchen-c

提示:weight属性(不可空的)没有传递,两种改法:

  1. 把weight和date设置为可空属性
graph.schema().edgeLabel("knows").nullableKeys("weight", "date").append();
  1. 添加边的时候把weight和date都写上
marko.addEdge("knows", vadas, "weight", 0.5, "date", "20160110")

Linary avatar Jun 17 '19 02:06 Linary