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

org.semanticweb.owlapitools.decomposition.AxiomSelector Maven / Gradle / Ivy

There is a newer version: 5.5.1
Show newest version
package org.semanticweb.owlapitools.decomposition;

import static org.semanticweb.owlapi.model.AxiomType.LOGICAL_AXIOMS_AND_DECLARATIONS_TYPES;
import static org.semanticweb.owlapi.util.OWLAPIStreamUtils.asList;

import java.util.List;
import org.semanticweb.owlapi.model.OWLAxiom;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.model.parameters.Imports;

/**
 * A filter for axioms
 *
 * @author ignazio
 */
public class AxiomSelector {

    private AxiomSelector() {
    }

    /**
     * @param o the ontology to filter
     * @return list of declarations and logical axioms
     */
    public static List selectAxioms(OWLOntology o) {
        return asList(LOGICAL_AXIOMS_AND_DECLARATIONS_TYPES.stream()
            .flatMap(type -> o.axioms(type, Imports.INCLUDED)));
    }

    /**
     * @param o axioms to wrap
     * @return axioms wrapped as AxiomWrapper
     */
    public static List wrap(List o) {
        return asList(o.stream().map(AxiomWrapper::new));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy