Properties

Properties are the element of the schema that describes the device's attributes that should be expected for a given entity in the real world.

Properties can be any one of the following types.
Note: If no type is selected, the Property will store any type from the ones listed below:
array
Expects a list of results
boolean
Expects a true/false
number
Expects any real number
integer
Expects any whole number
object
Expects a JSON object with additional properties defined.
string
Expects a series of letters and/or numbers
null
Expects no value

Depending on the property type, each property can be additionally defined with metadata.

Table 1. All property types can use the following metadata keys
Metadata Definition Description Required? Type
title Title of the property No string
description Additional content to help the user understand what the property is for. No string
unit Provides a reference unit, especially for numbers and integers. No string
readOnly Validates that a value should not be written to. Yes (default is false) boolean
Note: In the Web of Things specification from W3C, many more metadata keys are allowed. Those are not yet supported. These include "enum", "titles", "descriptions", "@type", "const", "oneOf", "writeOnly", and "format". Nor do we support "items", "minItems" or "maxItems" on Arrays, as well as "properties" or "required" on Objects yet.
Table 2. Number property types can also use the following metadata keys (plus those in "All")
Metadata Definition Description Required? Type
minimum Minimum value. Used for validation. No number
maximum Maximum value. Used for validation. No number
Table 3. Integer property types can use the following metadata keys (plus those in "All")
Metadata Definition Description Required? Type
minimum Minimum value. Used for validation. No integer
maximum Maximum value. Used for validation. No integer
Note: "String", "boolean" and "null" property types do not offer any additional definition beyond what is allowed in "all"
Below is an example properties section of a schema with examples for each of the above.
{
    ...
    "properties": {
        "rgb": {
            "type":"array",
            "title": "RGB color value",
            "description": "This property expects an array of json objects as defined below. Example value is [233,122,0]",
            "readOnly": false
        },
        "mode": {
            "type": "string",
            "title": "Operating Mode",
            "readOnly": false,
            "description": "This property expects a string. Example value is \"cleaning\" "
        },
        "temperature": {
            "type": "number",
            "title": "Temperature (F)",
            "description": "This property expects a number value (decimals are allowed). Example value is 98.6",
            "unit": "F",
            "maximum": 140.0,
            "minimum": -100.0,
            "readOnly": false
        },
        "groupId": {
            "type": "integer",
            "title": "Parent Group ID",
            "description": "This property expects a whole number value. Example is 312.",
            "minimum": 0,
            "maximum": 65535,
            "readOnly": false
        },
        "status": {
            "type": "object",
            "title": "Latest and current status",
            "description": "This property expects a JSON object which conforms to WoT schema definitions.",
            "readOnly": false
        },
        "isOn?": {
            "type": "boolean",
            "title": "Is this asset powered on?",
            "description": "This property expects either true or false",
            "readOnly": false
        }
    }
}

Add Properties to a Thing

  1. In the Overview panel of a Thing, click the plus icon next to Properties.


    Figure 1.
    The New Property dialog opens.
  2. Enter the Property Key value. This should be a descriptor of the Property.
  3. Optional: Select a Type from the dropdown menu, and set an Initial Value.
  4. Depending on the Type selection, subsequent fields may appear. Enter the values as required.
  5. If desired, enter any optional descriptors for this Property.
  6. Click Create.
    The information is added to the schema.


    Figure 2.
  7. Once the property has been created, you can click on the Edit icon to make further changes to this property.


    Figure 3.