W3C home > Mailing lists > Public > public-wot-ig@w3.org > May 2016

Re: application facing lifecycle, data and interaction model for things

From: Dave Raggett <dsr@w3.org>
Date: Mon, 2 May 2016 18:07:44 +0100
Cc: Public Web of Things IG <public-wot-ig@w3.org>
Message-Id: <73E89D9A-24AC-4303-A254-6547B2D7E73B@w3.org>
To: "Peintner, Daniel (ext)" <daniel.peintner.ext@siemens.com>

> On 2 May 2016, at 12:36, Peintner, Daniel (ext) <daniel.peintner.ext@siemens.com> wrote:
> 
> Hi Dave,
> 
>> I currently have an informal and incomplete proposal for types,
>> and am looking for help to formalise this. The starting point is
>> the notion of a “value” as having a type.  This includes some core
>> types like null, booleans (true or false), numbers and strings.
>> This borrows directly from JSON.  Note that RDF has problems with
>> null, which therefore needs further discussion.  JSON further suggests
>> the need for arrays and name/value pairs. This allows for compound
>> values with arbitrarily deep nesting. Values may be early or late
>> bound or variant types, where there is some flexibility for what
>> kinds of values are accepted.
> 
> In Montreal, Victor, Taki and myself have been asked to look into how we could express datatypes in a thing description and so we did.
> 
> https://github.com/w3c/wot/tree/master/proposals/type-system
> 
> Please have a look and feel free to comment on what has been done so far.
> I think we should try to find common agreement.

In Montreal, there seemed to be quite a bit of enthusiasm for using the schema.org data types, which could also help us with engaging the web developer community.  Matthias argued nicely for using number + restrictions rather than having a large suite of number types. However, this should be subject to feedback from web developers. My guess is that web developers will prefer short names to longer ones, e.g. max rather than maxValue or maximum.

OCF uses RAML + JSON schema, and I would like to note that this results in rather complex descriptions. We should aim to offer greater simplicity and greater flexibility! I believe that this is indeed practical, and plan to study this for the OCF definitions on the oneiota.org site.

An area for future study is a extension of JSON to allow for expressions as a basis for expressing integrity constraints. This is analogous to using expressions in spreadsheets and forms, and something I’ve explored for an HTML forms library some years ago. Domain models can then be expressed as a mix of data model constrains and semantic constraints that determine what properties and types etc. are needed for given kinds of things.

I think we should take an experimental approach that explores a range of choices and seek feedback from a broad range of stakeholders. It is all to easy to pick a choice that later turns out to be unpopular when engaging with people outside of one’s immediate colleagues, and who don’t share the same perspective.  XML namespaces and XHTML are a case in point.

To get this broader feedback, we can focus on providing open source projects along with good documentation and examples, so that people can easily get a hands on feel for the different choices.

Thanks for the pointer to [1]. The user defined properties are similar to the approach I’ve been exploring, although I also allow for a shortcut for common cases where you give the type name directly in place of the JSON object for a given property name.  One area where simplification is possible is for the mapping from the abstract data model to the resource model for devices using REST based protocols like HTTP or CoAP.  If this mapping can be expressed as a standard (named) recipe, then the platform can apply that recipe, and the thing description can avoid the need for all the complexity that we see with RAML+JSON schema.

I am progressing with my C++ implementations for the Arduino and a Web of Things gateway for more powerful devices. The latter will support multiple protocols and provide a testbed for interoperation with OCF, M2M and other platforms. One of the considerations for thing descriptions is how easy they are to support on resource starved devices.

[1] https://github.com/w3c/wot/tree/master/proposals/type-system

—
   Dave Raggett <dsr@w3.org <mailto:dsr@w3.org>>




Received on Monday, 2 May 2016 17:07:55 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:27:03 UTC