Open stormtroober opened 2 years ago
Providing also an example of Thing Descriptions generated by Ditto. Here you can find:
May I ask you to provide a simple script "what" exactly is not working OR can you describe what you tried and didn't work.
Of course. These are the steps:
In fact, i know this can't work, because Ditto links Features Thing Descriptions via link, and for what i understood about node-wot
, it parses only a TD that has all the information in one file.
In most of the cases I get the following Error "error: TypeError: (destructured parameter) is undefined". I think this comes from uriVariables and/or basic security.
You are right, there are still features missing in node-wot. I would like to identify step by step "what" is missing. In the Ditto TDs I see
additionalResponses
schemaDefinitions
(usable in additionalResponses
only by WoT spec)I am not sure what you mean by
[...] can't work, because Ditto links Features Thing Descriptions via link
The TD itself should be self-contained. On the contrary, TMs can be composed by several "links" ..
In general I would say the browser UI is not the best to test interoperability. I do not have a running ditto instance but I would assume something like the following gist might work for the lamp status see https://gist.github.com/danielpeintner/ed6d6d0c6a1e511d81a4571be48d35b8
I'll try to make myself more clear with an example of how the generation of TDs via TMs works.
A Lamp TM is provided, with every feature linked as a submodel. This is the TM of the Lamp.
When TDs are generated, you have one for the Thing, and one for each Feature you specify.
You can see Here that the status
Feature is an "item" and there is a href that links that.
Some weeks ago, i created a Thing Description fetcher/parser in Java, and for doing that, i started from the initial TD(The "Thing" one) and then i retrieved all the Feature TDs.
Following "links" to retrieve additional TDs has been recently described in the Discovery spec. Being a fairly new feature of WoT node-wot does not still support it. Therefore, currently, you are left on your own, but you can manually fetch linked TDs using the WoTHelpers fetch function.
That's good to know. Also the example that @danielpeintner sent was very useful.
Eclipse Ditto™ is a technology in the IoT implementing a software pattern called “digital twins”. It recently added integration for Web Of Things, details of this integration can be found here. I think it is an important point to make Thing Descriptions generated by Ditto also working in thingweb.node-wot. Looking at the implementation, i think that the problem could be in the fact that Ditto Features are allocated in an external TD.