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

org.protege.editor.owl.ui.ontology.wizard.move.byreference.MoveAxiomsByReferenceKit Maven / Gradle / Ivy

Go to download

OWL ontology editing infrastructure used by the Protege desktop application.

The newest version!
package org.protege.editor.owl.ui.ontology.wizard.move.byreference;

import org.protege.editor.owl.ui.ontology.wizard.move.MoveAxiomsKit;
import org.protege.editor.owl.ui.ontology.wizard.move.MoveAxiomsKitConfigurationPanel;
import org.protege.editor.owl.ui.ontology.wizard.move.common.SignatureDependentSelectionPreviewPanel;
import org.protege.editor.owl.ui.ontology.wizard.move.common.SignatureSelection;
import org.semanticweb.owlapi.model.OWLAxiom;
import org.semanticweb.owlapi.model.OWLEntity;
import org.semanticweb.owlapi.model.OWLOntology;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/*
 * Copyright (C) 2008, University of Manchester
 *
 *
 */


/**
 * Author: Matthew Horridge
The University Of Manchester
Information Management Group
Date: * 23-Sep-2008

*/ public class MoveAxiomsByReferenceKit extends MoveAxiomsKit implements SignatureSelection { private Set selectedEntities; private SelectSignaturePanel selectSignaturePanel; private SignatureDependentSelectionPreviewPanel selectPreviewPanel; public List getConfigurationPanels() { List panels = new ArrayList<>(); panels.add(selectSignaturePanel); panels.add(selectPreviewPanel); return panels; } public Set getAxioms(Set sourceOntologies) { return getAxioms(sourceOntologies, selectedEntities); } public Set getAxioms(Set ontologies, Set entities) { Set result = new HashSet<>(); for (OWLEntity e : entities) { for(OWLOntology ont : ontologies) { result.addAll(ont.getReferencingAxioms(e)); result.addAll(ont.getAnnotationAssertionAxioms(e.getIRI())); } } return result; } public void initialise() throws Exception { selectedEntities = new HashSet<>(); selectSignaturePanel = new SelectSignaturePanel(this); selectPreviewPanel = new SignatureDependentSelectionPreviewPanel(this); } public void dispose() throws Exception { } public Set getSignature() { return selectedEntities; } public void setSignature(Set entities) { selectedEntities.clear(); selectedEntities.addAll(entities); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy