Skip to content
Permalink
1.3
Go to file
 
 
Cannot retrieve contributors at this time
49 lines (33 sloc) 3.57 KB

Dataset temporal date

Purpose: Test whether dates are expressed in accordance with ISO 8601 (yyyy-mm-dd).

Prerequisites

Test method

  • If a TimePeriod element exists, check whether all child elements contain a valid date.
  • If a date of publication is given at dateType='publication', check whether the date is valid
  • If a date of publication is given at dateType='revision', check whether the date is valid
  • If a date of publication is given at dateType='creation', check whether the date is valid
  • Check that beginPosition does not have attribute @frame (which means that the default reference system is used) and whether the date is valid
  • Check that endPosition does not have attribute @frame (which means that the default reference system is used) and whether the date is valid

The test case fails if any of the above steps returns false.

Reference(s)

Test type: Automated

Notes

The following regular expression can be used to check the validity of the date ^[0-9]{4}-[0-9]{2}-[0-9]{2}(T.*)?

TG MD requirement 24 indicates that only xs:date is allowed. However, the schema of gmd:CI_Date, which is used to express the publication, creation, or revision date, allows both a gco:Date and gco:DateTime as date values. gco:DateTime is actually used in the examples in TG MD. That is why the ETS accepts both xs:date and xs:dateTime as valid date values using the following approach_

  • It is checked that a gml:TimePeriod contains a valid xs:date or xs:dateTime. xs:gYearMonth, xs:gYear, xs:time, xs:anyUri, xs:decimal are considered to be invalid representations of a date.
  • The regular expression given above (^[0-9]{4}-[0-9]{2}-[0-9]{2}(T.*)?) is not used in the ETS. The implementation relies on type constructors xs:date and xs:dateTime, i.e. the implementation tries to parse the date value (as a string) to an xs:date or xs:dateTime.
  • The lack of a @frame attribute is also checked for the gml:TimePeriod / gml:TimeInstant and gml:timePositon elements.

##Contextual XPath references

The namespace prefixes used as described in README.md.

Abbreviation XPath expression (relative to gmd:MD_Metadata)
TimePeriod gmd:identificationInfo[1]/*/gmd:extent/*/gmd:temporalElement/*/gmd:extent/gml:TimePeriod
date gmd:identificationInfo[1]/*/gmd:citation/*/gmd:date
dateType gmd:identificationInfo[1]/*/gmd:citation/*/gmd:date/*/gmd:dateType
beginPosition gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition
endPosition gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:endPosition
You can’t perform that action at this time.