zl程序教程

您现在的位置是:首页 >  其它

当前栏目

hugegraph增加顶点或边遇到The label of vertex can‘t be null的问题

The of be 遇到 增加 null can Label
2023-09-11 14:16:24 时间

1. 问题描述

基于hugegraph提供的client api增加图的顶点或边,遇到The label of vertex can't be null 或 The label of edge can't be null的错误,如下:

Exception in thread "main" class java.lang.IllegalArgumentException: The label of vertex can't be null
	at com.baidu.hugegraph.exception.ServerException.fromResponse(ServerException.java:47)
	at com.baidu.hugegraph.client.RestClient.checkStatus(RestClient.java:93)
	at com.baidu.hugegraph.rest.AbstractRestClient.post(AbstractRestClient.java:198)
	at com.baidu.hugegraph.rest.AbstractRestClient.post(AbstractRestClient.java:178)
	at com.baidu.hugegraph.api.graph.VertexAPI.create(VertexAPI.java:58)
	at com.baidu.hugegraph.driver.GraphManager.addVertices(GraphManager.java:96)
	at com.tech.graph.tools.mock.MockData.addData(MockData.java:78)
	at com.tech.graph.tools.mock.MockData.main(MockData.java:35)

代码如下: