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] How to Open an ontology using my plugin

Waqas Ahmed wqs.ahmed at gmail.com
Wed Mar 18 15:29:29 PDT 2009


how does protege open an owl file when we click "open" under file menu? it
opens an owl file even without .pprj file

 On Thu, Mar 19, 2009 at 3:19 AM, Tania Tudorache <tudorache at stanford.edu>wrote:

> No, that will not work. You'll have to use the solution I sent you.
>
> Tania
>
> Waqas Ahmed wrote:
> > how about writing the contents of my owl file into the model i get by
> > making the call
> >
> > OWLModel model = (OWLModel) getKnowledgeBase();
> >
> > OWLModel model2 =
> > ProtegeOWL.createJenaOWLModelFromInputStream(inStream);
> >
> > model = model2;
> >
> >
> > should this work, i want to show all the classes and restrictions that
> > are in model2 in classes tab. or in other words want to set it as
> > knowledge base
> >
> >
> >
> > On Thu, Mar 19, 2009 at 2:08 AM, Tania Tudorache
>  > <tudorache at stanford.edu <mailto:tudorache at stanford.edu>> wrote:
> >
> >     OK, before I give you a solution, I must emphasize that this is
> >     not the
> >     way Protege plugins are supposed to work. So, this setup is
> stretching
> >     the protege plugin infrastructure and there are hacks to make it
> work,
> >     but this is definitely not the way protege plugins are intended to
> >     work.
> >
> >     You must also understand, that a plugin is not meant to reload the
> >     underlying owl model that Protege has loaded through "official"
> >     ways. In
> >     this solution, you will reload the owl model of Protege, by first
> >     closing the existing project (which is probably empty anyway), and
> >     then
> >     reloading the new owl file. When this happens, your existing tab
> >     plugin
> >     instance will be destroyed, so all state you had in it will not be
> >     available anymore.
> >
> >     Below are the calls you need to make:
> >
> >     ProjectManager.getProjectManager().closeCurrentProject();
> >
> ProjectManager.getProjectManager().loadProject(URIUtilities.createURI("file:/tmp/pizza.pprj"));
> >
> >
> >     Make sure that the URi you specify is to a pprj file, not OWL
> >     file. You
> >     can create an empty pprj file that will point to the owl file name
> >     that
> >     you want to open. Even if the owl file changes, the pprj file should
> >     still work for most cases.
> >
> >     Tania
> >
> >
> >     Waqas Ahmed wrote:
> >     > let me be more specific. i have written a plugin (i didnt wanted to
> >     > write it as a plugin but for some reasons now i have to) that
> >     connects
> >     > to a database server and transforms a relational database into
> >     an owl
> >     > file. i have used jena api at back end for all transformations. now
> >     > once ontology is generated, i can check to see if there is change
> in
> >     > database, addition of deletion of new tables. if there is a change,
> >     > that change is made in the owl file we generated in step1. now i
> >     have
> >     > to implement it as a tabwidget. every thing is working fine but
> >     when i
> >     > generate an owl file (using jena, not protege apis) i only have to
> >     > open this file file in same protege instance on click of a button
> in
> >     > my plugin. hope you understand. ... it does not matter if existing
> >     > ontology drops off.
> >     >
> >     > On Thu, Mar 19, 2009 at 1:15 AM, Tania Tudorache
> >     > <tudorache at stanford.edu <mailto:tudorache at stanford.edu>
>  >     <mailto:tudorache at stanford.edu <mailto:tudorache at stanford.edu>>>
> >     wrote:
> >     >
> >     >     OK, so when you start protege programmatically, you must
> >     load an OWL
> >     >     file. What does your plugin do with that initial OWL file?
> >     Does it
> >     >     just
> >     >     drop it?
> >     >
> >     >     If so, then you should generate the OWL content in that initial
> >     >     OWL file
> >     >     that you opened. To get the owl model in your plugin, you
> >     can call:
> >     >
> >     >     OWLModel owlModel = (OWLModel)getKnowledgeBase();
> >     >
> >     >     Then, you add all the content in this owlModel.
> >     >
> >     >     If you are using this approach, then whatever changes you do
> >     to this
> >     >     ontology, it will be automatically reflected in the UI.
> >     >
> >     >     Tania
> >     >
> >     >
> >     >     Waqas Ahmed wrote:
> >     >     > actually i am making changes to an owl file, or suppose my
> >     plugin
> >     >     > generates an OWL file. now i want to open that OWL file in
> >     protege
> >     >     > automatically. i dont want to click on File and open menu
> >     >     buttons. but
> >     >     > want to open it in same instance of protege. any help???
> >     >     >
> >     >     > On Thu, Mar 19, 2009 at 12:02 AM, Tania Tudorache
> >     >     > <tudorache at stanford.edu <mailto:tudorache at stanford.edu>
> >     <mailto:tudorache at stanford.edu <mailto:tudorache at stanford.edu>>
> >     >     <mailto:tudorache at stanford.edu
> >     <mailto:tudorache at stanford.edu> <mailto:tudorache at stanford.edu
> >     <mailto:tudorache at stanford.edu>>>>
> >     >     wrote:
> >     >     >
> >     >     >     The model that you have seems quite complicated, and it
> is
> >     >     not clear
> >     >     >     that this is the best way of doing it.
> >     >     >
> >     >     >     If you load an ontology in Protege, and modify it in your
> >     >     plugin, then
> >     >     >     the changes will be automatically shown in all the
> >     Protege UI,
> >     >     >     including
> >     >     >     the class hierarchy.
> >     >     >
> >     >     >     You can find more information about the Protege-OWL API
> on
> >     >     this page:
> >     >     >
> >     >     >     http://protege.stanford.edu/plugins/owl/api/guide.html
> >     >     >
> >     >     >     Tania
> >     >     >
> >     >     >
> >     >     >     Waqas Ahmed wrote:
> >     >     >     >
> >     >     >     > Hi all, i have written an plugin that makes some
> changes
> >     >     to an owl
> >     >     >     > file and saves these changes back to that file. now
> >     i want
> >     >     to open
> >     >     >     > that same onlogy file and display class hierarchy in
> >     >     classes tab. i
> >     >     >     > want to open that file from my plugin means whenever
> >     there
> >     >     is a
> >     >     >     change
> >     >     >     > after saving file the class hierarchy automatically get
> >     >     updated.
> >     >     >     > please tell me how can i do this? what call i should
> >     make
> >     >     to load an
> >     >     >     > ontology ?
> >     >     >     >
> >     >     >     > --
> >     >     >     > Regards
> >     >     >     > Waqas Ahmed
> >     >     >     >
> >     >     >
> >     >
> >
> ------------------------------------------------------------------------
> >     >     >     >
> >     >     >     > _______________________________________________
> >     >     >     > protege-owl mailing list
> >     >     >     > protege-owl at lists.stanford.edu
> >     <mailto:protege-owl at lists.stanford.edu>
> >     >     <mailto:protege-owl at lists.stanford.edu
> >     <mailto:protege-owl at lists.stanford.edu>>
> >     >     >     <mailto:protege-owl at lists.stanford.edu
> >     <mailto:protege-owl at lists.stanford.edu>
> >     >     <mailto:protege-owl at lists.stanford.edu
> >     <mailto: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
> >     <mailto:protege-owl at lists.stanford.edu>
> >     >     <mailto:protege-owl at lists.stanford.edu
> >     <mailto:protege-owl at lists.stanford.edu>>
> >     >     <mailto:protege-owl at lists.stanford.edu
> >     <mailto:protege-owl at lists.stanford.edu>
> >     >     <mailto:protege-owl at lists.stanford.edu
>  >     <mailto: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
> >     >     >
> >     >     >
> >     >     >
> >     >     >
> >     >     > --
> >     >     > Regards
> >     >     > Waqas Ahmed
> >     >     >
> >     >
> >
> ------------------------------------------------------------------------
> >     >     >
> >     >     > _______________________________________________
> >     >     > protege-owl mailing list
> >     >     > protege-owl at lists.stanford.edu
> >     <mailto:protege-owl at lists.stanford.edu>
> >     >     <mailto:protege-owl at lists.stanford.edu
> >     <mailto: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
> >     <mailto:protege-owl at lists.stanford.edu>
> >     <mailto:protege-owl at lists.stanford.edu
> >     <mailto: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
> >     >
> >     >
> >     >
> >     >
> >     > --
> >     > Regards
> >     > Waqas Ahmed
> >     >
> >
> ------------------------------------------------------------------------
> >     >
> >     > _______________________________________________
> >     > protege-owl mailing list
> >     > protege-owl at lists.stanford.edu
> >     <mailto: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 <mailto:
> 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
> >
> >
> >
> >
> > --
> > Regards
> > Waqas Ahmed
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > 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
>



-- 
Regards
Waqas Ahmed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-owl/attachments/20090319/d87996c2/attachment.html>


More information about the protege-owl mailing list