Subject: [T2TRG] 3. WoT Thing needs to have meta Band

From: David Janes <[email-masked]>
Date: Wed, 27 Jan 2016 04:39:53 -0500

****
Formatted version here:
https://github.com/dpjanes/homestar-plugfest/blob/master/docs/2016-01%20W3C%20IETF/3.%20WoT%20Thing%20needs%20to%20have%20meta%20Band.md
****

Points to be made:

   - Facets: AC / Furnace / Thermostat combo
   - Schema.org properties, what if we want a Model Number?
   - Meta or Model?

<https://github.com/dpjanes/homestar-plugfest/blob/master/docs/2016-01%20W3C%20IETF/3.%20WoT%20Thing%20needs%20to%20have%20meta%20Band.md#nest-thermostat>Nest
Thermostat

For this example, we'll be considering the Nest Thermostat. The Nest
Thermostat has (let's say):

   - it controls the AC
   - it controls the Furnace
   - it monitors Temperature
   - it monitors Humidity

<https://github.com/dpjanes/homestar-plugfest/blob/master/docs/2016-01%20W3C%20IETF/3.%20WoT%20Thing%20needs%20to%20have%20meta%20Band.md#3a-whats-the-type-of-this-thing>(3A)
What's the "type" of this Thing?
<https://github.com/dpjanes/homestar-plugfest/blob/master/docs/2016-01%20W3C%20IETF/3.%20WoT%20Thing%20needs%20to%20have%20meta%20Band.md#problem>
Problem

As in:

    readonly attribute DOMString type;

Is it a:

   - Nest
   - AC Control
   - Heating Control
   - Climate Control (in General)

My answer would be "it's several of these" and in particular, the last
three.
<https://github.com/dpjanes/homestar-plugfest/blob/master/docs/2016-01%20W3C%20IETF/3.%20WoT%20Thing%20needs%20to%20have%20meta%20Band.md#solution-facets>Solution:
Facets

The "type" of a Thing cannot be a single value. Furthermore, the word
"type" is heavily overloaded so we propose the term "facets".

So the Nest thermostat would have

We propose the following solution:

   - use a "meta" band to store this type of data
   - use "facets" (within the meta) to describe the "type" of a Thing

e.g. the Nest Thing would have (at least) the following facets:

   - "Climate Control"
   - "AC"
   - "Heating"

Since we want to be Semantic, we should use URLs (/QNames) for concepts,
giving us the facets

"iot-facet:climate",
"iot-facet:climate.heating",
"iot-facet:climate.cooling",

Which can be looked up here:

https://iotdb.org/pub/iot-facet

<https://github.com/dpjanes/homestar-plugfest/blob/master/docs/2016-01%20W3C%20IETF/3.%20WoT%20Thing%20needs%20to%20have%20meta%20Band.md#3b-additional-data>(3B)
Additional Data

The WoT Model defines the following meta-data like items.

readonly attribute DOMString id;
readonly attribute DOMString type;
readonly attribute DOMString name;

What if we want to have an image associated with the metadata. How about
*two* images? What about the manufacture name, or URL, or the Model code?
How about a description?
<https://github.com/dpjanes/homestar-plugfest/blob/master/docs/2016-01%20W3C%20IETF/3.%20WoT%20Thing%20needs%20to%20have%20meta%20Band.md#3c-schemaorg-vocabulary>(3C)
Schema.org Vocabulary

Schema.org provides a well supported semantic vocabulary. Of particular
interest to the IoT community is:

   - https://schema.org/Thing
   - https://schema.org/Product

There is *no need* to make new definitions for common concepts: the work
has been done for us.
<https://github.com/dpjanes/homestar-plugfest/blob/master/docs/2016-01%20W3C%20IETF/3.%20WoT%20Thing%20needs%20to%20have%20meta%20Band.md#3d-meta-v-model>(3D)
Meta v Model

Note that you might say "why are you using metadata to describe this rather
than the model". In fact, you probably want it in both, e.g.

   - the model has the initial definitions
   - when a Thing is instantiated, it copies the initial definitions from
   the model to the meta.
   - the meta can be modified during use; the model is basically static

Considering the WeMo Switch again. Out of the box its facet is
"iot-facet:switch". However, if we connect it to a lamp then we really want
to consider this *to be a lamp*, e.g. its facet should become
"iot-facet:lighting".
<https://github.com/dpjanes/homestar-plugfest/blob/master/docs/2016-01%20W3C%20IETF/3.%20WoT%20Thing%20needs%20to%20have%20meta%20Band.md#3e-putting-it-all-together>(3E)
Putting it all together

Instead of variables on a Thing, we propose that there be a band (i.e. a
JSON-like dictionary) that stores all the meta data.

This would look very much like this:

{
    "iot:thing-id": "<the thing id>",
    "iot:facet": [
        "iot-facet:climate",
        "iot-facet:climate.heating",
        "iot-facet:climate.cooling",
    ],
    "schema:name": "My Super Cool Nest Thermostat",
    "schema:manufacturer": "https://nest.com",
    "schema:model": "Nest",
    "schema:mpn": "......",
    "schema:productID": "......",
}

You'll note that this looks very much like the istate and ostate bands,
even though its purpose is very different. Code wise it's much the same

thing.meta.get("schema:name")   ## "My Super Cool Nest Thermostat"
thing.meta.get("iot:facet")     ## [ ... ]
thing.meta.set("schema:name", "David's Thermostat")

and so forth

---

From: Carsten Bormann <[email-masked]>
Date: Wed, 27 Jan 2016 11:08:29 +0100

> "iot-facet:climate.heating",

But maybe I don't need to know that something was sold as a heating?
Switching on the computer may heat my room fine.

Most people who build computers won't think of the fact that it also can
serve as a 200 W heater.  Or TVs, lamps; ...

Knowing the purpose of a thing certainly is useful, but knowing the
actual effect may be more useful.

(But maybe you can make those facets fine-granular enough that they are
useful for searching for a particular effect.)

Grüße, Carsten

---

From: Ludwig Seitz <[email-masked]>
Date: Wed, 27 Jan 2016 11:14:34 +0100

> serve as a 200 W heater.  Or TVs, lamps; ...

In the late 90-es, there was a sign at the door of the students' 
computer pool room at the University of Karlsruhe saying: "Are you 
freezing? Just start up a few more computers!"

/Ludwig

-- 
Ludwig Seitz, PhD
SICS Swedish ICT AB
Ideon Science Park
Building Beta 2
Scheelevägen 17
SE-223 70 Lund

Phone +46(0)70 349 9251
http://www.sics.se

---

From: David Janes <[email-masked]>
Date: Wed, 27 Jan 2016 05:17:57 -0500

So this gets into one of the principals I'd like to promote, that:

   - things do what they say they do
   - things are what they say they are

So if you have an old Pentium in the basement that you'd like to heat the
room (or the student's computer pool room at Karlsruhe), you can add
"iot-facet:climate.heating" to the metadata facets. When some client wants
to heat up the room, they introspect the environment, find that there's a
device that (says its) a heater and turn it on.

D.

---

From: Michael Richardson <[email-masked]>
Date: Wed, 27 Jan 2016 09:37:42 -0500

> serve as a 200 W heater.  Or TVs, lamps; ...

Right, and the opposite is relevant: if trying to cut down power, it might be
better to turn off the LEDs lights and the heater, and leave the incadescent
bulb on...
(I'm imagining an Asimov Three Laws Robot scanning a room to determine how
it can keep the human intact...)

So I think that you asking for the devices to say what they can cause.
  Computer: consumes 200W, emits 200W heat, provides 27Gflops, IPv6 routing.
            Intended for entertainment.
  Fridge:   consumes 75W,  emits 100W heat, cools 25W, occasional illumination
            Preserves food for human consumption.

--
Michael Richardson <[email-masked]>, Sandelman Software Works
 -= IPv6 IoT consulting =-

---

From: Michael Richardson <[email-masked]>
Date: Wed, 27 Jan 2016 09:39:59 -0500

David Janes <[email-masked]> wrote:
    > "iot-facet:climate.heating" to the metadata facets. When some client wants to
    > heat up the room, they introspect the environment, find that there's a device
    > that (says its) a heater and turn it on.

But if my goal is to have more computation, and I turn on more computers, I
might also want to turn off some heating.  Or in the summer, I might want to
use the computers in some place that needs heat, rather than running my
cooling costs up.

---

From: Carsten Bormann <[email-masked]>
Date: Wed, 27 Jan 2016 16:12:46 +0100

David Janes wrote:
> So if you have an old Pentium in the basement that you'd like to heat
> the room (or the student's computer pool room at Karlsruhe), you can add
> "iot-facet:climate.heating" to the metadata facets.

That assumes that (1) I have control over the metadata and (2) I think
about doing that.  Generally, the discovery/metadata component will work
best if it can do its work while unattended.  So I'm not sure I want to
be adding facets to things continuously.  (But maybe there is no way
around that fusing metadata from multiple sources, and one of those may
be the user that is trying to achieve some effect.)

Grüße, Carsten

---

From: David Janes <[email-masked]>
Date: Wed, 27 Jan 2016 11:11:16 -0500

But the beautiful thing is all that information is there to reason upon.
And now that you mention it, if people start adding energy consumption
profiles to their Models, you can start making clever decisions like you
say.

This is one the reasons I'm big on Linked Data / qnames. If the vocabulary
is not there now, it can be added later. On the other hand if you start
doing things like…

enum ProximitySensorDirection {
    "front",
    "rear",
    "left",
    "right",
    "top",
    "bottom"
};

…it may never be used, it may be incomplete, and so forth. But when the
time comes to create it (because it's needed), it's easy to drop it in :
it's just URLs.

D.

---

From: David Janes <[email-masked]>
Date: Wed, 27 Jan 2016 11:17:25 -0500

In particular, I'll refer you to the WeMo case in the document at the start
of this email thread.

_Somehow_ you're going to have to be associate the fact that "this wemo is
controlling a light" and "this other wemo is connect to a space heater".
This is a real problem that exists today if you want to be able to say
"turn on all the lights in the living room" or "turn off all the heaters in
the basement".

I'm hoping I'm not confusing things when I say that the metadata band
doesn't have to live on the device. It can be a URL "out there" somewhere.
I'm trying to keep the ideas flexible enough that evolve based on how
people will actually use stuff in the future.

D.

---

From: David Janes <[email-masked]>
Date: Wed, 27 Jan 2016 11:45:58 -0500

Sure.

(1)

I'm not proposing that computers declare themselves as heaters, just that
it's possible for you to do so.

The _real_ reason you need "facet flexibility" outlined with the WeMo
example, that is e.g., that you might want to declare your WeMo controls a
light - or a space heater.

(2 - aside)

Even you're not convinced that things like facets should be dynamically
editable, at least I hope I've convinced you that you might want to have
more than one facet (or "type" in the original WoT Thing definition)
associated with a Thing.

(3)

I guess the other principle I should be outlining is "no miracles". The
client has to make a decision about how to use it as a heater.

Going with our joke example of the computer heater, you can use facets in
the metadata to find that this device declares it's part of the heating
system (e.g. it is "iot-facet:climate.heating").

Now that you know that, the client still has to make a decision about how
to use it. And let's say that's out of scope, but I hope I've convinced you
that this is flexible enough to encompass it if "turning it on" is an
insufficient answer. And you've pretty well outlined the logic, e.g. does
it have a temperature setting, etc.

D.

On Wed, Jan 27, 2016 at 11:29 AM, Lynn, James (Application Defender /
Fortify on Demand) <[email-masked]> wrote:

> Can you clarify something regarding this example?
>
>
>
> A ‘real’ heater typically has a thermostat which can be set to some value.
> A computer, etc. does not. So they are different ‘types’ of heaters. One
> proposal seems to be saying it is useful to know that a computer can be
> used as a heater but not necessary. Another is that ‘things do what they
> say they do’. Are we proposing that a computer may declare that it is a
> heater? Or would your approach suggest that some other property lets us
> know that it generates heat, in which case I’m guessing that the lack of a
> thermostat property and/or the absence of a setTemperature property allows
> us to differentiate between ‘real’ heaters and devices that may be used as
> a heater?
>
>
>
> Or perhaps the view is that it really doesn’t matter, it’s outside the
> spec?
>
>
>
> Regards,
>
> J Lynn
>
>
>
> *From:* [email-masked] [mailto:[email-masked]] *On Behalf Of *David
> Janes
> *Sent:* Wednesday, January 27, 2016 5:18 AM
> *To:* Carsten Bormann
> *Cc:* [email-masked]; [email-masked]
> *Subject:* Re: 3. WoT Thing needs to have meta Band
>
>
>

---

From: "Lynn, James (Application Defender / Fortify on Demand)" <[email-masked]>
Date: Wed, 27 Jan 2016 16:29:49 +0000

A ‘real’ heater typically has a thermostat which can be set to some value. A computer, etc. does not. So they are different ‘types’ of heaters. One proposal seems to be saying it is useful to know that a computer can be used as a heater but not necessary. Another is that ‘things do what they say they do’. Are we proposing that a computer may declare that it is a heater? Or would your approach suggest that some other property lets us know that it generates heat, in which case I’m guessing that the lack of a thermostat property and/or the absence of a setTemperature property allows us to differentiate between ‘real’ heaters and devices that may be used as a heater?

Or perhaps the view is that it really doesn’t matter, it’s outside the spec?

Regards,
J Lynn

From: [email-masked] [mailto:[email-masked]] On Behalf Of David Janes
Sent: Wednesday, January 27, 2016 5:18 AM
To: Carsten Bormann
Cc: [email-masked]; [email-masked]
Subject: Re: 3. WoT Thing needs to have meta Band

  *   things do what they say they do
  *   things are what they say they are
So if you have an old Pentium in the basement that you'd like to heat the room (or the student's computer pool room at Karlsruhe), you can add "iot-facet:climate.heating" to the metadata facets. When some client wants to heat up the room, they introspect the environment, find that there's a device that (says its) a heater and turn it on.

D.

Grüße, Carsten

---

From: Hasan Derhamy <[email-masked]>
Date: Wed, 27 Jan 2016 18:14:38 +0000

Hi,

Two cents:

A)     A “Thing” can produce heat, and so it this can be described in its metadata.

B)      A “Thing” is functionally a heater.
If a thing is functionally not a heater but a computer then it should not declare itself as such. But if it produces heat, then having this as a searchable property sounds like potential for pretty smart algorithms.

-Hasan

From: T2TRG [mailto:[email-masked]] On Behalf Of Lynn, James (Application Defender / Fortify on Demand)
Sent: den 27 januari 2016 17:30
To: David Janes; Carsten Bormann
Cc: [email-masked]; [email-masked]
Subject: Re: [T2TRG] 3. WoT Thing needs to have meta Band

Regards,
J Lynn

From: [email-masked]<mailto:[email-masked]> [mailto:[email-masked]] On Behalf Of David Janes
Sent: Wednesday, January 27, 2016 5:18 AM
To: Carsten Bormann
Cc: [email-masked]<mailto:[email-masked]>; [email-masked]<mailto:[email-masked]>
Subject: Re: 3. WoT Thing needs to have meta Band

D.

Grüße, Carsten

---

From: David Janes <[email-masked]>
Date: Wed, 27 Jan 2016 15:10:00 -0500

For the record, I never proposed the computers should declare themselves as
heaters, only that they could. For further information, contact the "Down
Jackets for Freezing CS Students Because Of Cloud Computing Society, University
of Karlsruhe"

The nice thing with flexible modelling languages and metadata is one can
add novel information in the future if it proves to be useful in reality.

D.

On Wed, Jan 27, 2016 at 1:14 PM, Hasan Derhamy <[email-masked]> wrote:

> If a thing is functionally not a heater but a computer then it should not
> declare itself as such. But if it produces heat, then having this as a
> searchable property sounds like potential for pretty smart algorithms.
>
>
>
> -Hasan
>
>
>
>
>
>
>
> *From:* T2TRG [mailto:[email-masked]] *On Behalf Of *Lynn, James
> (Application Defender / Fortify on Demand)
> *Sent:* den 27 januari 2016 17:30
> *To:* David Janes; Carsten Bormann
> *Cc:* [email-masked]; [email-masked]
> *Subject:* Re: [T2TRG] 3. WoT Thing needs to have meta Band
>
>
>
> *From:* [email-masked] [mailto:[email-masked]
> <[email-masked]>] *On Behalf Of *David Janes

---

From: Carsten Bormann <[email-masked]>
Date: Thu, 28 Jan 2016 10:59:33 +0100

I think we have had enough discussion about the difference between heaters and things that generate heat.

What my initial comment really was about was that things may have physical properties that allow to give them new purposes, purposes that the original manufacturer/buyer/installer of the thing did not foresee.  So for some applications it may be useful to know not only the original purpose and the high-level properties of the thing that relate to that, but also those basic physical properties in a more malleable form.

Grüße, Carsten

---

From: Kerry Lynn <[email-masked]>
Date: Thu, 28 Jan 2016 10:29:04 -0500

Ideally, anything with an AC plug should be able to respond with its energy
consumption in active and non-active states.  That would permit other
attributes such as heat output, carbon emission, or load shedding to be
estimated.

BTW, most people are unaware that they're 120W heaters...

Kerry

On Thu, Jan 28, 2016 at 4:59 AM, Carsten Bormann <[email-masked]> wrote:

> What my initial comment really was about was that things may have physical
> properties that allow to give them new purposes, purposes that the original
> manufacturer/buyer/installer of the thing did not foresee.  So for some
> applications it may be useful to know not only the original purpose and the
> high-level properties of the thing that relate to that, but also those
> basic physical properties in a more malleable form.
>
> Grüße, Carsten
>
>
> _______________________________________________
> T2TRG mailing list
> [email-masked]
> https://www.irtf.org/mailman/listinfo/t2trg
>
>

---

From: Charles Wegrzyn <[email-masked]>
Date: Thu, 28 Jan 2016 12:45:31 -0500

Why with an AC plug? I'd say any power source. 

Chuck

---

From: Michael Richardson <[email-masked]>
Date: Thu, 28 Jan 2016 16:14:20 -0500

> A ‘real’ heater typically has a thermostat which can be set to some

I disagree on your definition of "real" :-)

Baseboard heaters for instance are either on or off.
Water radiators have valves with different settings (other than on/off), but
also are controlled by thermostats, sometimes many of them in the room, and
usually with a safety to turn things off.

The thermostat is in the room (or sometimes just the house!), and we have
reason to believe that in the future we'll want more detailed control over
the heaters...

So my take is that *heaters* do not have a thermostat, but rather a heating
system or Climate Control system would have that.

    > computer, etc. does not. So they are different ‘types’ of heaters. One
    > proposal seems to be saying it is useful to know that a computer can be used
    > as a heater but not necessary. Another is that ‘things do what they say they
    > do’. Are we proposing that a computer may declare that it is a heater?

Not that the computer says it is a heater, but rather, the computer says that
it creates heat.

    > Or perhaps the view is that it really doesn’t matter, it’s outside the spec?

I think it matters, but I think it's a question of different facets.

---

From: David Janes <[email-masked]>
Date: Thu, 28 Jan 2016 18:42:03 -0500

My take is that is something says it's "iot-facet:climate.heating" then
it's worth "looking at" to heat the environment.

How you would tell it to heat the environment is figured out by
introspecting what it does. This isn't so problematic as it sounds: there's
only so many ways it can actually do that.

More generally -- even if you don't like that specific example -- I believe
the concept of "facets declares what it is", "properties declare how it
does it" is a strong, flexible model. And very very future friendly.

D.

---

From: Василий Долматов <[email-masked]>
Date: Fri, 29 Jan 2016 12:48:16 +0300

> 28 янв. 2016 г., в 18:29, Kerry Lynn <[email-masked]> написал(а):
> 
Agree…

Possible usage can be to precompute necessary energy for heating of given room by real heater.

dol@

> On Thu, Jan 28, 2016 at 4:59 AM, Carsten Bormann <[email-masked] <mailto:[email-masked]>> wrote:
> [email-masked] <mailto:[email-masked]>
> https://www.irtf.org/mailman/listinfo/t2trg <https://www.irtf.org/mailman/listinfo/t2trg>
> 
>

---

From: Behcet Sarikaya <[email-masked]>
Date: Fri, 29 Jan 2016 10:34:33 -0600

Hi David,

I have a feeling that you are more concerned about the
device/thing/sensor's physiological-mechanical behavior than its
network behavior.

I am not sure if those aspects are in scope in IETF.
In any case, please write your document in IETF draft format, your
file in github does not follow that format.

Regards,

Behcet

On Thu, Jan 28, 2016 at 5:42 PM, David Janes <[email-masked]> wrote:
> My take is that is something says it's "iot-facet:climate.heating" then it's
> worth "looking at" to heat the environment.
>
> the concept of "facets declares what it is", "properties declare how it does
> it" is a strong, flexible model. And very very future friendly.
>
> D.
>
>