-
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
Payload pattern binding #1217
Comments
I read the SenML spec and there are some instances where the TD can improve some parts and reduce the data transmitted. An SenML example [
{"bn":"urn:dev:ow:10e2073a01080063","u":"Cel","t":1.276020076e+09,
"v":23.5},
{"u":"Cel","t":1.276020091e+09,
"v":23.6}
] bn is the base name and can be omitted according to the spec "All base fields are optional. Regular fields can be included in any SenML. Record and apply only to that Record." When it comes to regular fields, the unit is included in the record and could also get removed. @relu91 had a good point. Additionally to the content-type, we could also add a value to I don't know what fits here the best when it comes to specification/document. |
We can use schemaDefinitons, define an object for the common terms. Then in each affordance, this schema is referenced and then extended with affordance specific terms. Other options of going towards new subprotocols raise interoperability concerns for me. |
|
From today's TD meeting: {
"@context": "https://www.w3.org/2019/wot/td/v1",
"title": "ediTDor Thing",
"id" : "urn:dev:ow:10e2073a01080063",
"securityDefinitions": {
"nosec_sc": {
"scheme": "nosec"
}
},
"security": "nosec_sc",
"properties": {
"temperature_indirect_SenML": {
"title": "temperature",
"unit": "Cel",
"type": "object",
"properties" : {
"t" : {"type": "number"},
"v" : {"type": "number"}
},
"forms": [
{
"href": "/",
"contentType": "application/senml+cbor"
}
]
},
"temperature_direct_SenML": {
"title": "temperature2",
"type": "object",
"properties" : {
"b" : {"type": "string", "const": "urn:dev:ow:10e2073a01080063"},
"u" : {"type": "string", "const": "Cel"},
"t" : {"type": "number"},
"v" : {"type": "number"}
}
}
}
} We decided to have some implementation experience during the next PlugFest and revisit this issue again. Maybe @mjkoster can share some TDs that uses SenML. |
It is a good use-case for a DataMapping that maps information outside the affordance data schema (the |
I know this is not a new issue, but I think it is a good time to address this challenge now:
In WoT we have a process to define bindings for protocols and data serialization. In the last TD call, we found that it would also be good to introduce a formal way in which we can define some kind of binding for payload patterns. This is useful if the payload messages constantly contain data elements in addition to the actual property, action, or event value. A simple example is, that a temperature property will have a temperature value and a timestamp. Other property definitions like humidity and wind speed will also always come with a timestamp. Of course, we could simple define this within the data schema each time, but this can be annoying when there is a couple more data elements than the timestamp.
How such a formal definition would look like when we would follow the payload pattern of SenML as example (@Citrullin, @JKRhb)? Would be this a kind of a new binding document, an official JSON Schema definition, or kind of a new specific WoT Profile? What do you think?
The text was updated successfully, but these errors were encountered: