Why OWLReasoner.getSubclasses(...) returns http://www.w3.org/2002/07/owl#Nothing?

154 views Asked by At

Here is a piece of my ontology subclasses request, using JAVA-7 and owlapi library:

import org.semanticweb.owlapi.reasoner.OWLReasoner;
import org.semanticweb.owlapi.reasoner.OWLReasonerFactory;
import org.semanticweb.owlapi.reasoner.ConsoleProgressMonitor;
import org.semanticweb.owlapi.reasoner.OWLReasonerConfiguration;
...
...
OWLReasonerFactory reasonerFactory = new StructuralReasonerFactory();
ConsoleProgressMonitor progressMonitor = new ConsoleProgressMonitor();
OWLReasonerConfiguration config = new SimpleConfiguration(myconfiguration);
OWLReasoner reasoner = reasonerFactory.createReasoner(myontology, config);
Set<OWLClass> subclasses = reasoner.getSubClasses(myClazz, true).getFlattened();

Here is my question:

Why does the subclasses, what OWLReasoner.getSubClasses(...) method returns, contains all the subclasses of myClazz, but always also adds the OWLClass with URI http://www.w3.org/2002/07/owl#Nothing? I have defined nowhere this class.

Thanks in advance.

1

There are 1 answers

0
Ignazio On BEST ANSWER

owl:Nothing is the class defined to be subclass of all classes in OWL, so it's included as subclass of all satisfiable classes (it is equivalent to all unsatisfiable classes).

To skip it during iterations, Node has a getEntitiesMinusBottom() method that will skip owl:Nothing.

At w3.org owl semantics, you can find more info about the owl:Nothing class: https://www.w3.org/TR/2004/REC-owl-semantics-20040210/#owl_Nothing