use of edu.stanford.bmir.protege.web.shared.entity.IRIData in project webprotege by protegeproject.
the class PrimitiveDataParserImpl method handleEntityDataParsingResult.
private void handleEntityDataParsingResult(Optional<OWLEntityData> result, PrimitiveDataParserCallback callback, String trimmedContent, java.util.Optional<String> lang, Set<PrimitiveType> allowedTypes) {
if (result.isPresent()) {
callback.onSuccess(java.util.Optional.of(result.get()));
} else if (allowedTypes.contains(PrimitiveType.IRI) && isAbsoluteIRI(trimmedContent)) {
IRIData iriData = new IRIData(IRI.create(trimmedContent));
callback.onSuccess(java.util.Optional.of(iriData));
} else if (allowedTypes.contains(PrimitiveType.LITERAL)) {
OWLLiteralData literalData = parseLiteralData(trimmedContent, lang);
callback.onSuccess(java.util.Optional.of(literalData));
} else {
callback.parsingFailure();
}
}
Aggregations