Database endpoints
Train Node2Vec embeddings
Train node embeddings from graph walks, and optionally save them for similarity search.
POST /v1/tenants/{tenant}/graph/{schema}/node2vec
- Select the relationChoose walk and training settings.
- Learn from graph walksTrain a numeric representation for each visited node.
- Check the persisted flagConfirm saved embeddings before querying them.
Before you start
Use your database bearer token.
Populate the schema's relations before training. Saving embeddings requires schema DDL permission; a tiny example graph demonstrates the request, not model quality.
Path parameters
| Field | Type | Required |
|---|---|---|
tenant | string | Required |
schema | string | Required |
Headers
| Field | Type | Required | Description |
|---|---|---|---|
x-oc-db-user | string | Optional | Acting database user (role, grant and row-policy checks). Send with x-oc-db-key. |
x-oc-db-key | string | Optional | API key of the x-oc-db-user user. |
Request body
application/json
Limits and accepted values
- Defaults: walks_per_node 10, walk_length 80 (their product is capped at 10,000,000), window_size 5, negative_samples 5, dim 128 (max 1024), epochs 5, initial_lr 0.025, min_lr 0.0001 (must not exceed initial_lr), p 1.0, q 1.0, seed 0, persist false.
- persist=true also requires the schema DDL privilege.
- Graphs above 100,000 nodes are refused.
| Field | Type | Required |
|---|---|---|
dim | integer | Optional |
epochs | integer | Optional |
initial_lr | number | Optional |
min_lr | number | Optional |
negative_samples | integer | Optional |
p | number | Optional |
persist | boolean | Optional |
q | number | Optional |
rel | string | Required |
seed | integer | Optional |
walk_length | integer | Optional |
walks_per_node | integer | Optional |
window_size | integer | Optional |
Read the result
embeddings maps nodes to learned vectors. With persist: true, check persisted before using the Node2Vec similarity endpoint. Training statistics do not establish application-level result quality.
Response statuses
HTTP status reference
| Status | What to do |
|---|---|
| 200 | OK |
| 400 | Correct the request before retrying. |
| 401 | Check the credential and Authorization header. |
| 402 | Check feature access or available credits. |
| 403 | Check tenant access, roles and permissions. |
| 404 | Check the resource ID and API route. |
| 409 | Resolve the conflict before retrying. |
| 413 | Split or reduce the request body. |
| 415 | Send the required Content-Type. |
| 422 | Correct the values or unsupported combination. |
| 429 | Honor Retry-After when present; back off. |
| 500 | Check the outcome before retrying a write. |
| 503 | Honor Retry-After when present; check write outcomes. |