图引擎服务 GES-批量添加边(2.1.16):请求示例

时间:2024-01-25 20:06:42

请求示例

批量添加边,边的起点为46,边的终点分别为39和38,边的标签为rate。

POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/edges/action?action_id=batch-add
{
    "parallelEdge": {
        "action": "override",
        "ignoreLabel": false,
        "targetProperties": [
            {
                "label": "rate",
                "properties": [
                    "Datetime"
                ]
            },
            {
                "label": "superclassOf",
                "properties": [
                    "popularity"
                ]
            }
        ]
    },
    "createNotExists": true,
    "edges": [
        {
            "source": "46",
            "target": "39",
            "label": "rate",
            "properties": {
                "Rating": [
                    5
                ],
                "Datetime": [
                    "2018-01-01 20:30:05"
                ]
            }
        },
        {
            "source": "46",
            "target": "39",
            "label": "rate",
            "properties": {
                "Rating": [
                    4
                ],
                "Datetime": [
                    "2018-01-01 20:30:05"
                ]
            }
        }
    ]
}
  • SERVER_URL:图的访问地址,取值请参考业务面API使用限制
  • 样例中,若假设点666和777不在原图中,则创建666和777两个点,且label为默认值,之后再添加边。
support.huaweicloud.com/api-ges/ges_03_0164.html