launching Protege 4 from other applications

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

launching Protege 4 from other applications

Jochen Gruber
Hello,
I want to launch Protege 4 with a given owl ontology.
The background is:  I provide a very simple graphical interface with limited modeling capabilities focusing non-ontology experts. For those who have a deeper knowledge of ontologies I want to allow to launch a full fledged ontology development environment, preloaded with the ontology one is currently working with. As there is no underlying Protege Project, only an OWL file, I want to use Protege 4.

I tried to simply create a ProtegeApplication

                ProtegeApplication appl = ProtegeManager.getInstance().getApplication();
resulting in a
java.lang.NullPointerException
        at org.osgi.util.tracker.ServiceTracker.<init>(ServiceTracker.java:200)
        at org.protege.editor.core.plugin.PluginUtilities.getExtensionRegistry(PluginUtilities.java:106)
        at org.protege.editor.core.plugin.PluginExtensionFilter.getExtensions(PluginExtensionFilter.java:60)
        at org.protege.editor.core.editorkit.EditorKitFactoryPluginLoader.getPlugins(EditorKitFactoryPluginLoader.java:52)
        at org.protege.editor.core.ProtegeManager.<init>(ProtegeManager.java:41)
        at org.protege.editor.core.ProtegeManager.getInstance(ProtegeManager.java:52)

Can I directly create an ProtegeApplication like:

                ProtegeApplication appl = new ProtegeApplication();
                appl.start(BundleContext context);

if so, how do I set the context? I could not find any information on this.

Of course one can always call
                        Runtime.getRuntime().exec("./Protege.exe");
but this decouples protege from my application (forcing users to install two separate applications and setting parameters in some config file) and does not allow to preload Protege with the given ontology - or is there any way to start Protege 4 preloaded with an OWL file?

Best regards,
Jochen
___________________________________________________________________________
WEB.DE FreeDSL mit 6.000 Flatrate und Telefonanschluss für 17,95 Euro/mtl.!
http://dsl.web.de/?ac=OM.AD.AD008K15039B7069a&mc=DSL002

_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
Reply | Threaded
Open this post in threaded view
|

Re: launching Protege 4 from other applications

Nick Drummond
Hi Jochen,

P4 runs inside an OSGi instance. The main class for starting the
default one that is used in the P4 distribution (Eclipse) is:

org.eclipse.core.runtime.adaptor.EclipseStarter

You should be able to pass the ontology source file location in the args list.

Nick


2009/6/7 Jochen Gruber <[hidden email]>:

> Hello,
> I want to launch Protege 4 with a given owl ontology.
> The background is:  I provide a very simple graphical interface with limited modeling capabilities focusing non-ontology experts. For those who have a deeper knowledge of ontologies I want to allow to launch a full fledged ontology development environment, preloaded with the ontology one is currently working with. As there is no underlying Protege Project, only an OWL file, I want to use Protege 4.
>
> I tried to simply create a ProtegeApplication
>
>                ProtegeApplication appl = ProtegeManager.getInstance().getApplication();
> resulting in a
> java.lang.NullPointerException
>        at org.osgi.util.tracker.ServiceTracker.<init>(ServiceTracker.java:200)
>        at org.protege.editor.core.plugin.PluginUtilities.getExtensionRegistry(PluginUtilities.java:106)
>        at org.protege.editor.core.plugin.PluginExtensionFilter.getExtensions(PluginExtensionFilter.java:60)
>        at org.protege.editor.core.editorkit.EditorKitFactoryPluginLoader.getPlugins(EditorKitFactoryPluginLoader.java:52)
>        at org.protege.editor.core.ProtegeManager.<init>(ProtegeManager.java:41)
>        at org.protege.editor.core.ProtegeManager.getInstance(ProtegeManager.java:52)
>
> Can I directly create an ProtegeApplication like:
>
>                ProtegeApplication appl = new ProtegeApplication();
>                appl.start(BundleContext context);
>
> if so, how do I set the context? I could not find any information on this.
>
> Of course one can always call
>                        Runtime.getRuntime().exec("./Protege.exe");
> but this decouples protege from my application (forcing users to install two separate applications and setting parameters in some config file) and does not allow to preload Protege with the given ontology - or is there any way to start Protege 4 preloaded with an OWL file?
>
> Best regards,
> Jochen
> ___________________________________________________________________________
> WEB.DE FreeDSL mit 6.000 Flatrate und Telefonanschluss für 17,95 Euro/mtl.!
> http://dsl.web.de/?ac=OM.AD.AD008K15039B7069a&mc=DSL002
>
> _______________________________________________
> protege-owl mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
>
_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03