SimpleOntologyValues { public static OntologyId mobiOntologyId(OWLOntologyID owlId) { if (owlId == null) { return null; } Optional<org.semanticweb.owlapi.model.IRI> ontologyIRI = owlId.getOntologyIRI(); Optional<org.semanticweb.owlapi.model.IRI> versionIRI = owlId.getVersionIRI(); if (versionIRI.isPresent()) { return new SimpleOntologyId.Builder(factory).ontologyIRI(mobiIRI(ontologyIRI.get())) .versionIRI(mobiIRI(versionIRI.get())).build(); } else if (ontologyIRI.isPresent()) { return new SimpleOntologyId.Builder(factory).ontologyIRI(mobiIRI(ontologyIRI.get())).build(); } else { return new SimpleOntologyId.Builder(factory).build(); } } 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 testMobiOntologyId() 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 owlId2 = new OWLOntologyID(oIRI, vIRI); IRI moIRI = mock(IRI.class); IRI mvIRI = mock(IRI.class); expect(moIRI.stringValue()).andReturn("http: expect(mvIRI.stringValue()).andReturn("http: mockStaticPartial(SimpleOntologyValues.class, "mobiIRI"); expect(SimpleOntologyValues.mobiIRI(oIRI)).andReturn(moIRI).anyTimes(); expect(SimpleOntologyValues.mobiIRI(vIRI)).andReturn(mvIRI).anyTimes(); replay(moIRI, mvIRI, SimpleOntologyValues.class); OntologyId ontologyId = SimpleOntologyValues.mobiOntologyId(owlId2); assertEquals("http: assertEquals("http: }