You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support for multiple @context (aka support for Linked Data) #157
The W3C standard for the Thing Description, as of the status on 06/01/2021, describe that it is possible to use multiple context value, passing an array of values.
Note: This document is no longer maintained and has been replaced by a new specification at webthings.io/schemas.
As a student of University of Bologna I'm doing a small research about WoT and Linked Data. Giving me the possibility to utilize more @context in the Thing Description opens a standardized way to describe ALL the data I have inside a Thing, but this is not possible due this limitation. I cannot indicate more @context and I'm forced to do all referenced to the hard-coded "https://iot.mozilla.org/schemas" that allows me to use only that one hard-coded (not supported) ontology.
To point out better, the Example 28 is NOT compatible with WebThings API, since implements more than one @context.
Without this ability, I'm not able to proceed in my project: I need to contextualize my data in ontologies like SAREF, IoT-Lite, IoT-S and even the less significant ones like ontology-of-units-of-measure or DBpedia to give more opportunities to get ALL the possible data of the system. Why? With that many knowledge it's possible to understand the system, where the things are, and try to create actions that was not originally planned, but can be achieved mixing behaviors of different things.
I don't know if it's planned or not, but I really need this feature.
If not, I'm planning to "wrap" the requested Thing Description into a bigger one with all the ontologies I need to use, and then indicate for the WebThing library the "minimized" version of it.
@Martinocom Is the issue that you need to expose multiple contexts in the Thing Description, or that you need to consume multiple contexts from the Thing Description? I'm assuming it's the former given you originally filed this issue on the Java web thing library. Consuming multiple contexts using the WebThings Gateway's web thing adapter probably doesn't emit an error, but isn't explicitly supported yet.
This is one of the many differences between the Mozilla and W3C specifications that I intend to fix in a future version, potentially later this year, but I'm afraid it's going to take a long time to make these changes across all the WebThings libraries and gateway.
@mrstegeman In the meantime is there an easy way for Marcin to override the @context of a thing using the Java web thing library so that Marcin can add this feature for specific devices?
@mrstegeman In the meantime is there an easy way for Marcin to override the @context of a thing using the Java web thing library so that Marcin can add this feature for specific devices?
If can be useful for someone, I made some researches about current libraries and what they can achieve. I still think that WebThings has the bigger potential (also 'cos I wanted to use some Kotlin to develop my apps), but for my purposes, as said, I cannot have one hardcoded URL for schema. Alternatives that I found are:
WebThings: this library 👍 , but lack of support for multiple @context
Arena Web Hub: lack of support for multiple @context
ThingWeb: only NodeJS but does not change the @context value; not sure about support, but still better than nothing
Activity
Update schema url.
mrstegeman commentedon Jan 7, 2021
(Moved from webthing-java repo)
@Martinocom I've fixed your second point via WebThingsIO/webthing-java@14ea1c7
benfrancis commentedon Jan 11, 2021
@Martinocom Is the issue that you need to expose multiple contexts in the Thing Description, or that you need to consume multiple contexts from the Thing Description? I'm assuming it's the former given you originally filed this issue on the Java web thing library. Consuming multiple contexts using the WebThings Gateway's web thing adapter probably doesn't emit an error, but isn't explicitly supported yet.
This is one of the many differences between the Mozilla and W3C specifications that I intend to fix in a future version, potentially later this year, but I'm afraid it's going to take a long time to make these changes across all the WebThings libraries and gateway.
@mrstegeman In the meantime is there an easy way for Marcin to override the
@contextof a thing using the Java web thing library so that Marcin can add this feature for specific devices?mrstegeman commentedon Jan 11, 2021
No, it's hard-coded to use our schema URL.
Martinocom commentedon Jan 11, 2021
If can be useful for someone, I made some researches about current libraries and what they can achieve. I still think that WebThings has the bigger potential (also 'cos I wanted to use some Kotlin to develop my apps), but for my purposes, as said, I cannot have one hardcoded URL for schema. Alternatives that I found are:
@context@context@contextvalue; not sure about support, but still better than nothingI switched currently on ThingWeb and I'm figuring out how use a raw REST API for it.