use of org.semanticweb.owlapi.model.OWLOntologyID in project protege-client by protegeproject.
the class ShowUncommittedChangesAction method displayUncommittedChanges.
private void displayUncommittedChanges(OWLOntology ontology, List<OWLOntologyChange> uncommitted) {
String shortOntologyName = "";
OWLOntologyID ontologyId = ontology.getOntologyID();
if (!ontologyId.isAnonymous()) {
shortOntologyName = ontology.getOntologyID().getOntologyIRI().get().getRemainder().get();
}
if (shortOntologyName.isEmpty()) {
shortOntologyName = ontologyId.toString();
}
ChangeListTableModel tableModel = new ChangeListTableModel(uncommitted);
JTable table = new JTable(tableModel);
table.setDefaultRenderer(OWLObject.class, new OWLCellRenderer(getOWLEditorKit()));
JScrollPane pane = new JScrollPane(table);
JDialog dialog = new JDialog((Frame) SwingUtilities.getAncestorOfClass(Frame.class, getOWLWorkspace()));
dialog.setTitle("Uncommitted changes for " + shortOntologyName);
dialog.getContentPane().add(pane);
dialog.setResizable(true);
dialog.setModal(true);
dialog.pack();
dialog.setVisible(true);
}
use of org.semanticweb.owlapi.model.OWLOntologyID in project webprotege by protegeproject.
the class ModifiedProjectOntologiesCalculator_TestCase method shouldIgnoreAnonymousOntologies.
@Test
public void shouldIgnoreAnonymousOntologies() {
when(projectOntology.getOntologyID()).thenReturn(new OWLOntologyID());
when(externalOntology.getOntologyID()).thenReturn(new OWLOntologyID());
assertThat(calculator.getModifiedOntologyDiffs(), is(empty()));
}
use of org.semanticweb.owlapi.model.OWLOntologyID in project webprotege by protegeproject.
the class ModifiedProjectOntologiesCalculator_TestCase method shouldNotPerformDiffForDifferentOntologyIRIs.
@Test
public void shouldNotPerformDiffForDifferentOntologyIRIs() {
OWLOntologyID projectOntologyId = new OWLOntologyID(Optional.of(IRI.create("http://ontology.iri.a")), Optional.absent());
when(projectOntology.getOntologyID()).thenReturn(projectOntologyId);
OWLOntologyID externalOntologyId = new OWLOntologyID(Optional.of(IRI.create("http://ontology.iri.b")), Optional.absent());
when(externalOntology.getOntologyID()).thenReturn(externalOntologyId);
assertThat(calculator.getModifiedOntologyDiffs(), is(empty()));
}
use of org.semanticweb.owlapi.model.OWLOntologyID in project webprotege by protegeproject.
the class WebProtegeOntologyIRIShortFormProvider_TestCase method setUp.
@Before
public void setUp() throws Exception {
iri = IRI.create("http://stuff");
ontologyId = new OWLOntologyID(iri);
when(rootOntology.getOntologyID()).thenReturn(ontologyId);
}
use of org.semanticweb.owlapi.model.OWLOntologyID in project webprotege by protegeproject.
the class OntologyIdData_CustomFieldSerializer method instantiate.
public static OntologyIdData instantiate(SerializationStreamReader streamReader) throws SerializationException {
boolean anonymous = streamReader.readBoolean();
OWLOntologyID ontologyID;
if (!anonymous) {
IRI ontologyIRI = IRI.create(streamReader.readString());
String versionIRIString = streamReader.readString();
IRI versionIRI;
if (versionIRIString.isEmpty()) {
versionIRI = null;
} else {
versionIRI = IRI.create(versionIRIString);
}
ontologyID = new OWLOntologyID(ontologyIRI, versionIRI);
} else {
ontologyID = new OWLOntologyID();
}
String browserText = streamReader.readString();
return new OntologyIdData(ontologyID, browserText);
}
Aggregations