更新时间:2023-01-16 GMT+08:00

添加点

您可以使用GES提供的接口添加点。示例代码如下:
 public static void addVertex(GraphClient graphClient) throws ApiException
{
    Map properties = new HashMap();
    List gender = new ArrayList();
    gender.add("F");
    properties.put("Gender", gender);
    List occupation = new ArrayList();
    occupation.add("artist");
    properties.put("Occupation", occupation);
    List age = new ArrayList();
    age.add("under 18");
    properties.put("Age", age);
    List zipCode = new ArrayList();
    zipCode.add("98133");
    properties.put("Zip-code", zipCode);
    AddVertexReq req = new AddVertexReq();
    //设置vertex Id
    req.setVertexId("Lily");
    //设置label
    req.setLabel("user");
    //设置属性
    req.setProperties(properties);
    graphClient.addVertex(req);

}