RE: Proposal for a WoT servient based on IoTivity

Hi Michael,



thanks for pointing this out. I browsed your work with interest. Here are a my comments:



-       your approach of having capabilities in the one hand and things in the other hand seems very promising. Do you already have a piece of code in your servient implementation that constructs all st-th-*.json files by loading and parameterizing the proper st-cp-*.json files?

-       If it is the case, I understand redundancy does not really matter. But here is a piece of advice to avoid repeating x times the same JSON schema in a single TD (also mentioned here<https://github.com/w3c/wot/tree/master/proposals/type-system#comparison>). It simply consists in using the @id JSON-LD keyword to reference an object defined several times. e.g.:
{
  ...
  "properties": [
    {
      "name": "hue",
      "valueType": {
        "@id": "#percent_type",
        "type": "object",
        "minimum": 0,
        "maximum": 100
      },
      ...
    },
    {
      "name": "saturation",
      "valueType": "#percent_type",
      ...
    }
  ],
  ...
}

-       I believe st-td.json is just a draft example made of pieces you copied from the Current Practices document, is that right? Because it contains syntax errors and some inconsistencies as per JSON-LD.

-       It is great to see that you annotated your TDs with actual semantics. Do you plan on further defining concepts like capability, hue, colortemperature, etc? I assume the ontology http://example.org/smartthings does not exist. It would be beneficial if you annotated your Things with well-defined concepts, e.g. from the DogOnt ontology. DogOnt has concepts like HueStateValue, SaturationStateValue, OnCommand, OffCommand and many others, i.e. probably everything you will need. It is actually what we tried to introduce in the last PlugFest with a "common" extra context for semantic annotation<https://github.com/w3c/wot/tree/master/TF-TD/TD%20Extensions>. It is maybe better to reference DogOnt directly, though. You can download the ontology file here<http://elite.polito.it/ontologies/dogont.owl>.

-       When you declare "@type": "thing" or "@type": "capability" at the beginning of a TD, those terms should appear either in a namespace or in a context. Otherwise, the RDF triple you generate from that isn't quite correct. If your code makes use of it, you might want to use an internal property instead of @type (for instance _type, in which case it is simply ignored by the JSON-LD processor).

-       I spotted minor syntax errors:

o    st-cp-switch.json:48, the trailing comma should be removed

o    st-cp-colorcontrol.json:119, the escaped string seems wrong



By the way, I used a validation tool to check your TDs, which I am currently developing. It performs JSON Schema validation as well as semantic validation if there is any annotation (still experimental). This tool is web-based and I hope to put it online before the PlugFest in Beijing, to help participants.



Regards,

Victor



From: Michael Koster [mailto:michael.koster@smartthings.com]
Sent: Dienstag, 31. Mai 2016 20:06
To: Public Web of Things IG
Subject: Proposal for a WoT servient based on IoTivity



Hi,



FYI; I have collected some working documents and started a project repository to create an implementation of a WoT servient based on IoTivity as the resource layer.



The basic idea is described at:

https://github.com/connectIOT/iotivity-servient/blob/master/docs/st-servient.pdf



Iotivity would expose resource models using the abstract transfer layer protocol bindings proposed in:

https://github.com/connectIOT/iotivity-servient/blob/master/docs/abstract-transfer.pdf



Initially I have mapped some SmartThings Capabilities (different things a device can do or expose, like on/off and level control) and some reference device types to Thing Descriptions.

These are the devices that would be exposed for the PlugFest:

https://github.com/connectIOT/iotivity-servient/blob/master/docs/BasicDeviceTypes.pdf



I've created a set of Thing Descriptions for the Capabilities, and another set for devices, that aggregate the Capability TDs. These are all maintained at:

https://github.com/connectIOT/iotivity-servient/tree/master/td



It would be great if someone would review these TD files to confirm that I understand how to use TD, before I create a larger set of TDs to represent the reference device types and capabilities.



Best regards,



Michael

Received on Friday, 3 June 2016 13:47:32 UTC