incubator-hugegraph
incubator-hugegraph copied to clipboard
根据文档刚刚部署HugeGraph-studio,操作报错不太明白,望大神指点
代码如下: 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]
提示:weight属性(不可空的)没有传递,两种改法:
- 把
weight和date设置为可空属性
graph.schema().edgeLabel("knows").nullableKeys("weight", "date").append();
- 添加边的时候把
weight和date都写上
marko.addEdge("knows", vadas, "weight", 0.5, "date", "20160110")