/** * Normalization. If the value is narrower than the current data type * (e.g. value is xsd:date but the time is xsd:datetime) returns * the narrower type for the literal. * If the type is narrower than the value then it may normalize * the value (e.g. set the mask of an XSDDateTime) * Currently only used to narrow gener XSDDateTime objects * to the minimal XSD date/time type. * @param value the current object value * @param dt the currently set data type * @return a narrower version of the datatype based on the actual value range */ @Override public RDFDatatype normalizeSubType(Object value, RDFDatatype dt) { if (value instanceof XSDDateTime) { if (dt.equals(XSDDatatype.XSDdateTime)) { return ((XSDDateTime)value).getNarrowedDatatype(); } else if (dt instanceof XSDDatatype){ // We've externally narrowed the type, push this down to the date time ((XSDDateTime)value).narrowType((XSDDatatype)dt); } } return this; }