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

Discuss the modularization of WoT scripts #192

Open
vcharpenay opened this issue Sep 9, 2019 · 1 comment
Open

Discuss the modularization of WoT scripts #192

vcharpenay opened this issue Sep 9, 2019 · 1 comment
Labels
for next iteration Planned or postponed topics for the future priority: low Issues that might be deferred for later Runtime Runtime-related topics Script Management How to manage/control scripts use case Describes a scenario that may be useful for technical decisions

Comments

@vcharpenay
Copy link

Many WoT scripts on the client side are likely to be reusable across applications, in a similar fashion to Node-RED modules. For instance, control loop between sensors and actuators (temperature sensor vs. thermostat, brightness sensor vs. light switch, flow sensor vs. pump, etc.) could be implemented generically and instantiated for specific Things.

Standardizing a module mechanism for WoT would seem redundant with e.g. ES6 Modules. However, a way to annotate scripts with safety conditions may be an interesting feature. Safety conditions could be TD templates (e.g. expressed as JSON-LD frames), to constrain TDs to be consumed by the script. If consumed TDs do not match the template, an error could be thrown.

See also my position statement at the 2019 WoT workshop.

@zolkis zolkis added for next iteration Planned or postponed topics for the future Runtime Runtime-related topics Script Management How to manage/control scripts use case Describes a scenario that may be useful for technical decisions and removed for next iteration Planned or postponed topics for the future labels Sep 10, 2019
@danielpeintner
Copy link
Contributor

Safety conditions could be TD templates (e.g. expressed as JSON-LD frames), to constrain TDs to be consumed by the script. If consumed TDs do not match the template, an error could be thrown.

@vcharpenay I wonder whether the requirements of a script w.r.t. a given TD (or as you call them safety conditions) are meaningful on the scripting API level only.

I think the same requirements (e.g., having a TD or a thing with the actions turnOn and turnOff) are meaningful for pure binding-protocol solutions also. Even in the case of HTTP (without any scripting in place) it looks necessary to me that a given set of actions is available for the desired solution to work.

Note: I think the issue of finding the right interactions no matter whether an action is called on or turnOn is solved by semantic extensions already. The missing part to me is a simple way to check whether a TD in general fulfills are requirements.

Having said that, it seems we should bring the safety conditions to the TD task force as well. What do you think?

@relu91 relu91 added the priority: low Issues that might be deferred for later label Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for next iteration Planned or postponed topics for the future priority: low Issues that might be deferred for later Runtime Runtime-related topics Script Management How to manage/control scripts use case Describes a scenario that may be useful for technical decisions
Projects
None yet
Development

No branches or pull requests

4 participants