Skip to content

Latest commit

 

History

History
429 lines (383 loc) · 13.1 KB

README.md

File metadata and controls

429 lines (383 loc) · 13.1 KB

Weather Forecast

Description

This entity contains a harmonised description of a Weather Forecast. This entity is primarily associated with the vertical segments of the environment and agriculture but is applicable to many different applications.

This data model has been developed in cooperation with mobile operators and the GSMA.

You can see a description of weather forecast parameters provided by AEMET (in Spanish) here.

Data Model

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

  • id : Unique identifier.

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

  • dataProvider : Specifies the URL to information about the provider of this information

    • Attribute type: Property. URL
    • Optional
  • dateModified : Last update timestamp of this entity.

    • Attribute type: Property. DateTime
    • Read-Only. Automatically generated.
  • dateCreated : Entity's creation timestamp.

    • Attribute type: Property. DateTime
    • Read-Only. Automatically generated.
  • name : Name given to the weather forecast location.

    • Attribute type: Property. Text
    • Normative References: https://uri.etsi.org/ngsi-ld/name equivalent to name
    • Optional
  • location : Location of the weather observation represented by a GeoJSON geometry.

  • address : Civic address of the weather forecast.

  • dateRetrieved : The date and time the forecast was retrieved in ISO8601 UTC format.

    • Attribute type: Property. DateTime.
    • Mandatory
  • dateIssued : The date and time the forecast was issued by the meteorological bureau in ISO8601 UTC format.

    • Attribute type: Property. DateTime.
    • Mandatory
  • validity : Includes the validity period for this forecast as a ISO8601 time interval. As a workaround for the lack of support of Orion Context Broker for datetime intervals, it can be used two separate attributes: validFrom, validTo.

    • Attribute type: Property. Text
    • Mandatory
  • validFrom : Validity period start date and time.

    • Attribute type: Property. DateTime.
    • Optional
  • validTo : Validity period end date and time.

    • Attribute type: Property. DateTime.
    • Optional
  • source : A sequence of characters giving the source of the entity data.

    • Attribute type: Property. Text or URL
    • Optional
  • refPointOfInterest : A reference to a point of interest associated to this forecast.

    • Attribute type: Relationship. Reference to an entity of type PointOfInterest
    • Optional
  • weatherType : The forecasted weather type.

  • visibility : Visibility forecasted.

  • temperature : Air's temperature forecasted.

  • feelsLikeTemperature : Feels like temperature forecasted.

    • Attribute type: Property. Number
    • Default unit: Degrees centigrades.
    • Optional
  • relativeHumidity : Air's relative humidity forecasted (percentage, expressed in parts per one).

  • precipitationProbability : The probability of precipitation, expressed as a number between 0 ≤ precipitationProbability ≤ 1.

    • Attribute type: Property. Number
    • Optional
  • windDirection : Wind direction forecasted

  • windSpeed : Wind speed forecasted.

  • dayMinimum : Minimum values forecasted for the reported period.

    • Attribute type: Property. StructuredValue
    • Subattributes:
      • temperature : Minimum temperature. Same semantics and units as WeatherForecast.temperature.
      • feelLikesTemperature. Minimum feels like temperature. Same semantics and units as WeatherForecast.feelsLikeTemperature.
      • relativeHumidity. Minimum relative humidity. Same semantics and units as WeatherForecast.relativeHumidity.
    • Optional
  • dayMaximum : Maximum values for the reported period.

    • Attribute type: Property. StructuredValue
    • Subattributes:
      • temperature : Maximum temperature. See WeatherForecast.temperature for description and units.
      • feelLikesTemperature. Maximum feels like temperature. Same semantics and units as WeatherForecast.feelsLikeTemperature.
      • relativeHumidity. Maximum relative humidity. Same semantics and units as WeatherForecast.relativeHumidity.
  • uVIndexMax : The maximum UV index for the period, based on the World Health Organization's UV Index measure.

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

curl -X GET \
  'https://streams.lab.fiware.org/v2/entities?id=Spain-WeatherForecast-28079_tomorrow_18:00:00_00:00:00&options=keyValues' \
  -H 'fiware-service: weather'| python -m json.tool
[
    {
        "address": {
            "addressCountry": "ES",
            "addressLocality": "Madrid",
            "postalCode": "28079"
        },
        "dataProvider": "FIWARE",
        "dateIssued": "2019-06-13T00:00:00.00Z",
        "dateRetrieved": "2019-06-13T12:42:59.00Z",
        "dayMaximum": {
            "feelsLikeTemperature": 26,
            "relativeHumidity": 0.4,
            "temperature": 26
        },
        "dayMinimum": {
            "feelsLikeTemperature": 14,
            "relativeHumidity": 0.15,
            "temperature": 14
        },
        "feelsLikeTemperature": 16,
        "id": "Spain-WeatherForecast-28079_tomorrow_18:00:00_00:00:00",
        "precipitationProbability": 0,
        "relativeHumidity": 0.4,
        "source": "http://www.aemet.es",
        "temperature": 16,
        "type": "WeatherForecast",
        "validFrom": "2019-06-14T18:00:00.00Z",
        "validTo": "2019-06-15T00:00:00.00Z",
        "validity": "2019-06-14T18:00:00Z/2019-06-15T00:00:00Z",
        "weatherType": "sunnyDay",
        "windDirection": 90,
        "windSpeed": 4.2
    }
]

Normalized Example

Normalized NGSI response

{
    "id": "Spain-WeatherForecast-46005_2016-12-01T18:00:00_2016-12-02T00:00:00",
    "type": "WeatherForecast",
    "dayMinimum": {
        "value": {
            "feelsLikeTemperature": 11,
            "temperature": 11,
            "relativeHumidity": 0.7
        }
    },
    "feelsLikeTemperature": {
        "value": 12
    },
    "dataProvider": {
        "value": "TEF"
    },
    "temperature": {
        "value": 12
    },
    "validTo": {
        "type": "DateTime",
        "value": "2016-12-01T23:00:00.00Z"
    },
    "weatherType": {
        "value": "overcast"
    },
    "precipitationProbability": {
        "value": 0.15
    },
    "dayMaximum": {
        "value": {
            "feelsLikeTemperature": 15,
            "temperature": 15,
            "relativeHumidity": 0.9
        }
    },
    "source": {
        "value": "http://www.aemet.es/xml/municipios/localidad_46250.xml"
    },
    "windSpeed": {
        "value": 0
    },
    "validity": {
        "value": "2016-12-01T18:00:00+01:00/2016-12-02T00:00:00+01:00"
    },
    "dateIssued": {
        "type": "DateTime",
        "value": "2016-12-01T10:40:01.00Z"
    },
    "address": {
        "type": "PostalAddress",
        "value": {
            "addressCountry": "Spain",
            "postalCode": "46005",
            "addressLocality": "Valencia"
        }
    },
    "dateRetrieved": {
        "type": "DateTime",
        "value": "2016-12-01T12:57:24.00Z"
    },
    "validFrom": {
        "type": "DateTime",
        "value": "2016-12-01T17:00:00.00Z"
    },
    "relativeHumidity": {
        "value": 0.85
    }
}

key-value pairs Example

Sample uses simplified representation for data consumers ?options=keyValues

{
    "id": "Spain-WeatherForecast-46005_2016-12-01T18:00:00_2016-12-02T00:00:00",
    "type": "WeatherForecast",
    "address": {
        "addressCountry": "Spain",
        "postalCode": "46005",
        "addressLocality": "Valencia"
    },
    "dataProvider": "TEF",
    "dateIssued": "2016-12-01T10:40:01.00Z",
    "dateRetrieved": "2016-12-01T12:57:24.00Z",
    "dayMaximum": {
        "feelsLikeTemperature": 15,
        "temperature": 15,
        "relativeHumidity": 0.9
    },
    "dayMinimum": {
        "feelsLikeTemperature": 11,
        "temperature": 11,
        "relativeHumidity": 0.7
    },
    "feelsLikeTemperature": 12,
    "precipitationProbability": 0.15,
    "relativeHumidity": 0.85,
    "source": "http://www.aemet.es/xml/municipios/localidad_46250.xml",
    "temperature": 12,
    "validFrom": "2016-12-01T17:00:00.00Z",
    "validTo": "2016-12-01T23:00:00.00Z",
    "validity": "2016-12-01T18:00:00+01:00/2016-12-02T00:00:00+01:00",
    "weatherType": "overcast",
    "windSpeed": 0
}

LD Example

Sample uses the NGSI-LD representation

{
    "id": "urn:ngsi-ld:WeatherForecast:Spain-WeatherForecast-46005_2016-12-01T18:00:00_2016-12-02T00:00:00",
    "type": "WeatherForecast",
    "dayMinimum": {
        "type": "Property",
        "value": {
            "feelsLikeTemperature": 11,
            "temperature": 11,
            "relativeHumidity": 0.7
        }
    },
    "feelsLikeTemperature": {
        "type": "Property",
        "value": 12
    },
    "dataProvider": {
        "type": "Property",
        "value": "TEF"
    },
    "temperature": {
        "type": "Property",
        "value": 12
    },
    "validTo": {
        "type": "Property",
        "value": {
            "@type": "DateTime",
            "@value": "2016-12-01T23:00:00.00Z"
        }
    },
    "weatherType": {
        "type": "Property",
        "value": "overcast"
    },
    "precipitationProbability": {
        "type": "Property",
        "value": 0.15
    },
    "dayMaximum": {
        "type": "Property",
        "value": {
            "feelsLikeTemperature": 15,
            "temperature": 15,
            "relativeHumidity": 0.9
        }
    },
    "source": {
        "type": "Property",
        "value": "http://www.aemet.es/xml/municipios/localidad_46250.xml"
    },
    "windSpeed": {
        "type": "Property",
        "value": 0
    },
    "validity": {
        "type": "Property",
        "value": "2016-12-01T18:00:00+01:00/2016-12-02T00:00:00+01:00"
    },
    "dateIssued": {
        "type": "Property",
        "value": {
            "@type": "DateTime",
            "@value": "2016-12-01T10:40:01.00Z"
        }
    },
    "address": {
        "type": "Property",
        "value": {
            "addressCountry": "Spain",
            "postalCode": "46005",
            "addressLocality": "Valencia",
            "type": "PostalAddress"
        }
    },
    "dateRetrieved": {
        "type": "Property",
        "value": {
            "@type": "DateTime",
            "@value": "2016-12-01T12:57:24.00Z"
        }
    },
    "validFrom": {
        "type": "Property",
        "value": {
            "@type": "DateTime",
            "@value": "2016-12-01T17:00:00.00Z"
        }
    },
    "relativeHumidity": {
        "type": "Property",
        "value": 0.85
    },
    "@context": [
        "https://schema.lab.fiware.org/ld/context",
        "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld"
    ]
}