- (unless (member datatype (list (string-datatype) (iri-datatype)) :test #'string=)
- (occurrence-problem :unsupported-datatype "Only xsd:string and xsd:anyURI are supported."))
+ ;; TMDM 4.4/5.6: datatype is a locator, never a Topic or a whitelist.
+ (unless (absolute-locator-p datatype)
+ (occurrence-problem :invalid-datatype "Datatype must be a resolved absolute locator."))
+ (when (and (string= datatype (integer-datatype)) (not (integer-lexical-p value)))
+ (occurrence-problem :invalid-integer-value "Value is not an xsd:integer lexical form."))
+ (when (and (string= datatype (decimal-datatype)) (not (decimal-lexical-p value)))
+ (occurrence-problem :invalid-decimal-value "Value is not an xsd:decimal lexical form."))
+ (when (and (string= datatype (date-datatype)) (not (date-lexical-p value)))
+ (occurrence-problem :invalid-date-value "Value is not an XSD 1.0 date lexical form or valid Gregorian date."))
+ (when (and (string= datatype (datetime-datatype)) (not (datetime-lexical-p value)))
+ (occurrence-problem :invalid-datetime-value "Value is not an XSD 1.0 dateTime lexical form."))