The Common Alerting Protocol (CAP) import function (<importType>CapAlerts</importType> and <importType>CapAlert</importType>) import functions import time series with CAP messages. The Common Alerting Protocol (CAP) is a simple but general format for exchanging all-hazard emergency alerts and public warnings over all kinds of networks. Import of Common Alerting Protocol Version 1.2 is implemented, more information can be found at: http://docs.oasis-open.org/emergency/cap/v1.2/CAP-v1.2-os.html
There are two import types:
- CapAlerts: This imports the active Web feeds of CAP alerts; typically link to the XML content of the full CAP alert.
- CapAlert: This imports individual CAP alert messages.
CapAlerts Web Feeds
In general the CapAlers importType will be used in operational forecasting systems. This import type will import the Web feed with the links to the active CAP alert messages. A typical CAP web feed is an XML file with the following content (https://alerts.ncdr.nat.gov.tw/RssAtomFeed.ashx?AlertType=11)
The CapAlerts import function will import the <entry> elements and use the <link> element to find the active CAP messages.
The Delft FEWS import function for CAP web feeds looks as follows; the importType in the <general> section is CapAlerts. The <serverUrl> is required when using the importType; the other configurable elements will be covered in the CapAlert import below.
The Cap Alert messages can be imported from a server or from a local file. When downloaded from a server it is best to use the CapAlerts import as this import contains the links to the active CAP messages. For importing historic or already downloaded CAP messages the Capalert importType can be used. Importing CAP messages requires the following Delft-FEWS configuration files to be edited/added.
- CAP import module instance
- Parameters XML with enumeration of severity CAP element
- ID mapping of location ids
CAP Import module instance
The CAP import module instance is a standard Delft-FEWS import configuration file; example provided below.
This example imports CAP messages from the \CAP import folder of a local file system. an example CAP file is presented below.
From this file the following elements will be imported by FEWS.
- status: stored as time series property
- msgtype: stored as time series property
- responseType: stored as time series property
- urgency: stored as time series property
- severity: this is the imported time series value, after converting the severity string with a parameter enumeration
- certainty: stored as time series property
- effective: this is the date/time of the imported value
- expires: stored as time series property
- geocode: this is the location id of the imported series
The import module instance has a <property> element that is used for the geocode valueName. The property key = geoCodeValueName and the property value the geocode provided in the CAP file. If a geocode valueName is different from the configured property the CAP values will not be imported. It is therefore important to first check the CAP messages to import and copy the geocode value to the Delft-FEWS import module instance property. The property is addded as sometimes new geocodes are used that require different location id mapping files. The property element allows for filtering the imported CAP messages on correct id mapping tables.
As indicated above the sverity will be imported from the CAP messages. this severity will be a string that needs to be converted to a value on importing. This value is the actual time series value that will be stored in the FEWS database. The parameter of the time series will require an enumeration to do this value conversion on importing. a typical CAP parameter enumeration is provided below.
When the imported CAP time series is presented in the time series display table, the value will be automatically converted to the enumerated label.
When importing data from an external system, location ID mapping is a standard import process. An example of an ID mapping configuration file is provided below.