OWLObjectProperty p = ObjectProperty(IRI(NS + "#p"));
OWLDataProperty q = DataProperty(IRI(NS + "#q"));
OWLIndividual i = AnonymousIndividual();
OWLOntology ontology = m.createOntology(IRI(NS));
List<AddAxiom> changes = new ArrayList<>();
changes.add(new AddAxiom(ontology, SubClassOf(c, ObjectHasValue(p, i))));
changes.add(new AddAxiom(ontology, ClassAssertion(d, i)));
changes.add(new AddAxiom(ontology, DataPropertyAssertion(q, i,
Literal("hello"))));
m.applyChanges(changes);
RDFXMLDocumentFormat format = new RDFXMLDocumentFormat();
format.setDefaultPrefix(NS + '#');
ontology = roundTrip(ontology, format);