I'm trying to use the Stanford OWL API, and I find the documentation a bit unclear. Using Java, I load an ontology which has been prepared by some user via Protégé, and get to a DefaultOWLObjectProperty
. The value of that property is meant to be an individual in some class in the ontology. How can I find the class? Code snippet below:
OWLNamedClass cls = (OWLNamedClass) it.next();
Collection instances = cls.getInstances(false);
for (Iterator jt = instances.iterator(); jt.hasNext();) {
OWLIndividual individual = (OWLIndividual) jt.next();
Collection props = individual.getRDFProperties();
for (Object prop : props) {
DefaultOWLObjectProperty obj = (DefaultOWLObjectProperty) prop;
Object val = individual.getPropertyValue(obj);
DefaultRDFIndividual valInd = (DefaultRDFIndividual) val;
…
}
I'd like to get the class of valInd
.