SimpleOntologyValues { public static Literal mobiLiteral(OWLLiteral owlLiteral) { if (owlLiteral == null) { return null; } String datatypeIRIStr = owlLiteral.getDatatype().getIRI().toString(); if (datatypeIRIStr.equals("http: return factory.createLiteral(owlLiteral.getLiteral(), "en"); } else if (owlLiteral.hasLang()) { return factory.createLiteral(owlLiteral.getLiteral(), owlLiteral.getLang()); } else { return factory.createLiteral(owlLiteral.getLiteral(), mobiDatatype(owlLiteral.getDatatype()).getIRI()); } } 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 testMobiLiteral() throws Exception { OWLLiteral owlLiteral = new OWLLiteralImplString("testString"); IRI iri = factory.createIRI("http: Literal literal = mock(Literal.class); Datatype datatype = mock(Datatype.class); expect(datatype.getIRI()).andReturn(iri).anyTimes(); expect(literal.getDatatype()).andReturn(iri).anyTimes(); expect(literal.getLabel()).andReturn("testString").anyTimes(); replay(literal, datatype); mockStaticPartial(SimpleOntologyValues.class, "mobiDatatype"); expect(SimpleOntologyValues.mobiDatatype(isA(OWLDatatype.class))).andReturn(datatype).anyTimes(); replay(SimpleOntologyValues.class); assertEquals("testString", SimpleOntologyValues.mobiLiteral(owlLiteral).getLabel()); assertEquals(iri, SimpleOntologyValues.mobiLiteral(owlLiteral).getDatatype()); }