Skip to content
Sections
Personal tools
You are here: Home » Documentation » Jena Tips

Jena Tips

Document Actions

Getting all instances of a class in a model

how to get all instances of a class. How to create instances, Read The Fine Manual.

OntModel model  =ModelFactory.createOntModel( ... );
OntClass cls = model.getOntClass(java.lang.String uri);
ExtendedIterator it = cls.listInstances();
while (it.hasNext())
{
  System.out.println(it.next());
}

Created by leo
Last modified 2004-12-03 01:53 PM
 

Powered by Plone

This site conforms to the following standards: