EBAS diffxml File Format

XML schema

The xml schema definition is also added to the extract on delivery (ebas_diffexport.xsd). There are basically three elements in the schema:

diffExport: General data for the extract (dbState: database state of extract, diffState: differential state of the extract). The diffExport element has two types of child elements:

deleted: data intervals that have been deleted between diffState and dbState.

added: data intervals that have been added between diffState and dbState.

Each of the data intervals has the attributes datasetKey, startTime and endTime.

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns:diffexport="http://ebas.nilu.no/EBAS_diffExport/V1.0"
   targetNamespace="http://ebas.nilu.no/EBAS_diffExport/V1.0"
   elementFormDefault="qualified">

   <xs:element name="diffExport" type="diffexport:diffExportType" />

   <xs:complexType name="diffExportType">
      <xs:sequence>
         <xs:element name="deleted" type="diffexport:dataIntervalType" minOccurs="0" maxOccurs="unbounded" />
         <xs:element name="added" type="diffexport:dataIntervalType" minOccurs="0" maxOccurs="unbounded" />
      </xs:sequence>
      <xs:attribute name="dbState" type="diffexport:timestampType" use="required"/>
      <xs:attribute name="diffState" type="diffexport:timestampType" use="required"/>
   </xs:complexType>

   <xs:simpleType name="timestampType">
      <xs:restriction base="xs:dateTime">
         <xs:pattern value=".*Z"/>
      </xs:restriction>
   </xs:simpleType>

    <xs:complexType name="dataIntervalType">
       <xs:attribute name="datasetKey" type="xs:integer" use="required"/>
       <xs:attribute name="startTime" type="diffexport:timestampType" use="required"/>
       <xs:attribute name="endTime" type="diffexport:timestampType" use="required"/>
    </xs:complexType>
</xs:schema>

How to use the diffxml format

The diffxml file has one deleted entry for each data interval that needs to be deleted from the last extract and one added entry for each data interval that needs to be added to the last extract. The added intervals are strictly not necessary for the data recipient because they correspond exactly to all the data files in the extract. The added elements are included for completeness.

Examples:
A data interval that just has been deleted from EBAS since the last extract, will only generate a deleted entry. A data interval that has been inserted into EBAS since the last extract, will only generate an added entry. A data interval that has been changed in EBAS since the last extract, will generate both a deleted and an added entry.

Example file:

<diffexport:diffExport xmlns:diffexport="http://ebas.nilu.no/EBAS_diffExport/V1.0" dbState="2016-02-17T13:00:00Z" diffState="2015-10-13T22:15:00Z">
   <diffexport:deleted datasetKey="195114559" startTime="2012-01-01T06:00:00Z" endTime="2013-01-01T06:00:00Z"/>
   <diffexport:deleted datasetKey="180103960" startTime="2011-01-01T06:00:00Z" endTime="2013-01-01T06:00:00Z"/>
   <diffexport:deleted datasetKey="180103961" startTime="2012-01-01T06:00:00Z" endTime="2013-01-01T06:00:00Z"/>
   <diffexport:added datasetKey="195114559" startTime="2012-01-01T06:00:00Z" endTime="2013-01-01T06:00:00Z"/>
   <diffexport:added datasetKey="180103960" startTime="2012-01-01T06:00:00Z" endTime="2013-01-01T06:00:00Z"/>
</diffexport:diffExport>
  • This example diffxml file belongs to a differential extract with the dbState of 17th February 2016 and a diffState of 13th October 2015 (the extract should contain all changes in the EBAS database between those two dates).
  • We see that a data interval for dataset 195114559 (2012 data) were deleted and substituted by a new version of the data.
  • For dataset 180103960 2011 and 2012 data should be deleted but only 2012 data are included in a newer version.
  • And for dataset 180103961, the 2012 data have been deleted without adding a newer version of the data.