图引擎服务 GES-新增元数据(2.1.18):请求示例

时间:2024-04-29 11:34:09

请求示例

新增元数据,元数据存储地址为devdata/unionsdk/unionsdk_test.xml,不覆盖文件,元数据的名字为unionsdk_test,对元数据的描述为测试。

POST https://Endpoint/v2/{project_id}/graphs/metadatas

{
  "metadata_path" : "devdata/unionsdk/unionsdk_test.xml",
  "is_overwrite" : false,
  "name" : "unionsdk_test",
  "description" : "测试",
  "ges_metadata" : {
    "labels" : [ {
      "name" : "friends"
    }, {
      "name" : "movie",
      "properties" : [ {
        "dataType" : "string",
        "name" : "ChineseTitle",
        "cardinality" : "single"
      }, {
        "dataType" : "int",
        "name" : "Year",
        "cardinality" : "single"
      }, {
        "dataType" : "string",
        "name" : "Genres",
        "cardinality" : "set"
      } ]
    }, {
      "name" : "user",
      "properties" : [ {
        "dataType" : "string",
        "name" : "ChineseName",
        "cardinality" : "single"
      }, {
        "typeName1" : "F",
        "typeName2" : "M",
        "typeNameCount" : "2",
        "dataType" : "enum",
        "name" : "Gender",
        "cardinality" : "single"
      }, {
        "typeName1" : "Under 18",
        "typeName2" : "18-24",
        "typeName3" : "25-34",
        "typeName4" : "35-44",
        "typeNameCount" : "7",
        "dataType" : "enum",
        "name" : "Age",
        "typeName5" : "45-49",
        "typeName6" : "50-55",
        "cardinality" : "single",
        "typeName7" : "56+"
      }, {
        "dataType" : "string",
        "name" : "Occupation",
        "cardinality" : "single"
      }, {
        "dataType" : "char array",
        "name" : "Zip-code",
        "maxDataSize" : "12",
        "cardinality" : "single"
      } ]
    }, {
      "name" : "rate",
      "properties" : [ {
        "dataType" : "int",
        "name" : "Score",
        "cardinality" : "single"
      }, {
        "dataType" : "date",
        "name" : "Datetime",
        "cardinality" : "single"
      } ]
    } ]
  }
}
support.huaweicloud.com/api-ges/ges_03_0369.html