{ "definitions": {}, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://w3id.org/rec/edge_message/3.3/", "type": "object", "title": "RealEstateCore Edge Message Schema", "required": [ "format", "deviceId" ], "properties": { "format": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/format", "type": "string", "title": "The Format Schema", "description": "RealEstateCore edge message version", "default": "rec3.3", "examples": [ "rec3.3" ], "pattern": "^(.*)$" }, "deviceId": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/deviceId", "type": "string", "title": "The DeviceId Schema,", "description": "Either IRI or ID of Device", "default": "", "examples": [ "ba65fb71-6bba-4907-ab8f-877032ef58b2" ], "pattern": "^(.*)$" }, "observations": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/observations", "type": "array", "title": "The Observations Array Schema", "default": null, "items": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/observations/items", "type": "object", "title": "The Observation Schema", "default": null, "required": [ "observationTime", "quantityKind", "sensorId" ], "oneOf": [ {"required": ["value"]}, {"required": ["valueString"]}, {"required": ["valueBoolean"]} ], "properties": { "observationTime": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/observations/items/properties/observationTime", "type": "string", "title": "The ObservationTime Schema", "description": "ISO 8601 date-time string, UTC", "default": "", "examples": [ "2019-05-27T20:07:44Z" ], "pattern": "^(.*)$", "format": null }, "value": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/observations/items/properties/value", "type": "number", "title": "The Value Schema", "description": "Observed value (number)", "default": "", "examples": [ 16.1 ] }, "valueString": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/observations/items/properties/valueString", "type": "string", "title": "The ValueString Schema", "description": "Observed value (string)", "default": "", "examples": [ "Sierra Echo" ], "pattern": "^(.*)$" }, "valueBoolean": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/observations/items/properties/valueBoolean", "type": "boolean", "title": "The ValueBoolean Schema", "description": "Observed Value (Boolean)", "default": "", "examples": [ false ] }, "quantityKind": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/observations/items/properties/quantityKind", "type": "string", "title": "The QuantityKind Schema", "description": "quantityKind", "default": "", "examples": [ "https://w3id.org/rec/core/Temperature" ], "pattern": "^(.*)$", "format": "iri" }, "sensorId": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/observations/items/properties/sensorId", "type": "string", "title": "The SensorId Schema", "description": "IRI or ID of Sensor", "default": "", "examples": [ "e0d5120b-90f1-48d6-a47f-f8ccd7727b04" ], "pattern": "^(.*)$" } } } }, "actuationCommands": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/actuationCommands", "type": "array", "title": "The ActuationCommands Array Schema", "default": null, "items": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/actuationCommands/items", "type": "object", "title": "The ActuationCommand Schema", "default": null, "required": [ "actuationCommandTime", "actuationCommandId", "actuatorId" ], "oneOf": [ {"required": ["value"]}, {"required": ["valueString"]}, {"required": ["valueBoolean"]} ], "properties": { "actuationCommandTime": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/actuationCommands/items/properties/actuationCommandTime", "type": "string", "title": "The ActuationCommandTime Schema", "description": "DateTime of ActuationCommand (ISO 8601 UTC)", "default": "", "examples": [ "2019-05-27T20:07:49Z" ], "pattern": "^(.*)$", "format": null }, "actuationCommandId": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/actuationCommands/items/properties/actuationId", "type": "string", "title": "The ActuationCommandId Schema", "description": "IRI or ID of Actuation", "default": "", "examples": [ "267b6a9b-e3fd-4809-b526-2" ], "pattern": "^(.*)$" }, "actuatorId": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/actuationCommands/items/properties/actuatorId", "type": "string", "title": "The ActuatorId Schema", "description": "IRI or ID of Actuator", "default": "", "examples": [ "https://recref.com/actuator/a49feda7-2bc3-4793-b87f-8ec0c3909f9b/actuation/267b6a9b-e3fd-4809-b526-2" ], "pattern": "^(.*)$" }, "value": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/actuationCommands/items/properties/value", "type": "number", "title": "The Value Schema", "description": "Value to be actuated, validated with ActuationInterface", "default": "", "examples": [ 16.1 ] }, "valueString": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/actuationCommands/items/properties/valueString", "type": "string", "title": "The ValueString Schema", "description": "Value to be actuated, validated with ActuationInterface", "default": "", "examples": [ "open" ], "pattern": "^(.*)$" }, "valueBoolean": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/actuationCommands/items/properties/valueBoolean", "type": "boolean", "title": "The ValueBoolean Schema", "description": "Value to be actuated, validated with ActuationInterface", "default": "", "examples": [ false ] } } } }, "actuationResponses": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/actuationResponses", "type": "array", "title": "The ActuationResponses Array Schema", "default": null, "items": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/actuationResponses/items", "type": "object", "title": "The ActuationResponse Schema", "default": null, "required": [ "actuatorId", "actuationCommandId", "responseCode", "actuationResponseTime" ], "properties": { "actuatorId": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/actuationResponses/items/properties/actuatorId", "type": "string", "title": "The ActuatorId Schema", "description": "IRI or ID of Actuator", "default": "", "examples": [ "https://recref.com/actuator/a49feda7-2bc3-4793-b87f-8ec0c3909f9b/" ], "pattern": "^(.*)$" }, "actuationCommandId": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/actuationResponses/items/properties/actuationId", "type": "string", "title": "The ActuationId Schema", "description": "IRI or ID of Actuation", "default": "", "examples": [ "https://recref.com/actuator/a49feda7-2bc3-4793-b87f-8ec0c3909f9b/actuation/267b6a9b-e3fd-4809-b526-2" ], "pattern": "^(.*)$" }, "responseCode": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/actuationResponses/items/properties/responseCode", "type": "string", "title": "The ResponseCode Schema", "description": "Response code from actuator", "default": "", "enum": [ "success", "rejected", "none" ], "examples": [ "success", "rejected", "none" ], "pattern": "^(.*)$" }, "actuationResponseTime": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/actuationResponses/items/properties/actuationResponseTime", "type": "string", "title": "The ActuationResponseTime Schema", "description": "Time of ActuationResponse, ISO 8601 UTC", "default": "", "examples": [ "2019-05-27T20:07:54Z" ], "pattern": "^(.*)$", "format": null } } } }, "exceptions": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/exceptions", "type": "array", "title": "The Exceptions Array Schema", "default": null, "items": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/exceptions/items", "type": "object", "title": "The Exception Schema", "default": null, "required": [ "exceptionTime", "origin", "id", "retry" ], "properties": { "exceptionTime": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/exceptions/items/properties/exceptionTime", "type": "string", "title": "The ExceptionTime Schema", "description": "Time of Exception, ISO 8601 UTC", "default": "", "examples": [ "2019-05-27T20:08:14Z" ], "pattern": "^(.*)$", "format": null }, "origin": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/exceptions/items/properties/origin", "type": "string", "title": "The Origin Schema", "description": "The type of device from where the exception originates. \"sensor\" if exception when making observation, \"actuator\" if exception while making actuation", "default": "", "enum": [ "sensor", "actuator", "device" ], "examples": [ "sensor", "actuator", "device" ], "pattern": "^(.*)$" }, "id": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/exceptions/items/properties/id", "type": "string", "title": "The Id Schema", "description": "IRI or ID of device, sensor or actuator from where the exception originates", "default": "", "examples": [ "https://recref.com/actuator/a49feda7-2bc3-4793-b87f-8ec0c3909f9b/" ], "pattern": "^(.*)$" }, "exception": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/exceptions/items/properties/exception", "type": "string", "title": "The ExceptionMessage Schema", "description": "exceptionMessage, more info about exception", "default": "", "examples": [ "Sensor timed out" ], "pattern": "^(.*)$" }, "retry": { "$id": "https://w3id.org/rec/edge_message/3.3/#/properties/exceptions/items/properties/retry", "type": "integer", "title": "The Retry Count Schema", "description": "Number of retries, if it is a repeating exception", "default": 1, "examples": [ 3 ], "minimum": 1.0 } } } } } }