Search in sources :

Example 1 with EntityDeprecatedChangedEvent

use of edu.stanford.bmir.protege.web.shared.event.EntityDeprecatedChangedEvent in project webprotege by protegeproject.

the class EntityDeprecatedChangedEventTranslator method translateOntologyChanges.

@Override
public void translateOntologyChanges(Revision revision, ChangeApplicationResult<?> changes, List<ProjectEvent<?>> projectEventList) {
    for (OWLOntologyChange change : changes.getChangeList()) {
        if (change.isAxiomChange()) {
            if (change.getAxiom() instanceof OWLAnnotationAssertionAxiom) {
                OWLAnnotationAssertionAxiom axiom = (OWLAnnotationAssertionAxiom) change.getAxiom();
                if (axiom.getProperty().isDeprecated()) {
                    if (axiom.getSubject() instanceof IRI) {
                        IRI subject = (IRI) axiom.getSubject();
                        for (OWLEntity entity : hasGetEntitiesWithIRI.getEntitiesWithIRI(subject)) {
                            boolean deprecated = deprecatedEntityChecker.isDeprecated(entity);
                            projectEventList.add(new EntityDeprecatedChangedEvent(projectId, entity, deprecated));
                        }
                    }
                }
            }
        }
    }
}
Also used : OWLAnnotationAssertionAxiom(org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom) HasGetEntitiesWithIRI(edu.stanford.bmir.protege.web.shared.HasGetEntitiesWithIRI) IRI(org.semanticweb.owlapi.model.IRI) EntityDeprecatedChangedEvent(edu.stanford.bmir.protege.web.shared.event.EntityDeprecatedChangedEvent) OWLOntologyChange(org.semanticweb.owlapi.model.OWLOntologyChange) OWLEntity(org.semanticweb.owlapi.model.OWLEntity)

Aggregations

HasGetEntitiesWithIRI (edu.stanford.bmir.protege.web.shared.HasGetEntitiesWithIRI)1 EntityDeprecatedChangedEvent (edu.stanford.bmir.protege.web.shared.event.EntityDeprecatedChangedEvent)1 IRI (org.semanticweb.owlapi.model.IRI)1 OWLAnnotationAssertionAxiom (org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom)1 OWLEntity (org.semanticweb.owlapi.model.OWLEntity)1 OWLOntologyChange (org.semanticweb.owlapi.model.OWLOntologyChange)1