.getOntologyIRI().get()
+ "#Pizza"));
// Now we create the content of our comment. In this case we simply want
// a plain string literal. We'll attach a language to the comment to
// specify that our comment is written in English (en).
OWLAnnotation commentAnno = df.getOWLAnnotation(df.getRDFSComment(),
df.getOWLLiteral("A class which represents pizzas", "en"));
// Specify that the pizza class has an annotation - to do this we attach
// an entity annotation using an entity annotation axiom (remember,
// classes are entities)
OWLAxiom ax = df.getOWLAnnotationAssertionAxiom(pizzaCls.getIRI(),
commentAnno);
// Add the axiom to the ontology
man.applyChange(new AddAxiom(ont, ax));
// Now lets add a version info annotation to the ontology. There is no
// 'standard' OWL 1.1 annotation object for this, like there is for
// comments and labels, so the creation of the annotation is a bit more
// involved. First we'll create a constant for the annotation value.
// Version info should probably contain a version number for the
// ontology, but in this case, we'll add some text to describe why the
// version has been updated
OWLLiteral lit = df.getOWLLiteral("Added a comment to the pizza class");
// The above constant is just a plain literal containing the version
// info text/comment we need to create an annotation, which pairs a URI
// with the constant
OWLAnnotation anno = df.getOWLAnnotation(df
.getOWLAnnotationProperty(OWLRDFVocabulary.OWL_VERSION_INFO
.getIRI()), lit);
// Now we can add this as an ontology annotation Apply the change in the
// usual way
man.applyChange(new AddOntologyAnnotation(ont, anno));