return getValueFactory().createText(content);
}
@Override
public Object createLiteral(String content, Locale language, URI type) {
DataTypeEnum dataType = type == null ? null : DataTypeEnum.getDataType(type.toString());
if(language != null){
if(type != null && !(DataTypeEnum.String == dataType || DataTypeEnum.Text == dataType)){
throw new IllegalArgumentException("Literals with a Lanugage MUST not have NULL,"+
DataTypeEnum.String.getShortName()+" or "+
DataTypeEnum.Text.getShortName()+" assigned as type!");
} else {
return getValueFactory().createText(content, language.getLanguage());
}
} else if(type != null){ //create a typed literal
if(dataType == null){ //the parsed type is an unknown data type
return content; //return an string
} else {
Object converted = valueConverter.convert(content, dataType.getUri(), getValueFactory());
if(converted == null){
log.debug("Unable to convert content '{}' to dataType '{}'",converted,dataType);
return content;
} else {
return converted;