1.3.1 创建一个EdgeLabel
Method & Url
Request Body
"name": "created",
"source_label": "person",
"target_label": "software",
"frequency": "SINGLE",
"properties": [
"date"
],
"sort_keys": [],
"nullable_keys": [],
"enable_label_index": true
}
Response Status
Response Body
{
"id": 1,
"sort_keys": [
],
"source_label": "person",
"name": "created",
"index_names": [
],
"properties": [
"date"
],
"target_label": "software",
"frequency": "SINGLE",
"nullable_keys": [
],
"user_data": {}
}
1.3.2 为已存在的EdgeLabel添加properties或userdata,或者移除userdata(目前不支持移除properties)
Params
- action: 表示当前行为是添加还是移除,取值为
append
(添加)和eliminate
(移除)
Method & Url
PUT http://localhost:8080/graphs/hugegraph/schema/edgelabels/created?action=append
Request Body
Response Status
200
Response Body
{
"id": 2,
"sort_keys": [
],
"source_label": "person",
"name": "created",
"index_names": [
],
"properties": [
"date",
"weight"
],
"target_label": "software",
"frequency": "SINGLE",
"weight"
],
"enable_label_index": true,
"user_data": {}
}
1.3.3 获取所有的EdgeLabel
Method & Url
GET http://localhost:8080/graphs/hugegraph/schema/edgelabels
Response Status
Response Body
1.3.4 根据name获取EdgeLabel
Method & Url
GET http://localhost:8080/graphs/hugegraph/schema/edgelabels/created
Response Status
200
Response Body
{
"id": 1,
"sort_keys": [
],
"source_label": "person",
"name": "created",
"index_names": [
],
"properties": [
"date",
"city",
"weight"
],
"target_label": "software",
"frequency": "SINGLE",
"nullable_keys": [
"city",
"weight"
],
"enable_label_index": true,
"user_data": {}
}
1.3.5 根据name删除EdgeLabel
Method & Url
DELETE http://localhost:8080/graphs/hugegraph/schema/edgelabels/created
Response Status
Response Body
{
"task_id": 1