You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Overview

The DataWare import function (<importType>DataWare</importType>) imports data from REST services that return XML content.

The REST Service URLs look as follows http://servername:portnumber/rest/read/data/parameter/startdate/enddate/location

Configuring the Import

To make the importer known to FEWS, the import module has to be declared in the moduleInstanceDescriptors.xml in the RegionConfigFiles directory of the FEWS configuration:

<?xml version="1.0" encoding="UTF-8"?>
<moduleInstanceDescriptors xmlns="http://www.wldelft.nl/fews"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
		xsi:schemaLocation="http://www.wldelft.nl/fews
		http://fews.wldelft.nl/schemas/version1.0/moduleInstanceDescriptors.xsd" version="1.0">
...
	<moduleInstanceDescriptor id="ImportDataWare">
		<moduleId>TimeSeriesImportRun</moduleId>
	</moduleInstanceDescriptor>
...
</moduleInstanceDescriptors>

 

An example of the DataWare import configuration will be given here. The importType is named DataWare which should be configured in the general section of the import. De URL to the rest service should be configured here as well. The actual data to be retrieved can be tuned by adding setting the relativeViewPeriod and the timeSeries to specify the locations and parameters.
TimeZone is assumed to be configured in the general section, otherwise GMT is assumed.

<?xml version="1.0" encoding="UTF-8"?>
<timeSeriesImportRun xmlns="http://www.wldelft.nl/fews" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xsi:schemaLocation="http://www.wldelft.nl/fews 
	http://fews.wldelft.nl/schemas/version1.0/timeSeriesImportRun.xsd">
	<import>
		<general>
			<importType>DataWare</importType>
			<serverUrl>http://hostname:port/rest/read/data/</serverUrl>
			<relativeViewPeriod unit="hour" start="-6" end="3" startOverrulable="true" endOverrulable="true"/>
			<idMapId>IdImportDataWare</idMapId>
		</general>
		<timeSeriesSet>
			<moduleInstanceId>ImportDataWare</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>19839</parameterId>
			<locationId>1ha</locationId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="nonequidistant" />
			<readWriteMode>add originals</readWriteMode>
		</timeSeriesSet>
	</import>
</timeSeriesImportRun>

The IdMapping configuration idImportDataWare.xml is very important because this maps the internal FEWS Id's to the DataWare Id's. An example IdMapping file for the DataWare importer is shown below. In this case the external 19839 parameter is mapped on the internal H.observed parameter. locations should be mapped as well.

<?xml version="1.0" encoding="UTF-8"?>
<idMap version="1.1" xmlns="http://www.wldelft.nl/fews"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.wldelft.nl/fews
http://fews.wldelft.nl/schemas/version1.0/idMap.xsd">
	....
	<parameter internal="H.observed" external="19839"/>
	....
</idMap>

Example XML response from DataWare service

 

<ArrayOfData xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Data><Key>19839</Key><Time>2014-11-01 00:00:00.000</Time><Value>58.2457</Value><Quality>29</Quality></Data>
...
  • No labels