SimpleOntologyValues { public static OWLOntologyID owlapiOntologyId(OntologyId simpleId) { if (simpleId == null) { return null; } if (simpleId instanceof SimpleOntologyId) { return ((SimpleOntologyId) simpleId).getOwlapiOntologyId(); } else { Optional<IRI> ontologyIRI = simpleId.getOntologyIRI(); Optional<IRI> versionIRI = simpleId.getVersionIRI(); if (versionIRI.isPresent()) { return new OWLOntologyID(Optional.of(owlapiIRI(ontologyIRI.get())), Optional.of(owlapiIRI(versionIRI.get()))); } else if (ontologyIRI.isPresent()) { return new OWLOntologyID(Optional.of(owlapiIRI(ontologyIRI.get())), Optional.empty()); } else { return new OWLOntologyID(); } } } SimpleOntologyValues(); @Activate void activate(); @Deactivate void deactivate(); static OWLOntology owlapiOntology(Ontology ontology); static IRI mobiIRI(org.semanticweb.owlapi.model.IRI owlIri); static org.semanticweb.owlapi.model.IRI owlapiIRI(IRI mobiIri); static Literal mobiLiteral(OWLLiteral owlLiteral); static OWLLiteral owlapiLiteral(Literal literal); static Annotation mobiAnnotation(OWLAnnotation owlAnno); static OWLAnnotation owlapiAnnotation(Annotation anno); static Individual mobiIndividual(OWLIndividual owlapiIndividual); static OWLNamedIndividual owlapiIndividual(Individual mobiIndividual); static OntologyId mobiOntologyId(OWLOntologyID owlId); static OWLOntologyID owlapiOntologyId(OntologyId simpleId); static OClass mobiClass(OWLClass owlapiClass); static OWLClass owlapiClass(OClass mobiClass); static Datatype mobiDatatype(OWLDatatype datatype); static OWLDatatype owlapiDatatype(Datatype datatype); static ObjectProperty mobiObjectProperty(OWLObjectProperty property); static OWLObjectProperty owlapiObjectProperty(ObjectProperty property); static DataProperty mobiDataProperty(OWLDataProperty property); static OWLDataProperty owlapiDataProperty(DataProperty property); static AnnotationProperty mobiAnnotationProperty(OWLAnnotationProperty property); static OWLAnnotationProperty owlapiAnnotationProperty(AnnotationProperty property);  }
@Test public void testOwlapiOntologyId() throws Exception { org.semanticweb.owlapi.model.IRI oIRI = org.semanticweb.owlapi.model.IRI.create("http: org.semanticweb.owlapi.model.IRI vIRI = org.semanticweb.owlapi.model.IRI.create("http: OWLOntologyID owlId = new OWLOntologyID(oIRI, vIRI); SimpleOntologyId simpleId1 = mock(SimpleOntologyId.class); expect(simpleId1.getOwlapiOntologyId()).andReturn(owlId); OntologyId simpleId2 = mock(OntologyId.class); expect(simpleId2.getOntologyIRI()).andReturn(Optional.of(ontologyIRI)).anyTimes(); expect(simpleId2.getVersionIRI()).andReturn(Optional.of(versionIRI)).anyTimes(); mockStaticPartial(SimpleOntologyValues.class, "owlapiIRI"); expect(SimpleOntologyValues.owlapiIRI(ontologyIRI)).andReturn(oIRI).anyTimes(); expect(SimpleOntologyValues.owlapiIRI(versionIRI)).andReturn(vIRI).anyTimes(); replay(simpleId1, simpleId2, SimpleOntologyValues.class); OWLOntologyID owlId1 = SimpleOntologyValues.owlapiOntologyId(simpleId1); OWLOntologyID owlId2 = SimpleOntologyValues.owlapiOntologyId(simpleId2); assertEquals(owlId, owlId1); assertEquals(oIRI, owlId2.getOntologyIRI().get()); assertEquals(vIRI, owlId2.getVersionIRI().get()); }