I can't reproduce this with a dummy example just containing a single OWL class with a single individual.

Both ways return  the individual. Do you have some inference enabled? Can you share sample data and code? All entities are strongly typed (don't know if this matters here)?


OntModel::listIndividuals(type) calls

getGraph().find( null, RDF.type.asNode(), type.asNode() );
OntClass::listInstances() does

getModel()
                .listStatements( null, RDF.type, this )
                .mapWith( s -> s.getSubject().as( Individual.class ) )
                .filterKeep( o -> o.hasRDFType( OntClassImpl.this, direct ))
                .filterKeep( new UniqueFilter<Individual>());

On 31.12.22 21:07, Steve Vestal wrote:
Given an OntModel myModel and an OntClass myClass contained in myModel, the call myModel.listIndividuals(myClass) provides the expected list of Individuals that are members of myClass; but the call myClass.listInstances() doesn't list anything.  I am curious what the difference is between the two (I was not able to make that out from the javadoc).


Reply via email to