Schema API

1.1 Schema

HugeGraph 提供单一接口获取某个图的全部 Schema 信息,包括:PropertyKey、VertexLabel、EdgeLabel 和 IndexLabel。

Method & Url
  1. GET http://localhost:8080/graphs/{graph_name}/schema
  2. e.g: GET http://localhost:8080/graphs/hugegraph/schema
Response Status
  1. 200
Response Body
  1. {
  2. "propertykeys": [
  3. {
  4. "id": 7,
  5. "name": "price",
  6. "data_type": "DOUBLE",
  7. "cardinality": "SINGLE",
  8. "aggregate_type": "NONE",
  9. "write_type": "OLTP",
  10. "properties": [],
  11. "status": "CREATED",
  12. "user_data": {
  13. "~create_time": "2023-05-08 17:49:05.316"
  14. }
  15. },
  16. {
  17. "id": 6,
  18. "name": "date",
  19. "data_type": "TEXT",
  20. "cardinality": "SINGLE",
  21. "aggregate_type": "NONE",
  22. "write_type": "OLTP",
  23. "properties": [],
  24. "status": "CREATED",
  25. "user_data": {
  26. "~create_time": "2023-05-08 17:49:05.309"
  27. }
  28. },
  29. {
  30. "id": 3,
  31. "name": "city",
  32. "data_type": "TEXT",
  33. "cardinality": "SINGLE",
  34. "aggregate_type": "NONE",
  35. "write_type": "OLTP",
  36. "properties": [],
  37. "status": "CREATED",
  38. "user_data": {
  39. "~create_time": "2023-05-08 17:49:05.287"
  40. }
  41. },
  42. {
  43. "id": 2,
  44. "name": "age",
  45. "data_type": "INT",
  46. "cardinality": "SINGLE",
  47. "aggregate_type": "NONE",
  48. "write_type": "OLTP",
  49. "properties": [],
  50. "status": "CREATED",
  51. "user_data": {
  52. "~create_time": "2023-05-08 17:49:05.280"
  53. }
  54. },
  55. {
  56. "id": 5,
  57. "name": "lang",
  58. "data_type": "TEXT",
  59. "cardinality": "SINGLE",
  60. "aggregate_type": "NONE",
  61. "write_type": "OLTP",
  62. "properties": [],
  63. "status": "CREATED",
  64. "user_data": {
  65. "~create_time": "2023-05-08 17:49:05.301"
  66. }
  67. },
  68. {
  69. "id": 4,
  70. "name": "weight",
  71. "data_type": "DOUBLE",
  72. "cardinality": "SINGLE",
  73. "aggregate_type": "NONE",
  74. "write_type": "OLTP",
  75. "properties": [],
  76. "status": "CREATED",
  77. "user_data": {
  78. "~create_time": "2023-05-08 17:49:05.294"
  79. }
  80. },
  81. {
  82. "id": 1,
  83. "name": "name",
  84. "data_type": "TEXT",
  85. "cardinality": "SINGLE",
  86. "aggregate_type": "NONE",
  87. "write_type": "OLTP",
  88. "properties": [],
  89. "status": "CREATED",
  90. "user_data": {
  91. "~create_time": "2023-05-08 17:49:05.250"
  92. }
  93. }
  94. ],
  95. "vertexlabels": [
  96. {
  97. "id": 1,
  98. "name": "person",
  99. "id_strategy": "PRIMARY_KEY",
  100. "primary_keys": [
  101. "name"
  102. ],
  103. "nullable_keys": [
  104. "age",
  105. "city"
  106. ],
  107. "index_labels": [
  108. "personByAge",
  109. "personByCity",
  110. "personByAgeAndCity"
  111. ],
  112. "properties": [
  113. "name",
  114. "age",
  115. "city"
  116. ],
  117. "status": "CREATED",
  118. "ttl": 0,
  119. "enable_label_index": true,
  120. "user_data": {
  121. "~create_time": "2023-05-08 17:49:05.336"
  122. }
  123. },
  124. {
  125. "id": 2,
  126. "name": "software",
  127. "id_strategy": "CUSTOMIZE_NUMBER",
  128. "primary_keys": [],
  129. "nullable_keys": [],
  130. "index_labels": [
  131. "softwareByPrice"
  132. ],
  133. "properties": [
  134. "name",
  135. "lang",
  136. "price"
  137. ],
  138. "status": "CREATED",
  139. "ttl": 0,
  140. "enable_label_index": true,
  141. "user_data": {
  142. "~create_time": "2023-05-08 17:49:05.347"
  143. }
  144. }
  145. ],
  146. "edgelabels": [
  147. {
  148. "id": 1,
  149. "name": "knows",
  150. "source_label": "person",
  151. "target_label": "person",
  152. "frequency": "SINGLE",
  153. "sort_keys": [],
  154. "nullable_keys": [],
  155. "index_labels": [
  156. "knowsByWeight"
  157. ],
  158. "properties": [
  159. "weight",
  160. "date"
  161. ],
  162. "status": "CREATED",
  163. "ttl": 0,
  164. "enable_label_index": true,
  165. "user_data": {
  166. "~create_time": "2023-05-08 17:49:08.437"
  167. }
  168. },
  169. {
  170. "id": 2,
  171. "name": "created",
  172. "source_label": "person",
  173. "target_label": "software",
  174. "frequency": "SINGLE",
  175. "sort_keys": [],
  176. "nullable_keys": [],
  177. "index_labels": [
  178. "createdByDate",
  179. "createdByWeight"
  180. ],
  181. "properties": [
  182. "weight",
  183. "date"
  184. ],
  185. "status": "CREATED",
  186. "ttl": 0,
  187. "enable_label_index": true,
  188. "user_data": {
  189. "~create_time": "2023-05-08 17:49:08.446"
  190. }
  191. }
  192. ],
  193. "indexlabels": [
  194. {
  195. "id": 1,
  196. "name": "personByAge",
  197. "base_type": "VERTEX_LABEL",
  198. "base_value": "person",
  199. "index_type": "RANGE_INT",
  200. "fields": [
  201. "age"
  202. ],
  203. "status": "CREATED",
  204. "user_data": {
  205. "~create_time": "2023-05-08 17:49:05.375"
  206. }
  207. },
  208. {
  209. "id": 2,
  210. "name": "personByCity",
  211. "base_type": "VERTEX_LABEL",
  212. "base_value": "person",
  213. "index_type": "SECONDARY",
  214. "fields": [
  215. "city"
  216. ],
  217. "status": "CREATED",
  218. "user_data": {
  219. "~create_time": "2023-05-08 17:49:06.898"
  220. }
  221. },
  222. {
  223. "id": 3,
  224. "name": "personByAgeAndCity",
  225. "base_type": "VERTEX_LABEL",
  226. "base_value": "person",
  227. "index_type": "SECONDARY",
  228. "fields": [
  229. "age",
  230. "city"
  231. ],
  232. "status": "CREATED",
  233. "user_data": {
  234. "~create_time": "2023-05-08 17:49:07.407"
  235. }
  236. },
  237. {
  238. "id": 4,
  239. "name": "softwareByPrice",
  240. "base_type": "VERTEX_LABEL",
  241. "base_value": "software",
  242. "index_type": "RANGE_DOUBLE",
  243. "fields": [
  244. "price"
  245. ],
  246. "status": "CREATED",
  247. "user_data": {
  248. "~create_time": "2023-05-08 17:49:07.916"
  249. }
  250. },
  251. {
  252. "id": 5,
  253. "name": "createdByDate",
  254. "base_type": "EDGE_LABEL",
  255. "base_value": "created",
  256. "index_type": "SECONDARY",
  257. "fields": [
  258. "date"
  259. ],
  260. "status": "CREATED",
  261. "user_data": {
  262. "~create_time": "2023-05-08 17:49:08.454"
  263. }
  264. },
  265. {
  266. "id": 6,
  267. "name": "createdByWeight",
  268. "base_type": "EDGE_LABEL",
  269. "base_value": "created",
  270. "index_type": "RANGE_DOUBLE",
  271. "fields": [
  272. "weight"
  273. ],
  274. "status": "CREATED",
  275. "user_data": {
  276. "~create_time": "2023-05-08 17:49:08.963"
  277. }
  278. },
  279. {
  280. "id": 7,
  281. "name": "knowsByWeight",
  282. "base_type": "EDGE_LABEL",
  283. "base_value": "knows",
  284. "index_type": "RANGE_DOUBLE",
  285. "fields": [
  286. "weight"
  287. ],
  288. "status": "CREATED",
  289. "user_data": {
  290. "~create_time": "2023-05-08 17:49:09.473"
  291. }
  292. }
  293. ]
  294. }

Last modified May 14, 2023: docs: modify and translate schema-api (#214) (9c794f67)