更新时间:2025-03-13 GMT+08:00
        
          
          
        
      
      
      
      
      
      
      
      
  
      
      
      
        
批量添加边(2.1.9)
功能介绍
批量添加边。
URI
- URI格式
    POST /ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=batch-add
- 参数说明 
    表1 URI参数说明 参数 是否必选 类型 说明 project_id 是 String 项目ID。获取方法请参见获取项目ID。 graph_name 是 String 图名称。 
请求
- 请求样例
    POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=batch-add { "edges": [ { "source": "46", "target": "39", "label": "rate", "properties": { "Rating": [ 5 ], "Datetime": [ "2018-01-0120:30:05" ] } }, { "source": "46", "target": "38", "label": "rate", "properties": { "Rating": [ 4 ], "Datetime": [ "2018-01-0120:30:05" ] } } ], "parallelEdge": { "action": "override", "ignoreLabel": true } }
- Body参数说明 
    参数 是否必选 类型 说明 edges 是 Json 待添加边数组 parallelEdge 否 Object 重复边处理 action 否 String 处理方式,取值为allow,ignore和override,默认为allow。 - allow表示允许重复边。
- ignore表示忽略之后的重复边。
- override表示覆盖之前的重复边。
 ignoreLabel 否 Boolean 重复边的定义,是否忽略Label。取值为true或者false,默认取true。 - true 表示重复边定义不包含Label,即用<源点,终点>标记一条边,不包含Label。
- false 表示重复边定义包含Label,即用<源点,终点,Label>标记一条边。
 表2 edges参数说明 参数 是否必选 类型 说明 source 是 String 边的source节点。 target 是 String 边的target节点。 label 是 String 边的label。 properties 否 Json 各个属性的值。 
响应
- 要素说明 
    参数 是否必选 类型 说明 errorMessage 否 String 系统提示信息,执行成功时,字段可能为空。执行失败时,用于显示错误信息。 errorCode 否 String 系统提示信息,执行成功时,字段可能为空。执行失败时,用于显示错误码。 result 否 String 成功时result值为success。 
- 请求成功样例
    Http Status Code: 200 { "result":"success", "data": { "edges": [ { "index": "7", "source": "46", "target": "39" }, { "index": "0", "source": "46", "target": "38" } ] } }
- 请求失败样例
    Http Status Code: 400 { "errorMessage":"Edge source vertex [Lily] does not exist", "errorCode":"GES.8000" }
   父主题: 边操作API
  
  
     
      