After being approached by Juan Cruz Viotti and later by Ben Hutton from JSON Schema and Postman for writing a Case Study for JSON Schema, we as the WoT IG Marketing TF has started writing this. This is based on the template that is provided by them where we answer some questions first and then together with them turn it into a readable, flowing document.
Also see: https://github.com/w3c/wot-marketing/issues/329
Our organization is the World Wide Web Consortium (W3C), the standardization organization behind most of the standards used in the Web. We are the Web of Things Working and Interest Groups, who work on the standardization of Web of Things at the W3C.
Create an interoperability layer so that different IoT platforms, protocols and standards can operate together.
The work has started as a discussion in the WoT Community Group in 2013-2014. It has proceed to an Interest Group in 2015 that has collected the use cases and defined the standards to be worked on. Since 2016, the working group is working on different standards on the Web of Things with the first publications of the Thing Description and Architecture recommendations in 2019.
Ege: not sure about this. Let's solve https://github.com/w3c/wot-marketing/issues/18 at the same time.
There were, still are and will be proprieratary solutions for IoT problems. Without WoT, developers need to work with multiple protocols and API specification formats. This results in an integration work that is difficult to automate, resulting in repetitive tasks for the developers which result in non-scalable solutions as well.
OpenAPI was considered but it was rather quickly dismissed given that :
paths
or channels
.Ege: I think this overlaps with the above question
It is difficult to name one, so here are a few:
"type":"number"
Ege: we do not know. Need to ask W3C
Ege: difficult to comment on this.
It is more and more stable with its core features not changing since a couple of years and more importantly, these features are more and more consistent accross implementations.
The vocabulary features are very promising to be used together with Semantic Web Technologies. We plan to explore this cooperation of technologies further.
Postman's support to the community gives more confidence that it will not die as a hobby project.
The questions below are added based on the comments of Juan Cruz Viotti
Even though that usual Web APIs are predominantly using JSON, IoT devices and platforms use other types of data as well, such as binary, CBOR, image types etc. However, we still want the users of W3C WoT to rely on JSON Schema as the primary way to model and describe their data before resorting to other ways, which decrease interoperability. Sometimes the data is modeled in a more complicated way, due to practices of the old times where saving every bit was important. E.g. a byte can contain the entire value for smaller values of a sensor but if a single bit is set to 1, the rest of the byte has another meaning, which is used for larger values.
Below are two Thing Descriptions. One has 3 affordances with HTTP and the other one has 1 affordance with MQTT.
Explanation:
From this TD example, we know there exists one Property affordance with the title status. In addition, information is provided to indicate that this Property is accessible via (the secure form of) the HTTP protocol with a GET method at the URI https://mylamp.example.com/status (announced within the forms structure by the href member), and will return a string-based status value. The use of the GET method is not stated explicitly, but is one of the default assumptions defined by the TD specification
In a similar manner, an Action affordance is specified to toggle the switch status using the POST method on the https://mylamp.example.com/toggle resource, where POST is again a default assumption for invoking Actions.
The Event affordance enables a mechanism for asynchronous messages to be sent by a Thing. Here, a subscription to be notified upon a possible overheating event of the lamp can be obtained by using HTTP with its long polling subprotocol on https://mylamp.example.com/oh.
This example also specifies the basic security scheme, requiring a username and password for access. Note that a security scheme is first given a name in securityDefinitions
and then activated by specifying that name in a security
section. In combination with the use of the HTTP protocol this example demonstrates the use of HTTP Basic Authentication. Specification of at least one security scheme at the top level is mandatory, and gives the default access requirements for every resource. However, security schemes can also be specified per-form, with configurations given at the form level overriding configurations given at the Thing level, allowing for the specification of fine-grained access control.
Explanation:
This is a simpler TD compared to the one above. It enables a consumer that is capable of MQTT to subscribe to the topic "application/devices/thing1/illuminance"
at the MQTT broker with address mqtt://192.168.1.187:1883
.
The event data, as described by a JSON Schema, is an integer between 0 and 255, with multiple of 5 and is transmitted as JSON.
Compared to the previous example, there is no need to provide any security credentials when connecting to the broker and executing the affordances.
There are many ways to get started. You might already have a WoT device next to you, just that maybe it did not come with a TD already. Some things you can do to get more familiar with WoT:
Ege's comment: Difficult to comment here, I need to think. Also I am not sure if W3C would prefer taking a stance like this but why not. If we consider formats like CBOR or JSON BinPack which are very compatible with JSON, I don't see a limitation much. Maybe streaming related payloads will always exist.
Below is the template at https://github.com/json-schema-org/community/blob/main/docs/case-studies/template.md
In looking to publish at least three case studies this year, we need a template of questions to ask organizations. Here are a list of questions which we should provide for each case study. The questions themselves should not be in the case study, but we should be able to put the resulting answers together should provide us with a mostly workable case study.
The list is mostly based on the case study format used at https://www.cncf.io/case-studies.
For each question or group of questions, before the dash is providing context, and would not be sent to the case study subject.
We should always seek final approval for the case study subject before publishing.
Challenge - What challenges were you encountering before you used JSON Schema?
Cristiano Aguzzi We can describe the IoT fragmentation problem regarding data payloads and data model. This should address the point the first bullet point in issue https://github.com/w3c/wot-marketing/issues/329#issuecomment-1174960085. Regarding the other points we can probably split the use case in at least two other (?): for example: Use case 1: Describing IoT payloads, Use case 2: validate IoT metadata descriptors (including also the issue of validating extensions and json-ld context), Use case 3 runtime interface typings generation (better name?).
Solution - In what way did JSON Schema solve this challenge?
Impact - What was the impact of the solution? What benefits have you seen?
Key impact results - Are there any metrics you used to evaluate the impact or success of the project using JSON Schema?
Cristiano Aguzzi I would put the answers to these question above in a preface or introduction. Not sure why they are here at the bottom.
Who is your organization, and where do you or your group/team sit within it?
What is the organization's mission? What is your group's/team's mission?
What’s the organization's story that led to this work?
How the challenge arose - What was the situation before the challenge presented? Was there a solution which didn’t meet new requirements?
Considerations during research for a solution - What criteria did you use when deciding on potential solutions? What potential solutions did you decide were not as good a fit and why?
"A Ha!" moment - What was the moment or key feature of JSON Schema that meant it was the right solution for you to try?
Wider influence? - Has your/your project's use of JSON Schema had influence in other areas of the organization?
What assurances do you now have? - Does JSON Schema provide you with any confidence looking forward to the future?
Additional meta-data if possible: Industry, location, Size… ?