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.

  • id : Entity's unique identifier.

  • type : Entity type. It must be equal to Alert.

  • source : A sequence of characters giving the source of the entity data.

    • Attribute type: Property. Text or URL
    • Optional
  • dataProvider : Specifies the URL to information about the provider of this information

    • Attribute type: Property. URL
    • Optional
  • category : Define the category of alert (Traffic jam, accidents, weather conditions, high level of pollutants)

    • Attribute type: Property. Text
    • Allowed values:
      • (traffic, naturalDisaster, weather, environment, health, security, agriculture)
    • Mandatory
  • subCategory : Describe the sub category of alert.

    • Attribute type: Property. Text
    • Allowed values:
      • (trafficJam, carAccident, carWrongDirection, carStopped, pothole, roadClosed, roadWorks, hazardOnRoad, injuredBiker) (for traffic category)
      • (flood, tsunami, coastalEvent, earthquake) (for naturalDisaster category)
      • (rainfall, highTemperature, lowTemperature, heatWave, coldWave, ice, snow, wind, fog, tornado, tropicalCyclone, hurricane, snow/ice, thunderstorms, fireRisk, avalancheRisk, floodRisk) (for weather category)
      • (airPollution, waterPollution, pollenConcentration) (for environment category)
      • (asthmaAttack, bumpedPatient, fallenPatient, heartAttack ) (for health category)
      • (suspiciousAction, robbery, assault, civilDisorder, buildingFire, forestFire) (for security category)
      • (noxiousWeed, snail, insect, rodent, bacteria, microbe, fungus,mite, virus, nematodes, irrigation, fertilisation) (for agriculture category)
    • Optional
  • location : Location of alert represented by a GeoJSON geometry.

    • Attribute type: GeoProperty. geo:json.
    • Normative References: rfc7946
    • Mandatory if address is not present
  • address : Civic address of Alert

  • dateIssued : The date and time the alert was issued by the alert generator in ISO8601 UTC format.

    • Attribute type: Property. DateTime.
    • Normative References: ISO8601
    • Mandatory
  • validFrom : The start date of validity of the alert in ISO8601 UTC format.

    • Attribute type: Property. DateTime.
    • Normative References: ISO8601
    • Optional
  • validTo : The end date of validity of the alert in ISO8601 UTC format.

    • Attribute type: Property. DateTime.
    • Normative References: ISO8601
    • Optional
  • description : A description of alert (e.g. Traffic jam in Paseo de la Reforma. Emergency services at place).

    • Attribute type: Property. Text
    • Normative References: https://uri.etsi.org/ngsi-ld/description equivalent to description
    • Optional
  • alertSource : reference to the source of the alert. For example, it could be a user of an application, a device, or a service.

    • Attribute type: Property. Text or URL
    • Mandatory.
  • data : used to carry additional data for the alert.

  • severity : define the level of gravity of a given alert.

    • Attribute type: Property. Text
    • Allowed values:
      • (informational, low, medium, high, critical)
    • Optional.

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