edu.stanford.protege.webprotege.index.impl.EquivalentDataPropertiesAxiomsIndexImpl Maven / Gradle / Ivy
The newest version!
package edu.stanford.protege.webprotege.index.impl;
import edu.stanford.protege.webprotege.index.AxiomsByTypeIndex;
import edu.stanford.protege.webprotege.index.DependentIndex;
import edu.stanford.protege.webprotege.index.EquivalentDataPropertiesAxiomsIndex;
import edu.stanford.protege.webprotege.index.Index;
import org.semanticweb.owlapi.model.AxiomType;
import org.semanticweb.owlapi.model.OWLDataProperty;
import org.semanticweb.owlapi.model.OWLEquivalentDataPropertiesAxiom;
import org.semanticweb.owlapi.model.OWLOntologyID;
import javax.annotation.Nonnull;
import javax.inject.Inject;
import java.util.Collection;
import java.util.List;
import java.util.stream.Stream;
import static com.google.common.base.Preconditions.checkNotNull;
/**
* Matthew Horridge
* Stanford Center for Biomedical Informatics Research
* 2019-08-24
*/
public class EquivalentDataPropertiesAxiomsIndexImpl implements EquivalentDataPropertiesAxiomsIndex, DependentIndex {
@Nonnull
private final AxiomsByTypeIndex axiomsByTypeIndex;
@Inject
public EquivalentDataPropertiesAxiomsIndexImpl(@Nonnull AxiomsByTypeIndex axiomsByTypeIndex) {
this.axiomsByTypeIndex = checkNotNull(axiomsByTypeIndex);
}
@Nonnull
@Override
public Collection getDependencies() {
return List.of(axiomsByTypeIndex);
}
@Nonnull
@Override
public Stream getEquivalentDataPropertiesAxioms(@Nonnull OWLDataProperty property,
@Nonnull OWLOntologyID ontologyId) {
checkNotNull(ontologyId);
checkNotNull(property);
return axiomsByTypeIndex.getAxiomsByType(AxiomType.EQUIVALENT_DATA_PROPERTIES, ontologyId)
.filter(ax -> ax.getProperties().contains(property));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy