SimpleOntologyValues { public static OWLAnnotation owlapiAnnotation(Annotation anno) { if (anno == null) { return null; } OWLAnnotationProperty owlAnnoProperty = owlapiAnnotationProperty(anno.getProperty()); Value value = anno.getValue(); if (value instanceof IRI) { org.semanticweb.owlapi.model.IRI iri = owlapiIRI((IRI) value); return new OWLAnnotationImpl(owlAnnoProperty, iri, Stream.empty()); } else if (value instanceof Literal) { OWLLiteral literal = owlapiLiteral((Literal) value); return new OWLAnnotationImpl(owlAnnoProperty, literal, Stream.empty()); } else if (value instanceof SimpleIndividual) { OWLIndividual individual = owlapiIndividual((SimpleIndividual) value); return new OWLAnnotationImpl(owlAnnoProperty, (OWLAnonymousIndividual) individual, Stream.empty()); } else { throw new MobiOntologyException("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 testOwlapiAnnotation() throws Exception { Annotation anno = mock(Annotation.class); AnnotationProperty property = mock(AnnotationProperty.class); OWLAnnotationProperty owlProperty = mock(OWLAnnotationProperty.class); IRI value = mock(IRI.class); org.semanticweb.owlapi.model.IRI owlIRI = mock(org.semanticweb.owlapi.model.IRI.class); expect(anno.getProperty()).andReturn(property); expect(anno.getValue()).andReturn(value).anyTimes(); mockStaticPartial(SimpleOntologyValues.class, "owlapiAnnotationProperty", "owlapiIRI"); expect(SimpleOntologyValues.owlapiAnnotationProperty(property)).andReturn(owlProperty).anyTimes(); expect(SimpleOntologyValues.owlapiIRI(value)).andReturn(owlIRI).anyTimes(); replay(anno, property, owlProperty, value,owlIRI, SimpleOntologyValues.class); assertEquals(0, SimpleOntologyValues.owlapiAnnotation(anno).annotations().count()); }