Thing Schema
Things represent the entities in your world. They store information about real world objects like assets, rooms or buildings, as well as information about concepts like Tasks or processes.
Things are defined through JSON formatting, in a standard schema called Web of Things "Thing Descriptions". This standard schema allows you to be very prescriptive about what kind of information you expect to populate these Things, validate that the data matches what you expect, and even create user experiences that adjust based on the schema of the data.
- Properties
- Describe the Thing's attributes (e.g., sensor values, configuration parameters, status, results of an analysis)
- Actions
- Determine how you can interact with your Thing (e.g., change a property, turn on/off)
- Events
- Monitor the changes that can modify a Thing’s property (e.g., fire alarm, door open, data streams)
Our Thing schema provides a standard schema definition for the Things in your world, compliant with the Web of Things Thing Description and built on top of the popular "JSON Schema" definition.
It gives your application standard interfaces to communicate with Things in Category in the AnythingDB and provides a means for Things in your application to reference and communicate with entities outside of your application.
{ "@context": "https://www.w3.org/2019/wot/td/v1", "@type": "ThingTemplate", "actions": { "toggle": { "description": "Turn the lamp on or off", "input": {} } }, "categories": [], "created": "2023-05-30T08:26:01.976718108Z", "description": "Lamp Thing Description Template", "events": { "overheating": { "data": { "type": "string" }, "description": "Lamp reaches a critical temperature", "title": "" } }, "href": "/spaces/myspace/things/01H1NW77BRDFK9BX7BAKNWBX7N", "id":"https://api.swx.altairone.com/spaces/myspace/things/01H1NW77BRDFK9BX7BAKNWBX6N, "model": null, "modified": "2023-05-30T08:28:09.591925617Z", "properties": { "state": { "description": "current state of the lamp on|off", "readOnly": true, "title": "", "type": "string" } }, "title": "Lamp Thing Description Template", "uid": "01H1NW77BRDFK9BX7BAKNWBX7N" }
state
andvolume
properties for describing the current state of the Thingtoggle
action for adjusting the current state- An
overheating
event to tell users that something worth noting is happening
All this helps create user experiences in applications that fit the data. You can use the "unit" definitions to populate a label in an input field, you can use the "type" definitions to determine whether a toggle switch is needed or an input field, and you can use the "maximum" and "minimum" definitions to validate that the data received is within expected bounds.
Metadata Key | Description | Auto-generated? | Required? | Type |
---|---|---|---|---|
uid |
Unique identifier for this Thing | Yes | Yes | string |
href |
Relative reference point for this Thing | Yes | Yes | string |
category |
AnythingDB Category to which this Thing belongs. | Yes | Yes | string |
space |
Altair IoT Studio space to which this Thing belongs | Yes | Yes | string |
model |
Model from which this Thing was created. | Yes | Yes | object |