1.1 PropertyKey

1.1.1 创建一个 PropertyKey

Method & Url
  1. POST http://localhost:8080/graphs/hugegraph/schema/propertykeys
Request Body
  1. {
  2. "name": "age",
  3. "data_type": "INT",
  4. "cardinality": "SINGLE"
  5. }
Response Status
  1. 201
Response Body
  1. {
  2. "id": 2,
  3. "name": "age",
  4. "data_type": "INT",
  5. "cardinality": "SINGLE",
  6. "properties": [],
  7. "user_data": {}
  8. }

1.1.2 为已存在的 PropertyKey 添加或移除 userdata

Params
  • action: 表示当前行为是添加还是移除,取值为append(添加)和eliminate(移除)
Method & Url
  1. PUT http://localhost:8080/graphs/hugegraph/schema/propertykeys/age?action=append
Request Body
  1. {
  2. "name": "age",
  3. "user_data": {
  4. "min": 0,
  5. "max": 100
  6. }
  7. }
Response Status
  1. 201
Response Body
  1. {
  2. "id": 2,
  3. "name": "age",
  4. "data_type": "INT",
  5. "cardinality": "SINGLE",
  6. "properties": [],
  7. "user_data": {
  8. "min": 0,
  9. "max": 100
  10. }
  11. }

1.1.3 获取所有的 PropertyKey

Method & Url
  1. GET http://localhost:8080/graphs/hugegraph/schema/propertykeys
Response Status
  1. 200
Response Body
  1. {
  2. "propertykeys": [
  3. {
  4. "id": 3,
  5. "name": "city",
  6. "data_type": "TEXT",
  7. "cardinality": "SINGLE",
  8. "properties": [],
  9. "user_data": {}
  10. },
  11. {
  12. "id": 2,
  13. "name": "age",
  14. "data_type": "INT",
  15. "cardinality": "SINGLE",
  16. "properties": [],
  17. "user_data": {}
  18. },
  19. {
  20. "id": 5,
  21. "name": "lang",
  22. "data_type": "TEXT",
  23. "cardinality": "SINGLE",
  24. "properties": [],
  25. "user_data": {}
  26. },
  27. {
  28. "id": 4,
  29. "name": "weight",
  30. "data_type": "DOUBLE",
  31. "cardinality": "SINGLE",
  32. "properties": [],
  33. "user_data": {}
  34. },
  35. {
  36. "id": 6,
  37. "name": "date",
  38. "data_type": "TEXT",
  39. "cardinality": "SINGLE",
  40. "properties": [],
  41. "user_data": {}
  42. },
  43. {
  44. "id": 1,
  45. "name": "name",
  46. "data_type": "TEXT",
  47. "cardinality": "SINGLE",
  48. "properties": [],
  49. "user_data": {}
  50. },
  51. {
  52. "id": 7,
  53. "name": "price",
  54. "data_type": "INT",
  55. "cardinality": "SINGLE",
  56. "properties": [],
  57. "user_data": {}
  58. }
  59. ]
  60. }

1.1.4 根据name获取PropertyKey

Method & Url
  1. GET http://localhost:8080/graphs/hugegraph/schema/propertykeys/age

其中,age为要获取的PropertyKey的名字

Response Status
  1. 200
Response Body
  1. {
  2. "id": 2,
  3. "name": "age",
  4. "data_type": "INT",
  5. "cardinality": "SINGLE",
  6. "properties": [],
  7. "user_data": {}
  8. }

1.1.5 根据name删除PropertyKey

Method & Url
  1. DELETE http://localhost:8080/graphs/hugegraph/schema/propertykeys/age

其中,age为要获取的PropertyKey的名字

Response Status
  1. 204