Protege-Jena: problem extracting roots

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Protege-Jena: problem extracting roots

giulia-2
Hi!
    I've imported a simplified Pizza ontology (without any restriction) into a Java class (defining an OntModel m and doing m.read(in,"") ).
If I print out the classes and their superclasses (using listClasses() and getSuperClass()) all gets well:
The root classes have Resource as their superclass (rather than Thing: why?) and the other classes respect the asserted hierarchy.
But, if I put some restriction (necessary conditions), java founds as many blank nodes as the number of restrictions introduced.
Maybe it is not a problem.
But PizzaMargherita results son of a Blank Node (getSuperClass().getLocalName() gives null) !!!
Whereas SohoPizza and AmericanaPizza result son of Pizza (I've used necessary conditions for all three).
Besides, If I define a class using a necessary and sufficient condition, using listHierarchyRootClasses() I have the root classes and also the defined class, even if it is a subclass of another class(for example CheesyPizza that has Pizza as its superclass).
I've to "navigate" into the ontology so I have to know the exact hierarchy.
What can I do?
Thanks a lot.
Giulia.
 
P.S.
I use Protege 3.1.1 and Eclipse SDK 3.1.2
Reply | Threaded
Open this post in threaded view
|

Re: Protege-Jena: problem extracting roots

Matthew Horridge
Hi Giulia,

This question sounds like a Jena question.  Please can you post it to  
the Jena Dev list?

Cheers,

Matthew

On 15 May 2006, at 19:46, Giulia wrote:

> Hi!
>     I've imported a simplified Pizza ontology (without any  
> restriction) into a Java class (defining an OntModel m and doing  
> m.read(in,"") ).
> If I print out the classes and their superclasses (using listClasses
> () and getSuperClass()) all gets well:
> The root classes have Resource as their superclass (rather than  
> Thing: why?) and the other classes respect the asserted hierarchy.
> But, if I put some restriction (necessary conditions), java founds  
> as many blank nodes as the number of restrictions introduced.
> Maybe it is not a problem.
> But PizzaMargherita results son of a Blank Node (getSuperClass
> ().getLocalName() gives null) !!!
> Whereas SohoPizza and AmericanaPizza result son of Pizza (I've used  
> necessary conditions for all three).
> Besides, If I define a class using a necessary and sufficient  
> condition, using listHierarchyRootClasses() I have the root classes  
> and also the defined class, even if it is a subclass of another  
> class(for example CheesyPizza that has Pizza as its superclass).
> I've to "navigate" into the ontology so I have to know the exact  
> hierarchy.
> What can I do?
> Thanks a lot.
> Giulia.
>
> P.S.
> I use Protege 3.1.1 and Eclipse SDK 3.1.2
>

-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html