Ontologies API
The Ontologies API builds knowledge graphs by defining Entities and Relations.
1. Entities
Create Entity
Defines an entity type.
Request
POST /ontologies/entities/
Body Schema (Entity)
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Entity name (e.g., Customer) |
schema | object | No | Data schema |
attributes | object | No | Additional attribute definitions |
Execute Entity Sink
Executes a job to sink entity data to the graph database (Neo4j).
Request
POST /ontologies/entities/{entity_id}/sink/execute
This API triggers a background job (Prefect Deployment).
2. Relations
Create Relation
Defines a relationship between two entities.
Request
POST /ontologies/relations/
Body Schema (Relation)
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Relation name (e.g., PURCHASED) |
source | string | Yes | Source entity ID |
target | string | Yes | Target entity ID |
Execute Relation Sink
Sinks relation data to the graph database.
Request
POST /ontologies/relations/{relation_id}/sink/execute
3. Sinks Management
Each entity and relation has a Sink configuration for data loading.
- Create Sink:
POST /ontologies/entities/{id}/sink - Get Sink:
GET /ontologies/entities/{id}/sink - Update Sink:
PUT /ontologies/entities/{id}/sink
Sink Body Schema
| Field | Type | Description |
|---|---|---|
dataset | string | Source dataset ID |
links | map | Column mapping information |
options | object | Loading options (scheduling, etc.) |