图引擎服务 GES-添加label(1.1.6):请求示例

时间:2024-12-24 15:30:31

请求示例

添加label,label的名称为book,label一共有三个待添加的属性。

POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/schema/labels  
{
  "name": "book",
  "type": "vertex",
  "properties": [
    {
      "property": {
        "name": "Title",
        "cardinality": "single",
        "dataType": "string"
      }
    },
    {
      "property": {
        "name": "Version",
        "cardinality": "single",
        "dataType": "string"
      }
    },
    {
      "property": {
        "name": "Category",
        "typeName1": "science",
        "typeName2": "literature",
        "typeNameCount": "2",
        "cardinality": "single",
        "dataType": "enum"
      }
    }
  ]
}

SERVER_URL:图的访问地址,取值请参考业务面API使用限制

support.huaweicloud.com/api-ges/ges_03_0056.html