Updated on 2022-11-14 GMT+08:00

Adding a Property

You can use a specific API provided by GES to add a property. The sample code is as follows:
public static void addProperties(GraphClient graphClient) throws ApiException 
{
     AddPropertiesReq req = new AddPropertiesReq();
     req.setLabelName("stop");
     List<Property> properties = new ArrayList<Property>();
     Property property = new Property();
     property.put("name", "a");
     property.put("cardinality", "single");
     property.put("dataType", "int");
     properties.add(property);
     req.setProperties(properties);
     Map<String, Object> result = graphClient.addProperties(req);
     System.out.println(MapUtils.map2json(result));
}