SimpleOntologyValues { public static OWLLiteral owlapiLiteral(Literal literal) { if (literal == null) { return null; } org.semanticweb.owlapi.model.IRI datatypeIRI = owlapiIRI(literal.getDatatype()); return new OWLLiteralImpl(literal.getLabel(), literal.getLanguage().orElse(null), new OWLDatatypeImpl(datatypeIRI)); } 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 testOwlapiLiteral() throws Exception { Literal literal = mock(Literal.class); IRI datatypeIRI = mock(IRI.class); org.semanticweb.owlapi.model.IRI owlIRI = mock(org.semanticweb.owlapi.model.IRI.class); expect(datatypeIRI.stringValue()).andReturn("http: expect(literal.getDatatype()).andReturn(datatypeIRI); expect(literal.getLanguage()).andReturn(Optional.empty()); expect(literal.getLabel()).andReturn("test"); mockStaticPartial(SimpleOntologyValues.class, "owlapiIRI"); expect(SimpleOntologyValues.owlapiIRI(isA(IRI.class))).andReturn(owlIRI).anyTimes(); replay(literal, datatypeIRI, SimpleOntologyValues.class); OWLLiteral owlLiteral = SimpleOntologyValues.owlapiLiteral(literal); assertEquals("test", owlLiteral.getLiteral()); }