-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ThingModel] Example of Eclipse Vorto model #1000
Comments
@kolotu map this model to ThingDescription |
This is the output of the tentative Vortolang -> WoT TM converter. Not all features are implemented yet, this is just to outline, how it will work. I used the Functionblock of the generic Washer for this example: https://vorto.eclipse.org/#/details/com.bshg.programs:Washer:2.0.0
|
{
"@context": ["https://www.w3.org/2019/wot/td/v1",
{"vorto":"https://bshg.com/vorto#"}
],
"@type" : "ThingModel",
"title": "Washer 2.0",
"id" : "com.bshg.programs.Washer:2.0.0",
"description" : "Function block model for Washer functionality of Home Appliances",
"properties": {
"program": {
"type" : "string",
"vorto:type" : "com.bshg.types.programs.washer.options.Program:2.0.0",
"readOnly": true
},
"temperature": {
"type": "string",
"vor:type" : "com.bshg.types.programs.washer.options.Temperature:2.0.0",
"readOnly": true
},
"spinSpeed": {
"type": "string",
"vorto:type": "com.bshg.types.programs.washer.options.SpinSpeed:2.0.0",
"readOnly": true
},
"delayedStart": {
"type": "int",
"readOnly": true
},
"delayedStartUnit": {
"type": "string",
"readOnly": true
}
},
"events": {
"SelectedProgramChanges": {
"data": {"type": "string"}
},
"ActiveProgramChanged": {
"data": {"type": "string"}
},
"TemperatureChanged": {
"data": {"type": "string"}
},
"SpinSpeedChanged": {
"data": {"type": "string"}
},
"RemainingProgramTimeChanged": {
"data": {"type": "string"}
},
"ProgramProgress": {
"data": {"type": "string"}
},
"ProgramFinished": {
"data": {"type": "string"}
}
},
"actions": {
"startWashing": {
}
}
} |
However, from what I have understood, the types are not necessarily just string but are more complex, thus they need to be modelled in JSON Schema in order to represent them for other TD Consumers. |
In that case the properties are string values with a sections as enum as shown here https://vorto.eclipse.org/#/details/com.bshg.types.programs.washer.options:Program:2.0.0 Providing JSON Schema would be alternative. |
This was just an input right? Not really an issue. I would propose closing it |
Here is an example of an Eclipse Vorto model that is being used in a real-life application. The device / digital twin that is modelled represents a washer. The model consists of an InformationModel that describes the specific type of the Washer (Bosch WAT286H8SG).
This InformationModel contains the FunctionBlocks that describe the capabilities of this specific washer. One of those FunctionBlocks is a generic Washer FunctionBlock that describes capabilities of washers in general.
In general, InformationModels describe specific types of devices / digital twins, while FunctionBlocks are reusable descriptions of capabilities. FunctionBlocks can be used by multiple InformationModels and FunctionBlocks can be extended by other FunctionBlocks to create greater specificity. A FunctionBlock can only extend one other FunctionBlock (no multi-inheritance). When a new FunctionBlock is created that extends an existing FunctionBlock it is not allowed to override any existing property, so naming conflicts cannot occur.
The inheritance feature of Vortolang is very rarely used - and if so mostly for trivial use-cases, that's why the Vorto specification does not cover every edge-case that can occur when using inheritance.
The text was updated successfully, but these errors were encountered: