콘텐츠로 이동

Metadata API Reference

이 콘텐츠는 아직 번역되지 않았습니다.

Metadata management API for databases, tables, and aliases.

Retrieve all databases.

GET /graph/v3/databases
LocationParameterRequiredDescription
HeaderAuthorizationOptionalAuthentication key (reserved for future use)

List<DatabaseDescriptor> - List of databases

Terminal window
curl -X GET \
"http://ab.example.com/graph/v3/databases" \
-H "Authorization: YOUR_API_KEY"
[
{
"tenant": "default",
"database": "mydb",
"active": true,
"comment": "My database",
"revision": 1,
"createdAt": 1700000000000,
"createdBy": "admin",
"updatedAt": 1700000000000,
"updatedBy": "admin"
}
]

Retrieve a single database by name.

GET /graph/v3/databases/{database}
LocationParameterRequiredDescription
HeaderAuthorizationOptionalAuthentication key (reserved for future use)
PathdatabaseRequiredDatabase name

DatabaseDescriptor - Database information

Returns 404 if not found.

Terminal window
curl -X GET \
"http://ab.example.com/graph/v3/databases/mydb" \
-H "Authorization: YOUR_API_KEY"
{
"tenant": "default",
"database": "mydb",
"active": true,
"comment": "My database",
"revision": 1,
"createdAt": 1700000000000,
"createdBy": "admin",
"updatedAt": 1700000000000,
"updatedBy": "admin"
}

Create a new database.

POST /graph/v3/databases
LocationParameterRequiredDescription
HeaderAuthorizationOptionalAuthentication key (reserved for future use)
BodydatabaseRequiredDatabase name
BodycommentRequiredDatabase description

DatabaseCreateRequest - Database creation payload

DatabaseDescriptor - Created database information

Terminal window
curl -X POST \
"http://ab.example.com/graph/v3/databases" \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"database": "mydb",
"comment": "My database"
}'
{
"tenant": "default",
"database": "mydb",
"active": true,
"comment": "My database",
"revision": 1,
"createdAt": 1700000000000,
"createdBy": "admin",
"updatedAt": 1700000000000,
"updatedBy": "admin"
}

Update an existing database.

PUT /graph/v3/databases/{database}
LocationParameterRequiredDescription
HeaderAuthorizationOptionalAuthentication key (reserved for future use)
PathdatabaseRequiredDatabase name
BodyactiveOptionalWhether the database is active
BodycommentOptionalDatabase description

DatabaseUpdateRequest - Database update payload

DatabaseDescriptor - Updated database information

Terminal window
curl -X PUT \
"http://ab.example.com/graph/v3/databases/mydb" \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"active": true,
"comment": "Updated description"
}'

Delete an existing database.

DELETE /graph/v3/databases/{database}
LocationParameterRequiredDescription
HeaderAuthorizationOptionalAuthentication key (reserved for future use)
PathdatabaseRequiredDatabase name

204 No Content (no response body)

Terminal window
curl -X DELETE \
"http://ab.example.com/graph/v3/databases/mydb" \
-H "Authorization: YOUR_API_KEY"

Retrieve all tables in a database.

GET /graph/v3/databases/{database}/tables
LocationParameterRequiredDescription
HeaderAuthorizationOptionalAuthentication key (reserved for future use)
PathdatabaseRequiredDatabase name

List<TableDescriptor> - List of tables

Terminal window
curl -X GET \
"http://ab.example.com/graph/v3/databases/mydb/tables" \
-H "Authorization: YOUR_API_KEY"

Retrieve a single table by name.

GET /graph/v3/databases/{database}/tables/{table}
LocationParameterRequiredDescription
HeaderAuthorizationOptionalAuthentication key (reserved for future use)
PathdatabaseRequiredDatabase name
PathtableRequiredTable name

TableDescriptor - Table information

Returns 404 if not found.

Terminal window
curl -X GET \
"http://ab.example.com/graph/v3/databases/mydb/tables/follows" \
-H "Authorization: YOUR_API_KEY"
{
"type": "edge",
"tenant": "default",
"database": "mydb",
"table": "follows",
"schema": {
"type": "edge",
"source": { "type": "string", "comment": "user id" },
"target": { "type": "string", "comment": "user id" },
"properties": [],
"direction": "OUT",
"indexes": [],
"groups": []
},
"storage": "datastore://hbase/follows_table",
"mode": "SYNC",
"active": true,
"comment": "User follows relationship",
"revision": 1,
"createdAt": 1700000000000,
"createdBy": "admin",
"updatedAt": 1700000000000,
"updatedBy": "admin"
}

Create a new table.

POST /graph/v3/databases/{database}/tables
LocationParameterRequiredDescription
HeaderAuthorizationOptionalAuthentication key (reserved for future use)
PathdatabaseRequiredDatabase name
BodytableRequiredTable name
BodyschemaRequiredEdge schema definition
BodystorageRequiredStorage URI (datastore://<namespace>/<table>)
BodymodeOptionalMutation mode (default: SYNC)
BodycommentRequiredTable description

TableCreateRequest - Table creation payload

TableDescriptor - Created table information

Terminal window
curl -X POST \
"http://ab.example.com/graph/v3/databases/mydb/tables" \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"table": "follows",
"schema": {
"type": "EDGE",
"source": { "type": "string", "comment": "user id" },
"target": { "type": "string", "comment": "user id" },
"properties": [],
"direction": "OUT",
"indexes": [],
"groups": []
},
"storage": "datastore://hbase/follows_table",
"mode": "SYNC",
"comment": "User follows relationship"
}'

Update an existing table.

PUT /graph/v3/databases/{database}/tables/{table}
LocationParameterRequiredDescription
HeaderAuthorizationOptionalAuthentication key (reserved for future use)
PathdatabaseRequiredDatabase name
PathtableRequiredTable name
BodyactiveOptionalWhether the table is active
BodyschemaOptionalEdge schema definition
BodymodeOptionalMutation mode
BodycommentOptionalTable description

TableUpdateRequest - Table update payload

TableDescriptor - Updated table information

Terminal window
curl -X PUT \
"http://ab.example.com/graph/v3/databases/mydb/tables/follows" \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"active": true,
"comment": "Updated description"
}'

Delete an existing table.

DELETE /graph/v3/databases/{database}/tables/{table}
LocationParameterRequiredDescription
HeaderAuthorizationOptionalAuthentication key (reserved for future use)
PathdatabaseRequiredDatabase name
PathtableRequiredTable name

204 No Content (no response body)

Terminal window
curl -X DELETE \
"http://ab.example.com/graph/v3/databases/mydb/tables/follows" \
-H "Authorization: YOUR_API_KEY"

Retrieve all aliases in a database.

GET /graph/v3/databases/{database}/aliases
LocationParameterRequiredDescription
HeaderAuthorizationOptionalAuthentication key (reserved for future use)
PathdatabaseRequiredDatabase name

List<AliasDescriptor> - List of aliases

Terminal window
curl -X GET \
"http://ab.example.com/graph/v3/databases/mydb/aliases" \
-H "Authorization: YOUR_API_KEY"

Retrieve a single alias by name.

GET /graph/v3/databases/{database}/aliases/{alias}
LocationParameterRequiredDescription
HeaderAuthorizationOptionalAuthentication key (reserved for future use)
PathdatabaseRequiredDatabase name
PathaliasRequiredAlias name

AliasDescriptor - Alias information

Returns 404 if not found.

Terminal window
curl -X GET \
"http://ab.example.com/graph/v3/databases/mydb/aliases/friends" \
-H "Authorization: YOUR_API_KEY"
{
"tenant": "default",
"database": "mydb",
"alias": "friends",
"table": "follows",
"active": true,
"comment": "Alias for follows",
"revision": 1,
"createdAt": 1700000000000,
"createdBy": "admin",
"updatedAt": 1700000000000,
"updatedBy": "admin"
}

Create a new alias.

POST /graph/v3/databases/{database}/aliases
LocationParameterRequiredDescription
HeaderAuthorizationOptionalAuthentication key (reserved for future use)
PathdatabaseRequiredDatabase name
BodyaliasRequiredAlias name
BodytableRequiredTarget table name (same database only)
BodycommentRequiredAlias description

AliasCreateRequest - Alias creation payload

AliasDescriptor - Created alias information

Terminal window
curl -X POST \
"http://ab.example.com/graph/v3/databases/mydb/aliases" \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"alias": "friends",
"table": "follows",
"comment": "Alias for follows"
}'

Update an existing alias.

PUT /graph/v3/databases/{database}/aliases/{alias}
LocationParameterRequiredDescription
HeaderAuthorizationOptionalAuthentication key (reserved for future use)
PathdatabaseRequiredDatabase name
PathaliasRequiredAlias name
BodyactiveOptionalWhether the alias is active
BodytableOptionalTarget table name
BodycommentOptionalAlias description

AliasUpdateRequest - Alias update payload

AliasDescriptor - Updated alias information

Terminal window
curl -X PUT \
"http://ab.example.com/graph/v3/databases/mydb/aliases/friends" \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"active": false,
"comment": "Deactivated alias"
}'

Delete an existing alias.

DELETE /graph/v3/databases/{database}/aliases/{alias}
LocationParameterRequiredDescription
HeaderAuthorizationOptionalAuthentication key (reserved for future use)
PathdatabaseRequiredDatabase name
PathaliasRequiredAlias name

204 No Content (no response body)

Terminal window
curl -X DELETE \
"http://ab.example.com/graph/v3/databases/mydb/aliases/friends" \
-H "Authorization: YOUR_API_KEY"

Database information payload.

data class DatabaseDescriptor(
val tenant: String, // Tenant name
val database: String, // Database name
val active: Boolean, // Whether the database is active
val comment: String, // Database description
val revision: Long, // Revision number
val createdAt: Long, // Creation timestamp
val createdBy: String, // Creator
val updatedAt: Long, // Last update timestamp
val updatedBy: String, // Last updater
)

Table information payload. Two types are supported: edge and multiEdge.

data class TableDescriptor.Edge(
val type: String = "edge", // Table type discriminator
val tenant: String, // Tenant name
val database: String, // Database name
val table: String, // Table name
val schema: ModelSchema.Edge, // Edge schema definition
val storage: String, // Storage URI (`datastore://<namespace>/<table>`)
val mode: MutationMode, // Mutation mode (SYNC, ASYNC, DROP)
val active: Boolean, // Whether the table is active
val comment: String, // Table description
val revision: Long, // Revision number
val createdAt: Long, // Creation timestamp
val createdBy: String, // Creator
val updatedAt: Long, // Last update timestamp
val updatedBy: String, // Last updater
)
data class TableDescriptor.MultiEdge(
val type: String = "multiEdge", // Table type discriminator
val tenant: String, // Tenant name
val database: String, // Database name
val table: String, // Table name
val schema: ModelSchema.MultiEdge, // MultiEdge schema definition
val storage: String, // Storage URI (`datastore://<namespace>/<table>`)
val mode: MutationMode, // Mutation mode (SYNC, ASYNC, DROP)
val active: Boolean, // Whether the table is active
val comment: String, // Table description
val revision: Long, // Revision number
val createdAt: Long, // Creation timestamp
val createdBy: String, // Creator
val updatedAt: Long, // Last update timestamp
val updatedBy: String, // Last updater
)

Alias information payload.

data class AliasDescriptor(
val tenant: String, // Tenant name
val database: String, // Database name
val alias: String, // Alias name
val table: String, // Target table name
val active: Boolean, // Whether the alias is active
val comment: String, // Alias description
val revision: Long, // Revision number
val createdAt: Long, // Creation timestamp
val createdBy: String, // Creator
val updatedAt: Long, // Last update timestamp
val updatedBy: String, // Last updater
)

Edge schema definition. The type discriminator is "EDGE" in requests and "edge" in responses.

data class ModelSchema.Edge(
val type: String, // "EDGE" (request) / "edge" (response)
val source: Field, // Source vertex field
val target: Field, // Target vertex field
val properties: List<StructField> = emptyList(),// Edge properties
val direction: DirectionType, // Direction type (OUT, IN, BOTH)
val indexes: List<Index> = emptyList(), // Index definitions
val groups: List<Group> = emptyList(), // Group definitions
)

MultiEdge schema definition. Supports multiple edges between the same source-target pair, distinguished by an id field. The type discriminator is "MULTI_EDGE" in requests and "multiEdge" in responses.

data class ModelSchema.MultiEdge(
val type: String, // "MULTI_EDGE" (request) / "multiEdge" (response)
val id: Field, // Edge identifier field (distinguishes multiple edges)
val source: Field, // Source vertex field
val target: Field, // Target vertex field
val properties: List<StructField> = emptyList(),// Edge properties
val direction: DirectionType, // Direction type (OUT, IN, BOTH)
val indexes: List<Index> = emptyList(), // Index definitions
val groups: List<Group> = emptyList(), // Group definitions
)

Vertex field definition. The type value is lowercase in JSON (e.g., "string", "long").

data class Field(
val type: PrimitiveType, // Data type (JSON: lowercase, e.g., "string", "long")
val comment: String, // Field description
)

Property field definition. The type value is lowercase in JSON (e.g., "int", "long").

data class StructField(
val name: String, // Field name
val type: PrimitiveType, // Data type (JSON: lowercase, e.g., "int", "long")
val comment: String, // Field description
val nullable: Boolean, // Whether the field is nullable
)

Index definition.

data class Index(
val index: String, // Index name
val fields: List<IndexField>, // Indexed fields with sort order
val comment: String = "", // Index description
)

Index field definition.

data class IndexField(
val field: String, // Field name
val order: Order, // Sort order (ASC, DESC)
)

Group definition for aggregation queries.

data class Group(
val group: String, // Group name
val type: GroupType, // Aggregation type (SUM, COUNT)
val fields: List<GroupField>, // Group key fields
val valueField: String = "-", // Value field name
val comment: String = "", // Group description
val directionType: DirectionType = BOTH, // Direction type
val ttl: Long = -1, // Time-to-live in milliseconds (-1 = no expiry)
)

Database creation request payload.

data class DatabaseCreateRequest(
val database: String, // Database name
val comment: String, // Database description
)

Database update request payload.

data class DatabaseUpdateRequest(
val active: Boolean?, // Whether the database is active (optional)
val comment: String?, // Database description (optional)
)

Table creation request payload.

data class TableCreateRequest(
val table: String, // Table name
val schema: ModelSchema, // Schema definition (ModelSchema.Edge or ModelSchema.MultiEdge)
val storage: String, // Storage URI (`datastore://<namespace>/<table>`)
val mode: MutationMode, // Mutation mode (default: SYNC)
val comment: String, // Table description
)

Table update request payload.

data class TableUpdateRequest(
val active: Boolean?, // Whether the table is active (optional)
val schema: ModelSchema?, // Schema definition (optional, ModelSchema.Edge or ModelSchema.MultiEdge)
val mode: MutationMode?, // Mutation mode (optional)
val comment: String?, // Table description (optional)
)

Alias creation request payload.

data class AliasCreateRequest(
val alias: String, // Alias name
val table: String, // Target table name (same database only)
val comment: String, // Alias description
)

Alias update request payload.

data class AliasUpdateRequest(
val active: Boolean?, // Whether the alias is active (optional)
val table: String?, // Target table name (optional)
val comment: String?, // Alias description (optional)
)
enum class MutationMode { SYNC, ASYNC, DROP, DENY }
enum class DirectionType { BOTH, OUT, IN }
enum class PrimitiveType { BOOLEAN, BYTE, SHORT, INT, LONG, FLOAT, DOUBLE, STRING, OBJECT }
enum class Order { ASC, DESC }
enum class GroupType { SUM, COUNT }
FieldRule
Database / Table / Alias name^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ — starts with a letter, max 64 chars
Storage URI^datastore://[a-z_]+/[a-zA-Z0-9_]+$
CommentMax 1000 characters

V3 API wraps the existing V2 DDL services with a new interface. The table below shows the mapping between V2 and V3 terminology.

V2 TermV3 TermDescription
ServiceDatabaseLogical database
LabelTableTable with edge schema
AliasAliasTable alias (unchanged)
V2 LabelTypeV3 Table TypeConversion
INDEXEDedgeBidirectional
MULTI_EDGEmultiEdgeBidirectional
HASHedgeOne-way (V2 to V3 only, deprecated)
V2 EndpointV3 Endpoint
GET /graph/v2/servicesGET /graph/v3/databases
GET /graph/v2/services/{service}GET /graph/v3/databases/{database}
POST /graph/v2/services/{service}POST /graph/v3/databases
PUT /graph/v2/services/{service}PUT /graph/v3/databases/{database}
DELETE /graph/v2/services/{service}DELETE /graph/v3/databases/{database}
GET /graph/v2/services/{service}/labelsGET /graph/v3/databases/{database}/tables
GET /graph/v2/services/{service}/labels/{label}GET /graph/v3/databases/{database}/tables/{table}
POST /graph/v2/services/{service}/labels/{label}POST /graph/v3/databases/{database}/tables
PUT /graph/v2/services/{service}/labels/{label}PUT /graph/v3/databases/{database}/tables/{table}
DELETE /graph/v2/services/{service}/labels/{label}DELETE /graph/v3/databases/{database}/tables/{table}
GET /graph/v2/services/{service}/aliasesGET /graph/v3/databases/{database}/aliases
GET /graph/v2/services/{service}/aliases/{alias}GET /graph/v3/databases/{database}/aliases/{alias}
POST /graph/v2/services/{service}/aliases/{alias}POST /graph/v3/databases/{database}/aliases
PUT /graph/v2/services/{service}/aliases/{alias}PUT /graph/v3/databases/{database}/aliases/{alias}
DELETE /graph/v2/services/{service}/aliases/{alias}DELETE /graph/v3/databases/{database}/aliases/{alias}
V2 ModeV3 ModeDescription
SYNCSYNCSynchronous mutation
ASYNCASYNCAsynchronous mutation
IGNOREDROPDrop mutations silently
-DENYDeny mutations (V3 only, throws error)

V3 aliases can only reference tables within the same database. Cross-database aliases (supported in V2 via database.table format) are not available in V3.