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

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

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

import java.util.Optional;
import java.util.stream.Stream;

import javax.annotation.Nullable;

import org.semanticweb.owlapi.model.OWLAxiom;
import org.semanticweb.owlapi.model.OWLEntity;

/**
 * Wrapper around an OWLAxiom to hold attributes such as used, included in a
 * module, included in search space and atom which contains it.
 * 
 * @author ignazio
 */
public class AxiomWrapper {

    private OWLAxiom axiom;
    private boolean used = true;
    private boolean searchspace;
    private boolean module;
    private OntologyAtom atom;
    private int id;

    /**
     * @param axiom
     *        axiom to wrap
     */
    public AxiomWrapper(OWLAxiom axiom) {
        this.axiom = axiom;
    }

    /**
     * @param id
     *        id for the wrapper
     */
    public void setId(int id) {
        this.id = id;
    }

    /** @return id */
    public int getId() {
        return id;
    }

    /**
     * @return signature of the axiom, or empty if no axiom is set
     */
    public Stream signature() {
        if (axiom != null) {
            return axiom.signature();
        }
        return Stream.empty();
    }

    /** @return wrapped axiom */
    public OWLAxiom getAxiom() {
        return axiom;
    }

    /**
     * @param b
     *        value for used
     */
    public void setUsed(boolean b) {
        used = b;
    }

    /** @return value for used */
    public boolean isUsed() {
        return used;
    }

    /**
     * @param b
     *        value for in search space
     */
    public void setInSearchSpace(boolean b) {
        searchspace = b;
    }

    /** @return true if in search space */
    public boolean isInSearchSpace() {
        return searchspace;
    }

    /**
     * @param b
     *        value for in module
     */
    public void setInModule(boolean b) {
        module = b;
    }

    /** @return true if in module */
    public boolean isInModule() {
        return module;
    }

    /**
     * @param atom
     *        atom including the axiom
     */
    public void setAtom(@Nullable OntologyAtom atom) {
        this.atom = atom;
    }

    /** @return the including atom */
    public Optional getAtom() {
        return Optional.ofNullable(atom);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy