About Twines (Schema)¶
The core of twined is to provide and use schemas for digital twins.
Below, we set out requirements and a framework for creating a schema to represent a digital twin. We call these schema “twines”. To just get started building a twine, check out the Quick Start.
Requirements of digital twin schema¶
A schema defines a digital twin, and has multiple roles. It:
- Defines what data is required by a digital twin, in order to run
- Defines what data will be returned by the twin following a successful run
- Defines the formats of these data, in such a way that incoming data can be validated
If this weren’t enough, the schema:
- Must be trustable (i.e. a schema from an untrusted, corrupt or malicious third party should be safe to at least read)
- Must be machine-readable and machine-understandable 
- Must be human-readable and human-understandable 
- Must be searchable/indexable
Fortunately for digital twin developers, many of these requirements have already been seen for data interchange formats
developed for the web. twined uses
JSONSchema to interchange data between digital twins.
If you’re not already familiar with
JSONSchema (or wish to know why twined uses
JSON over the seemingly more
XML standard), see Introducing JSON Schema.
We cannot simply expect many developers to create digital twins with some schema, then to be able to connect them all together - even if those schema are all fully valid (readable). twined makes things slightly more specific.
twined has an opinionated view on how incoming data is organised. This results in a top-level schema that is extremely prescriptive (understandable), allowing digital twins to be introspected and connected.
Let us review the classes of data i/o undertaken a digital twin:
Here, we describe how each of these data classes is described by twined.
What’s the difference between Configuration and Values data? Isn’t it the same?
No. Configuration data is supplied to a twin to initialise it, and always has defaults. Values data is ingested by a twin, maybe at startup but maybe also later (if the twin is working like a live server). In complex cases, which Values are required may also depend on the Configuration of the twin!
Values data can also be returned from a twin whereas configuration data is not.
Don’t get hung up on this yet - in simple (most) cases, they are effectively the same. For a twin which is run as a straightforward analysis, both the Configuration and Values are processed at startup.
|||(1, 2) Understandable essentially means that, once read, the machine or human knows what it actually means and what to do with it.|