dummy.add(DATE.getName(), value);
Date date = dummy.getDate(DublinCore.DATE); //access parseDate(..)
if(date != null){ //now use the Clerezza Literal factory
object = lf.createTypedLiteral(date);
} else { //fall back to xsd:string
object = new TypedLiteralImpl(value, XSD.string);
}
} else {
object = new TypedLiteralImpl(value, ontType);
}
if(validate && clazz != null &&
!clazz.equals(Date.class)){ //we need not to validate dates
try {
lf.createObject(clazz,(TypedLiteral)object);
} catch (NoConvertorException e) {
log.info("Unable to validate typed literals of type {} because" +
"there is no converter for Class {} registered with Clerezza",
ontType,clazz);
} catch (InvalidLiteralTypeException e) {
log.info("The value '{}' is not valid for dataType {}!" +
"create literal with type 'xsd:string' instead",
value,ontType);
object = new TypedLiteralImpl(value, XSD.string);
}
} //else no validation needed
}
if(converter != null){
object = converter.convert(object);