Search in sources :

Example 1 with IRIData

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();
    }
}
Also used : IRIData(edu.stanford.bmir.protege.web.shared.entity.IRIData) OWLLiteralData(edu.stanford.bmir.protege.web.shared.entity.OWLLiteralData)

Aggregations

IRIData (edu.stanford.bmir.protege.web.shared.entity.IRIData)1 OWLLiteralData (edu.stanford.bmir.protege.web.shared.entity.OWLLiteralData)1