
Ontology SDK (OSDK)(本体软件开发工具包(Ontology SDK, OSDK))¶
The Ontology Software Development Kit (OSDK) allows you to access the full power of the Ontology directly from your development environment. The OSDK supports NPM (Node Package Manager) for TypeScript, Pip or Conda for Python, Maven for Java, and OpenAPI spec for any other language.
By treating Foundry as your backend, you can leverage the Ontology's robust ability to perform high-scale queries and Foundry writeback alongside granular governance controls to accelerate the process of securely developing applications that can power your organization.
:::callout{theme="note"} To create and manage OSDK applications, use Developer Console. This section covers SDK-specific reference documentation. :::

OSDK benefits¶
The OSDK was built to provide several primary benefits:
- Accelerated development: With the OSDK, you can quickly start developing applications backed by the Foundry Ontology. By enabling ergonomic access to Ontology APIs, the OSDK allows you to read and write back to the Ontology with minimal code.
- Strong type-safety: The functions and types generated for the OSDK are based on just the subset of the Ontology relevant to you. Types and functions are generated from your Ontology, allowing you to query and explore your Ontology directly in your editor.
- Centralized maintenance: As the Ontology is built and managed centrally in Foundry, you can focus on application building and decrease the typical maintenance burden required to build a data foundation.
- Secure by design: The OSDK uses a token that is scoped only to the ontological entities you want your application to access, in addition to the user's own permissions to the data.
Additionally, TypeScript bindings for frontend development provide a convenient way for developers to quickly build React applications on top of Foundry.

The generated code uses metadata about your Ontology, including property names and descriptions. You can view this metadata directly in your editor.
Getting started¶
To build an application with the OSDK:
- Create a new application in Developer Console
- Bootstrap your application using one of the language-specific guides:
- TypeScript
- Python
- Java
- Optionally, host your application on Foundry
SDK references¶
This section contains language-specific API reference documentation:
- Java OSDK
- Python OSDK
- TypeScript OSDK
- TypeScript OSDK migration guide
- Python OSDK migration guide
- Generate OSDK for other languages
Related documentation¶
- Developer Console overview: Create and manage OSDK applications
- OSDK React applications: Build React applications with OSDK
- Development environment: Set up your development workflow
中文翻译¶

本体软件开发工具包(Ontology SDK, OSDK)¶
本体软件开发工具包(Ontology Software Development Kit,OSDK)允许你直接在开发环境中使用本体(Ontology)的全部能力。OSDK支持TypeScript生态的NPM(Node Package Manager)、Python生态的Pip或Conda、Java生态的Maven,其他语言可通过OpenAPI规范接入。
将Foundry作为后端使用时,你可以利用本体强大的大规模查询能力、Foundry回写能力,以及细粒度的管控机制,加速安全应用的开发流程,为组织的业务运转提供支撑。
:::callout{theme="note"} 如需创建和管理OSDK应用,请使用开发者控制台(Developer Console)。本章节仅介绍SDK专属的参考文档。 :::

OSDK优势¶
OSDK的核心设计优势如下: * 开发效率更高: 借助OSDK,你可以快速开发基于Foundry本体的应用。它提供了便捷易用的本体API访问方式,仅需少量代码即可实现对本体的读写操作。 * 强类型安全(Type Safety): 为OSDK生成的函数和类型仅基于你需要用到的本体子集,这些类型和函数都基于你的本体生成,你可以直接在编辑器中查询和探索本体内容。 * 集中化维护: 由于本体在Foundry中集中构建和管理,你可以专注于应用开发,减少搭建数据底座所需的常规运维负担。 * 原生安全设计: 除了用户自身的数据权限外,OSDK使用的令牌权限作用域仅覆盖应用需要访问的本体实体,进一步保障数据安全。
此外,面向前端开发的TypeScript绑定还为开发者提供了便捷途径,可快速在Foundry之上搭建React应用。

生成的代码会调用本体的元数据(包括属性名和描述),你可以直接在编辑器中查看这些元数据。
入门指南¶
如需使用OSDK构建应用,请按照以下步骤操作: 1. 在开发者控制台中创建新应用 2. 参考对应语言的指南初始化应用脚手架: * TypeScript * Python * Java 3. (可选)将应用托管到Foundry上
SDK参考文档¶
本章节包含各语言对应的API参考文档: * Java OSDK * Python OSDK * TypeScript OSDK * TypeScript OSDK迁移指南 * Python OSDK迁移指南 * 为其他语言生成OSDK
相关文档¶
- 开发者控制台总览:用于创建和管理OSDK应用
- OSDK React应用:使用OSDK构建React应用
- 开发环境配置:配置你的开发工作流