Search in sources :

Example 1 with OWLEntityRemover

use of org.semanticweb.owlapi.util.OWLEntityRemover in project webprotege by protegeproject.

the class DeleteEntityChangeListGenerator method generateChanges.

@Override
public OntologyChangeList<OWLEntity> generateChanges(ChangeGenerationContext context) {
    OntologyChangeList.Builder<OWLEntity> builder = new OntologyChangeList.Builder<>();
    OWLEntityRemover remover = new OWLEntityRemover(rootOntology.getImportsClosure());
    entity.accept(remover);
    List<RemoveAxiom> changeList = remover.getChanges();
    builder.addAll(changeList);
    return builder.build(entity);
}
Also used : OntologyChangeList(edu.stanford.bmir.protege.web.server.change.OntologyChangeList) OWLEntity(org.semanticweb.owlapi.model.OWLEntity) OWLEntityRemover(org.semanticweb.owlapi.util.OWLEntityRemover) RemoveAxiom(org.semanticweb.owlapi.model.RemoveAxiom)

Example 2 with OWLEntityRemover

use of org.semanticweb.owlapi.util.OWLEntityRemover in project webprotege by protegeproject.

the class DeleteEntitiesChangeListGenerator method generateChanges.

@Override
public OntologyChangeList<Set<OWLEntity>> generateChanges(ChangeGenerationContext context) {
    generateMessage();
    OWLEntityRemover entityRemover = new OWLEntityRemover(rootOntology.getImportsClosure());
    entities.forEach(entity -> entity.accept(entityRemover));
    return OntologyChangeList.<Set<OWLEntity>>builder().addAll(entityRemover.getChanges()).build(entities);
}
Also used : ImmutableSet(com.google.common.collect.ImmutableSet) Set(java.util.Set) OWLEntityRemover(org.semanticweb.owlapi.util.OWLEntityRemover)

Aggregations

OWLEntityRemover (org.semanticweb.owlapi.util.OWLEntityRemover)2 ImmutableSet (com.google.common.collect.ImmutableSet)1 OntologyChangeList (edu.stanford.bmir.protege.web.server.change.OntologyChangeList)1 Set (java.util.Set)1 OWLEntity (org.semanticweb.owlapi.model.OWLEntity)1 RemoveAxiom (org.semanticweb.owlapi.model.RemoveAxiom)1