OpenWIS / openwis

http://openwis.github.io/openwis
GNU General Public License v3.0
11 stars 15 forks source link

Metadata sync error - <gmd:dateStamp> not extracted when the child node is <gco:Date> #98

Closed ywang-bom closed 8 years ago

ywang-bom commented 9 years ago

Description

Over 600 metadata records from GISC Offenbach failed to be imported and the error message was Unable to extract an URN or a datestamp from the metadata record. An example of these metadata file can be found at http://oai.dwd.de/oai/provider?metadataPrefix=iso19139&set=WIS-GISC-OFFENBACH&verb=GetRecord&identifier=urn:x-wmo:md:int.eumetsat:EO:EUM:DAT:MFG:HPI-IODC

Analysis

Based on initial research, the problem is due to the dateStamp element is expressed as a <gco:Date> element instead of <gco:DateTime>. OpenWIS extracts the URN and dateStamp information by using a XSL transformation. The class that does the transformation is MetadataAligner and the XSL file is extract-import-info.xsl.

The XSL file only searches for element of gmd:dateStamp/gco:DateTime. Thus it gives an empty string is the dateStamp is represented by gmd:dateStamp/gco:Date. This in turn leads to the failure of extracting dateStamp information, which is the cause of the above mentioned error message.

The ISO 19139 standard and WMO Core Metadata Profile 1.3 do allow both <gco:DateTime> and <gco:Date> to be used for the <gmd:dateStamp> element. So it would be helpful to modify the OpenWIS code to accomodate both representations.

Proposed Fix

The XSL file can be modified to geberate the dateStamp node as an union of <gco:Date> and <gco:DateTime>. Specifically the following line

<xsl:value-of select="gmd:dateStamp/gco:DateTime"/>

should be change to

<xsl:value-of select="gmd:dateStamp/gco:DateTime | gmd:dateStamp/gco:Date"/>
ywang-bom commented 9 years ago

A pull request (#99) is created with a fix for the issue.

lmika-bom commented 8 years ago

Closing this issue as PR #99 which fixes this has been merged.