// Set up a mapping, which maps the ontology to the document IRI
SimpleIRIMapper mapper = new SimpleIRIMapper(ontologyIRI, documentIRI);
manager.getIRIMappers().add(mapper);
// Now create the ontology - we use the ontology IRI (not the physical
// IRI)
OWLOntology ontology = manager.createOntology(ontologyIRI);
OWLDataFactory factory = manager.getOWLDataFactory();
// Get hold of references to class A and class B. Note that the ontology
// does not contain class A or classB, we simply get references to
// objects from a data factory that represent class A and class B
OWLClass clsA = factory.getOWLClass(IRI.create(ontologyIRI + "#A"));