Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] Import ontologies and Visibility

Tania Tudorache tudorache at
Thu Jan 3 19:03:53 PST 2008

Hi Carmen,

Carmen Martinez wrote:
> Hello!,
> I have imported an ontology programmatically when I load my new tab 
> plugin. And it works!, because I see the ontology in the metadata tab, 
> but, I do not see the classes in the classes explorer. I only see them 
> when I check the *Display Hidden Frames* checkbox. Then I can uncheck 
> the same checkbox, but my imported ontology is still there (in grey). 
> I have used the function 
> owlModel.getProject().setDisplayHiddenClasses(true) in order to do the 
> same; but it doesn't work, because it doesn't refresh the explorer. 
> Only when I uncheck the checkbox the window is refreshed.
> My question is; how can I put visible my imported ontology (in grey is 
> perfect) without doing this check/uncheck action? Is there any 
> function that let me refresh the classes explorer?.

After you do the import, call the method:


which will reload the whole UI and you will see the imported classes.

> And the last question is related to this problem because: My imported 
> ontology is read only because  I have imported using a real URI. Using 
> Protege I can instantiate my imported ontology, and save the instances 
> very well, but, programmatically, I can not instantiate the classes in 
> the same way. For example, when I do:
>           (My tableClass is a metaclass, is subclass of owl:Class)
>          OWLNamedClass tableClass = owlModel.getOWLNamedClass("Table");
>          OWLIndividual individual = 
> tableClass.createOWLIndividual("Table1");
>  As you know, Table1 must be a class too, because, is an instance of a 
> metaclass. But, when I execute these instructions, Table1, is created 
> (I can not see it due to the previous problem I have commented), but 
> not as a class!!. When I make visible the imported ontology, I can see 
> this instance, but only as an instance!!. However, it works perfect, 
> if I do it manually. Can anyone explain that?
> Isn´t protege interpreting the Table1 instance as  a class?

It is a class, and probably you see it in the Individuals Tab with the 
class icon, not with the individuals icon. What happenend, is that 
Table1 was created as a class, but it does not have owl:Thing as its 
superclass. There are two possible solutions:

1. You add owl:Thing as an explicit superclass, by calling:


2. Or better, create a class and then add as rdf:type the metaclass:

OWLClass table1 = owlModel.createOWLNamedClass("Table1");

I recommend solution 2.


> Thanks a lot,
> Carmen.
> ------------------------------------------------------------------------
> ¿Chef por primera vez? - Sé un mejor Cocinillas.
> Entra en Yahoo! Respuestas 
> <*;_ylc=X3oDMTE4ZWhyZjU0BF9TAzIxMTQ3MTQzMjIEc2VjA0Jhbm5lcgRzbGsDQWNxdWlzaXRpb24-?link=over&sid=396545367>.
> ------------------------------------------------------------------------
> _______________________________________________
> protege-owl mailing list
> protege-owl at
> Instructions for unsubscribing: 

More information about the protege-owl mailing list