VertexLabel REST API: Define vertex types, ID strategies, and associated properties that determine vertex structure and constraints.
1.3 VertexLabel
Assuming that the PropertyKeys listed in 1.1.3 have already been created.
Params Description:
id: The ID value of the vertex type.
name: The name of the vertex type, required.
id_strategy: The ID strategy for the vertex type, including primary key ID, auto-generated, custom string, custom number, custom UUID. The default strategy is primary key ID.
properties: The property types associated with the vertex type.
primary_keys: The primary key properties. This field must have a value when the ID strategy is PRIMARY_KEY, and must be empty for other ID strategies.
enable_label_index: Whether to enable label indexing. It is disabled by default.
index_names: The indexes created for the vertex type. See details in section 3.4.
nullable_keys: Nullable properties.
user_data: Setting the common information of the vertex type, similar to the property type.
Starting from version v0.11.2, hugegraph-server supports Time-to-Live (TTL) functionality for vertices. The TTL for vertices is set through VertexLabel. For example, if you want the vertices of type “person” to have a lifespan of one day, you need to set the TTL field to 86400000 (in milliseconds) when creating the “person” VertexLabel.
Additionally, if the vertex has a property called “createdTime” and you want to use it as the starting point for calculating the vertex’s lifespan, you can set the ttl_start_time field in the VertexLabel. For example, if the “person” VertexLabel has a property called “createdTime” of type Date, and you want the vertices of type “person” to live for one day starting from the creation time, the Request Body for creating the “person” VertexLabel would be as follows:
You can use GET http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph/tasks/1 (where “1” is the task_id) to query the execution status of the asynchronous task. For more information, refer to the Asynchronous Task RESTful API.
↑↓ Navigate↵ Openesc Close
Ask AI
Agree to send your questions to the third-party Kapa service for AI answers based on the documentation.