{ "$schema": "http://json-schema.org/schema#", "$schemaVersion": "0.0.1", "modelTags": "OCF", "$id": "https://smart-data-models.github.io/dataModel.IoTDataModels/Sleep/schema.json", "title": "Sleep", "description": "Smart Data Models Program adaptation of the original IoTData data Models. This Resource describes the Properties associated with Sleep. Sleep shows the time spent in each of the sleep stages (awake, nrem1, nrem2, nrem3, nrem4, rem, light sleep, deep sleep), along with a sleep score indicating the quality of sleep.", "type": "object", "allOf": [ { "$ref": "https://smart-data-models.github.io/data-models/common-schema.json#/definitions/GSMA-Commons" }, { "$ref": "https://smart-data-models.github.io/data-models/common-schema.json#/definitions/Location-Commons" }, { "properties": { "awake": { "type": "integer", "minimum": 0, "readOnly": true, "description": "Property. Time spent in Awake stage (in seconds)" }, "nrem1": { "type": "integer", "minimum": 0, "readOnly": true, "description": "Property. Time spent in Non Rapid Eye Movement stage 1 (in seconds)" }, "nrem2": { "type": "integer", "minimum": 0, "readOnly": true, "description": "Property. Time spent in Non Rapid Eye Movement stage 2 (in seconds)" }, "nrem3": { "type": "integer", "minimum": 0, "readOnly": true, "description": "Property. Time spent in Non Rapid Eye Movement stage 3 (in seconds)" }, "nrem4": { "type": "integer", "minimum": 0, "readOnly": true, "description": "Property. Time spent in Non Rapid Eye Movement stage 4 (in seconds)" }, "rem": { "type": "integer", "minimum": 0, "readOnly": true, "description": "Property. Time spent in Rapid Eye Movement (in seconds)" }, "lightsleep": { "type": "integer", "minimum": 0, "readOnly": true, "description": "Property. Time spent in Light Sleep stage, consisting in NREM stages 1 and 2 (in seconds)" }, "deepsleep": { "type": "integer", "minimum": 0, "readOnly": true, "description": "Property. Time spent in Deep Sleep stage, consisting in NREM stages 3 and 4 (in seconds)" }, "sleepscore": { "type": "number", "minimum": 0, "readOnly": true, "description": "Property. Score computed from the time spent in each sleep stage, indicative of the quality of sleep" }, "if": { "description": "Property. The Interface set supported by this Resource", "type": "array", "minItems": 1, "uniqueItems": true, "readOnly": true, "items": { "type": "string", "enum": [ "oic.if.s", "oic.if.baseline" ] } }, "rt": { "description": "Property. Resource Type", "type": "array", "minItems": 1, "uniqueItems": true, "readOnly": true, "items": { "type": "string", "enum": [ "oic.r.sleep" ] } }, "n": { "type": "string", "maxLength": 64, "readOnly": true, "description": "Property. Friendly name of the Resource" }, "range_phases": { "type": "array", "description": "Property. The valid range for the Property in the Resource as an integer. The first value in the array is the minimum value, the second value in the array is the maximum value.", "readOnly": true, "minItems": 2, "maxItems": 2, "items": { "type": "integer" } }, "step_phases": { "description": "Property. Step value across the defined range when the range is an integer. This is the increment for valid values across the range; so if range is 0..10 and step is 2 then valid values are 0,2,4,6,8,10.", "readOnly": true, "type": "integer" }, "range_score": { "type": "array", "description": "Property. The valid range for the Property in the Resource as a number. The first value in the array is the minimum value, the second value in the array is the maximum value.", "readOnly": true, "minItems": 2, "maxItems": 2, "items": { "type": "number" } }, "step_score": { "description": "Property. Step value across the defined range an integer when the range is a number. This is the increment for valid values across the range; so if range is 0.0..10.0 and step is 2.5 then valid values are 0.0,2.5,5.0,7.5,10.0.", "readOnly": true, "type": "number" }, "precision": { "type": "number", "readOnly": true, "description": "Property. When exposed the value in 'precision' provides a +/- tolerance against the Properties in the Resource. Thus if a Property is UPDATED to a value and that Property then RETRIEVED, the RETRIEVED value is valid if in the range of the set value +/- precision" }, "type": { "type": "string", "enum": [ "Sleep" ], "description": "Property. NGSI entity type. It has to be Sleep" } } } ], "derivedFrom": "https://github.com/OpenInterConnect/IoTDataModels/blob/master/SleepResURI.swagger.json", "license": "https://github.com/OpenInterConnect/IoTDataModels/blob/master/README.md", "required": [ "id", "type" ] }