SimpleOntologyValues { public static Annotation mobiAnnotation(OWLAnnotation owlAnno) { if (owlAnno == null) { return null; } AnnotationProperty property = mobiAnnotationProperty(owlAnno.getProperty()); OWLAnnotationValue value = owlAnno.getValue(); if (value instanceof OWLLiteral) { OWLLiteral literal = (OWLLiteral) value; Literal simpleLiteral = mobiLiteral(literal); return new SimpleAnnotation(property, simpleLiteral); } else if (value instanceof org.semanticweb.owlapi.model.IRI) { org.semanticweb.owlapi.model.IRI iri = (org.semanticweb.owlapi.model.IRI) value; IRI simpleIri = mobiIRI(iri); return new SimpleAnnotation(property, simpleIri); } else if (value instanceof OWLAnonymousIndividual) { OWLAnonymousIndividual individual = (OWLAnonymousIndividual) value; Individual simpleIndividual = mobiIndividual(individual); return new SimpleAnnotation(property, simpleIndividual); } else { throw new OWLRuntimeException("Invalid annotation value"); } } 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 testMobiAnnotation() throws Exception { OWLAnnotation owlAnno = mock(OWLAnnotation.class); OWLAnnotation owlAnno1 = mock(OWLAnnotation.class); OWLAnnotationProperty owlProperty = mock(OWLAnnotationProperty.class); AnnotationProperty property = mock(AnnotationProperty.class); org.semanticweb.owlapi.model.IRI value = mock(org.semanticweb.owlapi.model.IRI.class); IRI iri = mock(IRI.class); expect(owlAnno.getProperty()).andReturn(owlProperty).anyTimes(); expect(owlAnno.getValue()).andReturn(value).anyTimes(); mockStaticPartial(SimpleOntologyValues.class, "mobiAnnotationProperty", "mobiIRI"); expect(SimpleOntologyValues.mobiAnnotationProperty(owlProperty)).andReturn(property).anyTimes(); expect(SimpleOntologyValues.mobiIRI(value)).andReturn(iri).anyTimes(); replay(owlAnno, owlAnno1, owlProperty, property, value, iri, SimpleOntologyValues.class); }