private void handleEntityDataParsingResult(Optional<OWLEntityData> result, PrimitiveDataParserCallback callback, String trimmedContent, Optional<String> lang, Set<PrimitiveType> allowedTypes) {
if (result.isPresent()) {
callback.onSuccess(Optional.<OWLPrimitiveData>of(result.get()));
}
else if (allowedTypes.contains(PrimitiveType.IRI) && isAbsoluteIRI(trimmedContent)) {
IRIData iriData = new IRIData(IRI.create(trimmedContent));
callback.onSuccess(Optional.<OWLPrimitiveData>of(iriData));
}
else if (allowedTypes.contains(PrimitiveType.LITERAL)) {
OWLLiteralData literalData = parseLiteralData(trimmedContent, lang);
callback.onSuccess(Optional.<OWLPrimitiveData>of(literalData));