|
1 | 1 | # kotlin-wot: A Framework for implementing Web of Things in Kotlin |
2 | 2 |
|
3 | | -**kotlin-wot** is a framework designed to enable developers to implement [**Web of Things (WoT)**](https://www.w3.org/WoT/) servers and clients in Kotlin. Built from the ground up with Kotlin and leveraging modern coroutine-based architecture, it aims to provide a **fast, reliable, and extensible framework for AI or IoT applications**. By abstracting low-level details and protocols through the use of [**Thing Descriptions (TDs)**](https://www.w3.org/TR/wot-thing-description11/), kotlin-wot empowers developers to focus on creating business logic. |
4 | | -Thing Descriptions provide an excellent alternative to OpenAPI or AsyncAPI. Unlike these formats, Thing Descriptions are protocol-agnostic and utilize forms to remain independent of specific transport protocols, enabling greater flexibility and interoperability across diverse ecosystems. |
| 3 | +**kotlin-wot** is a framework designed to enable developers to implement [**Web of Things (WoT)**](https://www.w3.org/WoT/documentation/) servers and clients in Kotlin. Built from the ground up with Kotlin and leveraging modern coroutine-based architecture, it aims to provide a **fast, reliable, and extensible framework for AI or IoT applications**. By abstracting low-level details and protocols through the use of [**Thing Descriptions (TDs)**](https://www.w3.org/TR/wot-thing-description11/), kotlin-wot empowers developers to focus on creating business logic. |
5 | 4 |
|
| 5 | +WoT also provides a flexible, and standardized architecture for server-to-server communication, addressing the challenges of interoperability and protocol diversity. WoT is not only suitable for IoT applications. |
| 6 | +Thing Descriptions provide an excellent alternative to OpenAPI or AsyncAPI. Unlike these formats, Thing Descriptions are protocol-agnostic and utilize forms to remain independent of specific transport protocols, enabling greater flexibility and interoperability across diverse platforms. |
| 7 | + |
| 8 | +<img src="https://github.com/user-attachments/assets/5a1a4fc4-0cca-4290-b4b7-96309f723b0c" width="60%"> |
| 9 | + |
| 10 | +<br><br> |
6 | 11 | The implementation was inspired by the awesome [Eclipse Thingweb](https://thingweb.io/) and [node-wot](https://github.com/eclipse-thingweb/node-wot). There are also open-source implementations available for TypeScript, Dart, Rust and Python. |
7 | 12 |
|
8 | 13 | NOTE: The library is still under development |
9 | 14 |
|
10 | 15 | ## Web of Things Principles in a Nutshell |
11 | 16 |
|
12 | | -The [**Web of Things (WoT)**](https://www.w3.org/WoT/) architecture bridges the gap between diverse technologies in AI, IoT, and traditional IT systems by leveraging and extending standardized web technologies. It introduces a unifying layer of abstraction that encapsulates agents, devices, services, and protocols, simplifying their integration and interaction. At its core, WoT employs the Thing Description (TD), a metadata-rich JSON-LD document that describes a Things's properties, actions, and events, along with protocol-specific details (forms) for seamless interaction. |
| 17 | +[**Web of Things (WoT)**](https://www.w3.org/WoT/) is a W3C standard designed to simplify the integration and interaction of things (e.g. AI agents, devices, services) in a highly interoperable and extensible manner. At its core lies the [**Thing Description (TD)**](https://www.w3.org/TR/wot-thing-description11/), a metadata-rich, machine-readable document based on JSON-LD that describes a Thing's properties (state variables), actions (invocable functions), and events (notifications). The TD also incorporates protocol-specific details via forms, allowing seamless interaction across diverse communication technologies. |
| 18 | + |
| 19 | +WoT provides a protocol-agnostic architecture that supports an array of standards such as HTTP, WebSockets, MQTT, CoAP, and more, using protocol bindings to decouple application logic from transport-layer specifics. By leveraging widely adopted web standards like JSON, JSON Schema, and Linked Data, WoT ensures data and metadata are both interoperable and semantically rich, enabling intelligent systems to discover, understand, and communicate with Things efficiently. |
| 20 | +Designed for flexibility, WoT is applicable across a broad spectrum of domains, including AI-driven multi-agent systems, smart homes, and industrial IoT ecosystems. |
| 21 | + |
13 | 22 |
|
14 | | -WoT supports a wide array of communication standards (e.g., HTTP, WebSocketd, MQTT, CoAP) via protocol bindings. By aligning with existing web standards, such as JSON, JSON Schema and Linked Data, WoT enables developers to create interoperable AI/IoT applications. WoT’s adaptable framework is designed to address diverse use cases—from AI agent systems, smart homes to industrial IoT — ensuring that the architecture works across domains. |
| 23 | +## Thing Description (TD) |
15 | 24 |
|
16 | | -At its core, the WoT defines an **information model** for describing Things and Services, including how to interact with them. This model is encapsulated in the **Thing Description (TD)**, a JSON-LD document that outlines the following: |
| 25 | +WoT defines an **information model** for describing Things and Services, including how to interact with them. This model is encapsulated in the **Thing Description (TD)**, a JSON-LD document that outlines the following: |
17 | 26 |
|
18 | 27 | - Metadata about the Thing |
19 | 28 | - The Thing’s **capabilities** (properties, actions, and events) |
20 | 29 | - Its network services (APIs) |
21 | 30 | - Security definitions |
22 | 31 | - Web links to related Things or resources |
23 | 32 |
|
24 | | -## Thing Description (TD) |
25 | | - |
26 | | -The [**Thing Description (TD)**](https://www.w3.org/TR/wot-thing-description11/) is a standardized metadata format used to describe a Thing’s structure and interactions. Each TD is a machine-readable document that defines how to communicate with a Thing. kotlin-wot uses the TD abstraction to support developers in creating applications quickly and transport protocol-agnostic. |
27 | | - |
28 | 33 | ## Thing Capabilities (Affordances) |
29 | 34 |
|
30 | 35 | Every Thing in kotlin-wot is modeled with the following capabilities, known as **affordances**: |
|
0 commit comments