data-models

Alert data model

This repository is now archived and subsequent works will be carried out the in Smart data models repositories. The latest version of this Data Model can be found at https://github.com/smart-data-models/dataModel.Alert

Description

This entity models an alert and could be used to send alerts related to traffic jam, accidents, weather conditions, high level of pollutants and so on. The purpose of the model is to support the generation of notifications for a user or trigger other actions, based on such alerts.

An alert is generated by a specific situation. The main features of an alert is that it is not predictable and it is not a recurrent data. That means that an alert could be an accident or a high level of pollutants measure, additionally it could be the fall down of a patient or a car driving in the opposite direction.

Some examples of context data are: type of alert (traffic, weather, security, and pollution, etc.), severity, location and so on.

Data model

A JSON Schema corresponding to this data model can be found here.

Note: JSON Schemas are intended to capture the data type and associated constraints of the different Attributes, regardless their final representation format in NGSI(v2, LD).

Examples

Normalized Example

Normalized NGSI response

{
    "id": "Alert:1",
    "type": "Alert",
    "category": {
        "value": "traffic"
    },
    "subCategory": {
        "value": "trafficJam"
    },
    "validTo": {
        "value": "2017-01-02T10:25:55.00Z"
    },
    "description": {
        "value": "The road is completely blocked for 3kms"
    },
    "location": {
        "type": "geo:json",
        "value": {
            "type": "Point",
            "coordinates": [-3.712247222222222, 40.423852777777775]
        }
    },
    "dateIssued": {
        "type": "DateTime",
        "value": "2017-01-02T09:25:55.00Z"
    },
    "alertSource": {
        "value": "https://account.lab.fiware.org/users/8"
    },
    "validFrom": {
        "type": "DateTime",
        "value": "2017-01-02T09:25:55.00Z"
    },
    "severity": {
        "value": "high"
    }
}

key-value pairs Example

Sample uses simplified representation for data consumers ?options=keyValues

{
    "id": "VisualEvent123",
    "type": "Alert",
    "category": "security",
    "subCategory": "robbery",
    "location": {
        "type": "Point",
        "coordinates": [-3.712247222222222, 40.423852777777775]
    },
    "dateIssued": "2017-04-25T09:25:55.00Z",
    "description": "Potential robbery in main building",
    "alertSource": "Camera1234",
    "data": {
        "videoURL": "www.smartsecurity.com/video123.mp4",
        "initialFrame": "80",
        "finalFrame": "120"
    },
    "severity": "informational"
}

LD Example

Sample uses the NGSI-LD representation

{
    "id": "urn:ngsi-ld:Alert:Alert:1",
    "type": "Alert",
    "createdAt": "2019-06-06T12:06:06",
    "modifiedAt": "2019-06-07T12:07:06",
    "category": {
        "type": "Property",
        "value": "traffic"
    },
    "subCategory": {
        "type": "Property",
        "value": "trafficJam"
    },
    "validTo": {
        "type": "Property",
        "value": {
            "@type": "DateTime",
            "@value": "2017-01-02T10:25:55.00Z"
        }
    },
    "description": {
        "type": "Property",
        "value": "The road is completely blocked for 3kms"
    },
    "location": {
        "type": "GeoProperty",
        "value": {
            "type": "Point",
            "coordinates": [-3.712247222222222, 40.423852777777775]
        }
    },
    "dateIssued": {
        "type": "Property",
        "value": {
            "@type": "DateTime",
            "@value": "2017-01-02T09:25:55.00Z"
        }
    },
    "alertSource": {
        "type": "Property",
        "value": "https://account.lab.fiware.org/users/8"
    },
    "validFrom": {
        "type": "Property",
        "value": {
            "@type": "DateTime",
            "@value": "2017-01-02T09:25:55.00Z"
        }
    },
    "severity": {
        "type": "Property",
        "value": "high"
    },
    "@context": [
        "https://schema.lab.fiware.org/ld/context",
        "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld"
    ]
}

Use it with a real service

The model has been defined to support different scenarios inside SmartSDK project.

Open Issues

T.B.D