use of org.semanticweb.owlapi.change.AxiomChangeData in project webprotege by protegeproject.
the class EntitiesByRevisionCache method getEntitiesInternal.
private ImmutableSet<OWLEntity> getEntitiesInternal(Revision revision) {
ImmutableSet.Builder<OWLEntity> result = ImmutableSet.builder();
Set<IRI> iris = new HashSet<>();
for (OWLOntologyChangeRecord change : revision) {
if (change.getData() instanceof AxiomChangeData) {
OWLAxiom ax = ((AxiomChangeData) change.getData()).getAxiom();
java.util.Optional<? extends OWLObject> subject = axiomSubjectProvider.getSubject(ax);
if (subject.isPresent()) {
if (subject.get() instanceof OWLEntity) {
result.add((OWLEntity) subject.get());
} else if (subject.get() instanceof IRI) {
iris.add((IRI) subject.get());
}
}
}
}
for (IRI iri : iris) {
for (EntityType<?> entityType : EntityType.values()) {
OWLEntity entity = dataFactory.getOWLEntity(entityType, iri);
if (hasContainsEntityInSignature.containsEntityInSignature(entity)) {
result.add(entity);
}
}
}
return result.build();
}
Aggregations