Ontologies API
온톨로지는 엔티티(Entity)와 관계(Relation)를 정의하여 지식 그래프를 구축하는 API입니다.
1. Entities
Create Entity
엔티티 유형을 정의합니다.
Request
POST /ontologies/entities/
Body Schema (Entity)
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | 엔티티 이름 (예: Customer) |
schema | object | No | 데이터 스키마 |
attributes | object | No | 추가 속성 정의 |
Execute Entity Sink
엔티티 데이터를 그래프 데이터베이스(Neo4j)로 적재(Sink)하는 작업을 실행합니다.
Request
POST /ontologies/entities/{entity_id}/sink/execute
이 API는 백그라운드 작업(Prefect Deployment)을 트리거합니다.
2. Relations
Create Relation
두 엔티티 간의 관계를 정의합니다.
Request
POST /ontologies/relations/
Body Schema (Relation)
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | 관계 이름 (예: PURCHASED) |
source | string | Yes | 소스 엔티티 ID |
target | string | Yes | 타겟 엔티티 ID |
Execute Relation Sink
관계 데이터를 그래프 데이터베이스로 적재합니다.
Request
POST /ontologies/relations/{relation_id}/sink/execute
3. Sinks Management
각 엔티티와 관계는 데이터 적재를 위한 Sink 설정을 가집니다.
- 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 | 소스 데이터셋 ID |
links | map | 컬럼 매핑 정보 |
options | object | 적재 옵션 (스케줄링 등) |