> For the complete documentation index, see [llms.txt](https://docs.unitlab.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unitlab.ai/api-sdk-cli/ko/apis/ontologies-api.md).

# 온톨로지 API

Unitlab Ontologies API로 HTTP 요청을 보내 워크스페이스 온톨로지를 목록 조회, 조회, 생성하고 구조(structure)를 교체하는 방법입니다.

| 메서드와 라우트                        | 하는 일                     | 권한                |
| ------------------------------- | ------------------------ | ----------------- |
| `GET /api/sdk/ontologies/`      | 온톨로지 목록(페이지)             | View ontology     |
| `POST /api/sdk/ontologies/`     | 온톨로지 생성                  | Manage ontologies |
| `GET /api/sdk/ontologies/{id}/` | 온톨로지 조회                  | View ontology     |
| `PUT /api/sdk/ontologies/{id}/` | 제목, 설명, 구조를 교체하고 리비전을 기록 | Manage ontologies |

목록 필터: `title_eq`, `title_like`, `desc_eq`, `desc_like`, `created_before`, `created_after`, `edited_before`, `edited_after`(ISO 8601).

```bash
curl -s -X POST https://api.unitlab.ai/api/sdk/ontologies/ \
  -H "Authorization: Api-Key $UNITLAB_API_KEY" -H "Content-Type: application/json" \
  -d @ontology.json
```

```json
{
  "title": "Robot cell QA",
  "description": "Grippers and parts",
  "data_type": "image",
  "structure": {"objects": [], "classifications": [], "skeleton_templates": []}
}
```

응답의 `ontology_hash`가 온톨로지 ID이며, 프로젝트를 만들 때 전달합니다. `structure`는 SDK의 `OntologyStructure`와 `to_dict()`로 만들거나 기존 온톨로지에서 복사합니다. [Python으로 온톨로지 구성](https://docs.unitlab.ai/api-sdk-cli/ko/sdks/build-ontologies-in-python.md)을 참고하세요.

## 관련 문서 <a href="#related" id="related"></a>

[SDK: 온톨로지 리소스](https://docs.unitlab.ai/api-sdk-cli/ko/sdks/ontology-resources.md) · [Projects API (프로젝트 API)](https://docs.unitlab.ai/api-sdk-cli/ko/apis/projects-api.md)
