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

Usage of top-level affordances and sdfData #63

Closed
JKRhb opened this issue Feb 28, 2022 · 2 comments
Closed

Usage of top-level affordances and sdfData #63

JKRhb opened this issue Feb 28, 2022 · 2 comments
Assignees

Comments

@JKRhb
Copy link
Collaborator

JKRhb commented Feb 28, 2022

IMHO the purpose of top-level affordances (sdfProperty, sdfAction, and sdfEvent) as well as sdfData could be clarified a bit. In some conversion scenarios (for example SDF and YANG, CC @jkiesewalter), the top-level affordances can be used for mapping specific fields to SDF. In the case of YANG, there is an rpc field, for instance, that can be mapped to a top-level sdfAction. In other cases (like SDF and WoT TD), top-level affordance fields seem as if they should only be used for being referenced from within sdfObjects.

Maybe one or two sentences and an example could be added for clarification of how these top-level fields should be used?

(Sorry for the last minute issue but maybe this can be discussed at the interim meeting.)

@cabo cabo added the editorial label Mar 14, 2022
@cabo cabo self-assigned this Mar 30, 2022
@cabo cabo closed this as completed in 5efadd4 Jul 10, 2023
@cabo
Copy link
Member

cabo commented Jul 10, 2023

I tried to write some text, but wasn't so sure any more what you mean by "top-level".
Clearly the distinction between definitions in sdfData and those in affordances needs some text, and I tried to enhance the text in Subsection "sdfData" in PR #102.
Please reopen this issue if that wasn't enough.

@JKRhb
Copy link
Collaborator Author

JKRhb commented Jul 11, 2023

Thank you for the clarification for sdfData in #102 :) What I rather meant, though, was the usage of affordances at the model level (i.e. outside of an sdfObject or sdfThing), for example like this:

{
  "sdfAction": {
    "foo": {
      "label": "A foo action."
    }
  },
  "sdfObject": {
    "bar": {
      "sdfAction": {
        "baz": {
          "sdfRef": "#/sdfAction/foo"
        }
      }
    }
  }
}

If I see it correctly, there is currently no real description or guideline of how to use sdfProperty, sdfAction, and sdfEvent at the model level. Therefore, I think there is some ambiguity about how to treat them during a conversion process.

As mentioned above, the SDF-YANG-converter converts an sdfAction at the model level to an rpc. My SDF-WoT-Converter, however, discards affordances that are not part of an sdfObject or sdfThing and only considers them when they are being referenced. That means that if you convert a YANG model with an rpc to SDF and then to WoT, the rpc is lost at the moment.

Therefore, I think it should be clarified a bit whether affordances at the model level should be allowed to model something like YANG's RPCs or if this information should rather be moved to an sdfObject instead (although I guess this is already implied).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants