Jena APi for retrieving Classes, Individuals, Properties, and Annotations in Jena 6.2.0
03:44 17 Aug 2026

I am currently using Jena 3.15.0 in a Java browser library, and I am using a deprecated API to get Classes, Individuals, Properties, and Annotations.

First I am getting an OntModel with the following code:

OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);

Then for example to get the model associated with an XML Ontologgy file:

FileManager.get().readModel(model, uri.toString(), "N-TRIPLES");

Then I use these APIs to get the Properties, Classes, Individuals, etc...:

ExtendedIterator properties = model.listAllOntProperties();
while (properties.hasNext()) {
   OntProperty thisProperty = (OntProperty) properties.next();
   ...
}

ExtendedIterator classes = model.listClasses();
while (classes.hasNext()) {
   OntClass thisClass = (OntClass) classes.next();
   ...
}

ExtendedIterator individuals = model.listIndividuals();
while (individuals.hasNext()) {
   Individual thisIndividual = (Individual) individuals.next();
}

These APIs where deprecated in are no longer supported on the latest versions of Jena (including 6.2.0). How must I replace this code?

java owl jena ontology