All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nlp2rdf.validator.NIFBeanMentionValidator Maven / Gradle / Ivy

There is a newer version: 0.4.1
Show newest version
package org.nlp2rdf.validator;


import org.nlp2rdf.bean.NIFBean;
import org.nlp2rdf.bean.NIFType;
import org.nlp2rdf.exception.NIFException;

import java.util.List;

public class NIFBeanMentionValidator implements NIFMessagesException {

    public static void checkIfContextExists(List beans) {
        if (!beans.stream().filter(bean -> NIFType.CONTEXT.equals(bean.getNifType())).findFirst().isPresent()) {
            throw new NIFException(NIF_STRUCTURE_CONTEXT_NOT_FOUND);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy