Skip to content

Links to devices managed by a device (e.g. a gateway) #91

Open
@benfrancis

Description

@benfrancis

As suggested in WebThingsIO/gateway#947 we could create a web thing type for Web of Things gateways which includes in its Thing Description links to the things it manages. The gateway web thing type can have actions (such as putting it in pairing mode) and events (such as thingAdded and thingRemoved).

What should this web thing type be called? Is it always a "gateway" (bridging one type of network to another) or is "directory" a better term? (sometimes it may just be a directory of native web things).

Another thing I'm not sure about is whether it's better to have an explicit top level things member in the Thing Description, or to add link(s) to the links section with either a single link to a Things Resource or multiple links to individual Thing resources. I suspect using the links member may be easier to get through standardisation than adding a special new things member, although we may need to invent another new link relation type for that purpose, e.g.:

{
  "links": [
    {
      "rel": "things",
      "href": "/things"
    }
  ]
}

Creating a things link relation would be an obvious addition to the proposed properties, actions and events link relations, although to be honest none of these are great link relation names.

If each managed thing was provided as a separate link, the existing item link relation from RFC 6573 could be used for this purpose, e.g.:

{
  "links": [
    {
      "rel": "item",
      "href": "/things/thing1"
    },
    {
      "rel": "item",
      "href": "/things/thing2"
    }
  ]
}

Alternatively, the CoRE (Constrained RESTful Environments) specification (RFC 6690, used by CoAP) specifies a hosts link relation type for this purpose, e.g.:

{
  "links": [
    {
      "rel": "hosts",
      "href": "/things/thing1"
    },
    {
      "rel": "hosts",
      "href": "/things/thing2"
    }
  ]
}

This might be something to discuss at the W3C. There's already an example of a controlledBy link relation in the Thing Description specification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions