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

org.protege.editor.owl.model.selection.axioms.ClassReferencingAxiomsStrategy Maven / Gradle / Ivy

package org.protege.editor.owl.model.selection.axioms;

import org.semanticweb.owlapi.model.OWLAxiom;
import org.semanticweb.owlapi.model.OWLClass;
import org.semanticweb.owlapi.model.OWLOntology;

import java.util.HashSet;
import java.util.Set;

/**
 * User: nickdrummond
 * Date: May 20, 2008
 */
public class ClassReferencingAxiomsStrategy extends EntityReferencingAxiomsStrategy {

    public String getName() {
        return "Axioms referencing a given class (or classes)";
    }

    public Set getAxioms(Set ontologies) {
        Set axioms = new HashSet<>();
        for (OWLClass cls : getEntities()){
            for (OWLOntology ont : ontologies){
                axioms.addAll(ont.getReferencingAxioms(cls));
            }
        }
        return axioms;
    }

    public Class getType() {
        return OWLClass.class;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy