-
Notifications
You must be signed in to change notification settings - Fork 4
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
syntax clarifications on odmThing, required tag #72
Comments
Maybe we need to think about it more but I assumed it would be like this:
|
the required tag definition is an array of objects, instead of just doing a label. not sure about the redefinition of the tag names under odmObject. I rather have this simplified (which is currently validating with the schema) as indicated above. full definition of the thing can be (without the external reference definition): "odmThing": {
], } |
The tag names under "odmObject" are new definitions in the local scope. For reusing the already-defined definition names using references, we need a new term other than "include" because "include" refers to a pre-existing instance. In addition, when we want to re-use a definition we should be able to set additional qualities and maybe even over-ride some of the defined qualities. I propose a new keyword "define" with a value consisting of an array, just like "include", but define creates new definitions (hence the word "define") using the existing definition. So here is the washer example using "define".
We can allow "define" to modify or extend the referenced definition, for example to add a "semantic-tag" quality that differentiates one instance from another of the same type. For example: "odmThing": {
"oic.d.thermostat": {
"define": [
{
"$ref": "odm:/library/odmObject/oic.r.temperature",
"minimum": -22,
"maximum": 40,
"semantic-tag": "FreezerMeasuredTemperature"
},
{
"$ref": "odm:/library/odmObject/oic.r.temperature" ,
"minimum": -22,
"maximum": 40,
"semantic-tag": "FreezerSetpointTemperature"
},
{
"$ref": "odm:/library/odmObject/oic.r.mode",
"odmType": { "$ref": "odm:/library/enumTypes/freezerModes" },
"semantic-tag": "FreezerMode"
}
] |
looks a bit strange to point to the actual definition again from required point of view.
note that the scheme can work if we do something like
adding more things to the definition like overuling min/max is nice.. but that should be then listed somewhere to which standard properties/tag names can be overruled in this way. |
F2F4: Change "include" to "odmInclude". Add "odmRequired" at odmThing layer. Add note that odmRequired must be equal to or a subset of odmInclude. "odmRequired" applies to all definition lists. |
how can we specify which odmObjects are required when the the list of includes only includes references?
e.g. this validates against the schema
"odmThing": {
"oic.d.washer" : {
"id" : 1,
"name" : "oic.d.washer",
"title" : "washing machine",
"include" : [
{"$ref": "#/odmObject/oic.r.switch.binary"},
{"$ref": "#/odmObject/oic.r.operational.state"}
]
}
}
{
"info": {
"title": "OCF washer",
"version": "20190530",
"copyright": "Copyright 2019 Open Connectivity Foundation, Inc. All rights reserved.",
"license": "https://github.com/openconnectivityfoundation/core/blob/master/LICENSE-3C.md"
},
for example making sure that the switch binary is the only required odmObject we can do the following:
"odmThing": {
"oid.d.washer" : {
"id" : 1,
"name" : "oic.d.washer",
"title" : "washing machine",
"include" : [
}
}
however this solution is now position dependend, e.g. swapping the contents in the array around will give different results
note this validates
The text was updated successfully, but these errors were encountered: