[Pellet-users] Strange Pellet behaviour with getIndividuals
Robert Davey
robert.davey at bbsrc.ac.uk
Thu May 8 16:37:41 UTC 2008
Hi all,
I really don't know if this is just me, but I'm having trouble getting
some individuals out of the Pizza ontology [1].
I'm adding an individual for each of the NamedPizzas in a simple loop...
<snip>
OWLClass pizzaClass = factory.getOWLClass(URI.create("http://www.co-ode.org/ontologies/pizza/pizza.owl#NamedPizza"));
int count = 0;
for (OWLSubClassAxiom sca : ontology.getSubClassAxiomsForRHS(pizzaClass))
{
count++;
OWLIndividual individual = dataFactory.getOWLIndividual(ontology.getURI().toString()+count));
owlOntologyManager.applyChange(new AddAxiom(ontology, dataFactory.getOWLClassAssertionAxiom(individual, (OWLClass)sca.getSubClass())));
}
</snip>
I load the ontology into Pellet prior to adding the individuals, but I
understand that shouldn't make any difference with the way the
OWLOntologyManager stuff should work. I then try and get all the
individuals using:
reasoner.getIndividuals();
However, it only outputs the 5 Country individuals that are already
asserted in the Pizza ontology. There should be 23 more individuals,
one for each NamedPizza subclass.
If I use:
ontology.getReferencedIndividuals()
I can see all the individuals correctly.
Bear in mind that I have a bit of an old bunch of Pellet jars built from
SVN, and I can't get to the new SVN versions.
Am I being daft?
Cheers
Rob
[1] http://www.co-ode.org/ontologies/pizza/2007/02/12/pizza.owl
--
---------------------------------------
Dr. Rob Davey
NCYC / Institute of Food Research
Computational Biology / John Innes Centre
Norwich Research Park
Norwich, Norfolk, NR4 7HU
http://www.comparagrid.org/
http://cbr.jic.ac.uk/dicks/
---------------------------------------
More information about the Pellet-users
mailing list