Hi all,

I have a simple ontology designed using Protégé 3.4. I've introduced some
"Necessary & Sufficient" conditions, like in the defintion of the Table
class:

[image: Inline images 1]

Forget the two first conditions, the third one is easy to understand :)

If I've understood well, this conditions are interpreted as restrictions,
and managed a super-class of the Table class.

So, if I load my ontology with Jena and the class Table:

1. OntModel model =
ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC);
2. model.read(OWL_FILE_NAME);
3. OntClass Table = model.getOntClass( NS + "Table" );

If I execute the following code, the line the line 9 should be reached, but
it's not:

4. for (Iterator<OntClass> supers = Table.listSuperClasses(true);
supers.hasNext(); ) {
5.            OntClass  superClass = supers.next();
6.
7.            if (superClass.isRestriction())
8.            {
9.               System.out.println("Restriction found");
10.            }
11. }

Any idea about what I'm loosing in the way?

Thanks!


-- 
Raúl

Reply via email to