node-wot
node-wot copied to clipboard
feat(core): add semantic composed thing
Based on the work started in https://github.com/eclipse-thingweb/node-wot/tree/semantic-layer I would like to continue working on providing a SemanticComposedThing
as a wrapper around ConsumedThing
.
The idea is that consumers no longer need to know the property name
to get the data they want. Instead it should be possible to use @type
(e.g., read property with "@type": "iot:BinarySwitchData"
)
Some thoughts:
- node-wot could return SemanticComposedThing by default so that people already now can make use of this functionality
- this could be an extensions/input of the scripting API
Note: at the moment the PR is still in draft state since there are many open questions (see code) especially if we want to properly define input/output data. Comments are welcome!
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
143c8a0
) 76.52% compared to head (da9dee9
) 76.52%.
Additional details and impacted files
@@ Coverage Diff @@
## master #1174 +/- ##
=======================================
Coverage 76.52% 76.52%
=======================================
Files 80 80
Lines 16705 16705
Branches 1616 1616
=======================================
Hits 12784 12784
Misses 3891 3891
Partials 30 30
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Some early feedback without looking at the code. My gut feeling is that this should be an extension to node-wot. Sort of a richer framework that we can build on top of the raw API. I believe that node-wot should stay as close as possible to the Thing Description interaction model abstraction. Anyhow I think the extension is a great idea, but I'd like to see it as a standalone project that uses node-wot rather than another package inside this project.
Some early feedback without looking at the code. My gut feeling is that this should be an extension to node-wot. Sort of a richer framework that we can build on top of the raw API.
This is good feedback and my response to it is as follows. If we never "want" that to be standardized in the Scripting API I totally agree we should move out the extension. If we "think" this could make it into the spec I would got for it. Anyhow, for the time being I think I can develop it as part of node-wot and at latest when we plan to merge this PR we need to decide...
If we never "want" that to be standardized in the Scripting API
From some discussions in the TD/Binding TF at WoT WG, I remember others (@mjkoster if I am not wrong) having interest in this so it can indeed be standardized.