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
Use of TD Templates (Thing Models) as abstractions for consumers #962
Comments
that sounds like a very good idea. In the last WoT workshop, I suggested something that goes into the same direction (see paper and slides). At the time, I was thinking of using "JSON-LD frames", which can be seen as queries to run over TD documents. But using ThingModels is functionally equivalent, that'd work. My suggestion went even slightly further: there should be a way to specify the relationships between the various Things that are accessed in a Consumer's script. For instance, a light bulb should be turned on only if it is in the same room as the occupancy sensor that detects movement (TD2). The two corresponding Things should have a certain relationship that can be expressed in RDF/JSON-LD. E.g. |
Note that you could shorten the definition as follows: "a TD must be an instance of a ThingModel under RDFS entailment" (and other entailment regimes could be considered, e.g. OWL-QL or OWL-RL). |
I'd like to see this mechanism taking place. It goes in the same direction as my idea exposed here. I also link a couple of other issues where we discussed similar features to keep track of the discussion: |
@fennibay
How would that look in a practical example? How can the TD instance indicate that it follows a certain Thing model? |
Hi @sebastiankb, please find the zipped Visio file here: td_template_for_consumer.zip Maybe I should have drawn this draw.io. @ all: Many thanks for the comments, I'll respond. |
@fennibay many thanks for sharing the file. draw.io works perfect |
What would RDFS entailment contain in addition to rdfs:subClassOf relationship in this context?
Can we also address data model compatibility between Thing Model and TD with semantic means? I saw this until now as a separate part, which needs to be addressed using more conventional means, e.g. check that the data model is identical, or maybe a superset or check if a conversion (as proposed in w3c/wot-scripting-api#204) is available. However, looking at TD Ontology, we could also do these checks semantically. But I miss there for instance the link to the data schema for a property, and also the contents of the data schema is not representable in this ontology. I certainly like the idea in w3c/wot-scripting-api#204 that parts of data model can also be semantically annotated with
Would this be then like a WoT-based version of IFTTT? p.s. sorry for the long delay. It was a busy week. |
I would like to check briefly whether this Issue is now fulfilled by the opportunities that TM supports:
|
Thanks for the query @sebastiankb. Regarding this issue; I think the remaining point is if we should model the needs of a WoT consumer formally, i.e. a "uses/consumes" relationship between the consumer and the now-specified TM. p.s. We also had a discussion about this with @mkovatsc. I think we have a good basis with TMs now, although they could maybe benefit more from semantic matching ( |
ok, I will label this issue "Defer to 2.0". In fact, a "Consumer Description" is currently missing and should be officially considerd in the next version. Btw: there is the discussion to remove the "tm:required" feature and replace them with "tm:optional". Also see here: #1594 |
Dependency inversion principle states that implementations should depend on abstractions (interfaces) instead of on implementations to avoid coupling between implementations.
This principle can be applied to consumed interaction affordances, by using abstract thing description templates, and realizing these abstractions using concrete thing descriptions.
An abstract thing description template consists mainly of interaction affordance templates, which then consist of
@type
for semantic annotation and a logical data schema.A concrete thing description realizing an abstract thing description template has to fulfill following constraints:
@type
must be rdfs:subClassOf template’s@type
This concept can also be used in the discovery phase. The discovery would then search for TDs fitting a given TD template by the consumer.
In case of a hybrid thing (consuming InteractionAffordances as well as exposing other InteractionAffordances), it can be a mix of TD and TD templates, where some InteractionAffordances are actually just InteractionAffordanceTemplates.
Proposals:
p.s. If TD Template is going to be renamed to Thing Model (#930) we should switch to that terminology.
cc: @sebastiankb
The text was updated successfully, but these errors were encountered: