Skip to content
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

Supporting bitmaps #1930

Open
egekorkan opened this issue Nov 30, 2023 · 1 comment
Open

Supporting bitmaps #1930

egekorkan opened this issue Nov 30, 2023 · 1 comment
Labels
Defer to TD 2.0 Has Use Case Potential The use case can be extracted and explained Needs discussion more discussion is needed before getting to a solution

Comments

@egekorkan
Copy link
Contributor

There is a need to represent bitmaps, i.e. a list/array of bits, where each bit corresponds to a boolean value like alarm 1, alarm 2 or status like in-alarm (bit 0), fault (bit 1), overridden (bit 2), out-of-service (bit 3). This is very common in Modbus and BACnet and possibly other protocols.

The big question is how this looks in the data schema. This relates a lot to the recent discussions we had about uri variables in BACnet and HTTP (also slides from @lu-zero in TPAC23). My initial thought is that it should be an array or an object and then we map this to specific bits via forms.

Note: This is split from w3c/wot-binding-templates#101 and w3c/wot#119 (comment) . By splitting that binding template issue into multiple smaller ones, I will close that.

@egekorkan egekorkan added Needs discussion more discussion is needed before getting to a solution Defer to TD 2.0 labels Nov 30, 2023
@github-actions github-actions bot added the needs-triage Automatically added to new issues. TF should triage them with proper labels label Nov 30, 2023
@egekorkan egekorkan removed the needs-triage Automatically added to new issues. TF should triage them with proper labels label Nov 30, 2023
@lu-zero
Copy link
Contributor

lu-zero commented Nov 30, 2023

Extending the DataSchema to have a "type":"bitmap" that is logically an array of boolean would make easy to express that using plain jsonpointer, like this:

"properties": {
  "alarm": {
    "state": { "type": "boolean" },
    "forms": [
        {
          "op": "readproperty",
          "data": { 
            "type": "bitmap",
            "order":"msb",
            "bits":"16",
          }, 
          "map": { "thing": ["/properties/alarm/state"], "protocol": ["/data/0"] }

The assumptions

  • the PropertyAffordance has a state DataSchema.
  • the Form has a data DataSchema that represents the data, once deserialized from its contentType and contentCoding
  • the map needs to take jsonpointers that are applied on the thing from one side and jsonpointers that apply on the form on the other and populate one side or the other depending on the op. (it accounts for the need of populating href, data and any other vocabulary term we came up with additional side-channels)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defer to TD 2.0 Has Use Case Potential The use case can be extracted and explained Needs discussion more discussion is needed before getting to a solution
Projects
None yet
Development

No branches or pull requests

2 participants