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 stanford.edu
Fri Jan 4 11:37:20 PST 2008


Carmen,

The ProjectManager.getProjectManager().reloadUI(true) is the method that 
is being called if you enabled or disable the displaying of hidden 
classes in Project -> Configure.

This method will reinitialize all the tabs and should be called only 
once (or as rarely as possible). The method will dispose the existing 
tabs and create new ones by calling the initialize method of each tab. 
If you have code in the initialize method of your tab that is very 
expensive as time and memory then that is why you get the out-of-memory 
error. Make sure that you call the reload method only once.

After an import you need to reload not only the class tree, but all the 
tabs (for example the PropertiesTab) because otherwise they will be 
out-of-sync with the content of the model. So calling the reloadUI 
method is the right thing to do.

Tania



Carmen Martinez wrote:
> Hello again,
>
> thanks for  the fuctions you recommended me but, the first one: 
> ProjectManager.getProjectManager().reloadUI(true) (its the one I need 
> most), does not work properly. This fuction spends too much time in 
> executing, and does unusual thigs. This function gives me problems of 
> memory like: "java heap space", and it looks like it reloads all the 
> plugins in order to visualize them, and in each plugin (in the command 
> screen) shows and error like  java.lang.outofmemomryerror. After 
> several minutes all the tabs are included in the application, but with 
> a red icon. It has nonsense.
>
> Do you know any fucntion, to reload only the clasess in the subclasses 
> explorer.Or  Do you know what is the function that do the same action 
> that when I check/uncheck the *Display Hidden Frames* checkbox?. The 
> refresh that this operation does keeps stable the system and I need 
> something like that.
>
> Sorry for the inconveniences, and thanks a lots.
>
> Carmen.
>
> */Tania Tudorache <tudorache at stanford.edu>/* escribió:
>
>     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:
>
>     ProjectManager.getProjectManager().reloadUI(true)
>
>     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:
>
>     individual.addSuperclass(owlModel.getOWLThingClass())
>
>     2. Or better, create a class and then add as rdf:type the metaclass:
>
>     OWLClass table1 = owlModel.createOWLNamedClass("Table1");
>     table1.setRDFType(tableClass);
>
>     I recommend solution 2.
>
>     Tania
>
>     >
>     > Thanks a lot,
>     >
>     > Carmen.
>     >
>     >
>     ------------------------------------------------------------------------
>     >
>     > ¿Chef por primera vez? - Sé un mejor Cocinillas.
>     > Entra en Yahoo! Respuestas
>     > .
>     >
>     ------------------------------------------------------------------------
>     >
>     > _______________________________________________
>     > protege-owl mailing list
>     > protege-owl at lists.stanford.edu
>     > https://mailman.stanford.edu/mailman/listinfo/protege-owl
>     >
>     > Instructions for unsubscribing:
>     http://protege.stanford.edu/doc/faq.html#01a.03
>     >
>
>     _______________________________________________
>     protege-owl mailing list
>     protege-owl at lists.stanford.edu
>     https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
>     Instructions for unsubscribing:
>     http://protege.stanford.edu/doc/faq.html#01a.03
>
>
> ------------------------------------------------------------------------
>
> Web Revelación Yahoo! 2007:
> Premio Favorita del Público - ¡Vota tu preferida! 
> <http://es.promotions.yahoo.com/revelacion2007/favoritos/>
> ------------------------------------------------------------------------
>
> _______________________________________________
> protege-owl mailing list
> protege-owl at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
>   




More information about the protege-owl mailing list