Debugging a Protege plugin in Eclipse IDE?

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

Debugging a Protege plugin in Eclipse IDE?

areymone
Hello,

I've been using Protégé for a long time. Years ago, I developed a complex
plugin on version 3.5. Now I would like to migrate this plugin to the new
Protégé version. I know that this will entail a LOT of work, since both the
OWL layer and the plugin structure have changed since the v3.xx version.
However, I have to make it work essentially for performance issues and
concurrent access problems with the old version.

My first question will be simple: I haven't found any doc about how to
develop a Protégé 5 plugin with the help of Eclipse IDE. For now I have
managed to create an example plugin in Eclipse and compiled it with maven,
which generates a functional jar. However I would like to be able to debug
my code directly from Eclipse without having the need to launch it
externally. I've found  this wiki page
<https://github.com/protegeproject/protege/wiki/Develop-a-Plugin>   but it
is empty...

More generally about the OWL API part, could you point me to interesting
tutorials explaining the essentials to manipulate the different ontology
objects? For example, I'm using the data factory to get an existing OWLClass
from its IRI but I'm not sure it is the correct way...

Bonus question: I didn't find any online Javadoc for Protégé 5 (the  latest
one <https://protege.stanford.edu/protege/4.3/docs/api/>   seems to be about
version 4.3). Is it possible to have an updated online version (without
having to generate it through all Protégé src)?

Thank you all in advance!

Axel



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-Developer-f4659816.html
_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
Reply | Threaded
Open this post in threaded view
|

Re: Debugging a Protege plugin in Eclipse IDE?

Matthew Horridge-2
Administrator
Hi Axel,

I recommend that you have a look at the examples here:


You can find instructions on how to work with Eclipse here:


The OWL API is closely based upon the OWL 2 specification.  This means that the terminology used is closely tied to OWL 2 terminology.  If you’re not too familiar with this then I recommend that you read the OWL 2 primer (https://www.w3.org/TR/owl2-primer/) with the "Functional-Style Syntax” visible – the names in this syntax directly correspond to interface names in the OWL API.  After reading the primer, you might then look at the OWL 2 Structural specification (https://www.w3.org/TR/owl2-primer/) – again, the interfaces in the OWL API are directly based on this.

There are significant differences between the Protege 3 “frame-like” view of an OWL ontology and the modern view of an OWL as a set of axioms.  Reading the primer and spec will help you get to grips with an axiomatic view of an ontology.

Protege uses version 4 of the OWL API.  You can find examples of how to code with this here:


I recommend that you develop the non-GUI portions of your plugin first, outside of Protege.  You can then write a wrapper around this code as Protege plugin.

I was about to say that all Javadoc is now published on Maven Central, but there appears to be some lapses with this that I need to investigate.  In the meantime I recommend that you attach the Protege sources in your IDE (Eclipse) as these are on maven central.

Cheers,

Matthew


My first question will be simple: I haven't found any doc about how to
develop a Protégé 5 plugin with the help of Eclipse IDE. For now I have
managed to create an example plugin in Eclipse and compiled it with maven,
which generates a functional jar. However I would like to be able to debug
my code directly from Eclipse without having the need to launch it
externally. I've found  this wiki page
<https://github.com/protegeproject/protege/wiki/Develop-a-Plugin>   but it
is empty...

More generally about the OWL API part, could you point me to interesting
tutorials explaining the essentials to manipulate the different ontology
objects? For example, I'm using the data factory to get an existing OWLClass
from its IRI but I'm not sure it is the correct way...

Bonus question: I didn't find any online Javadoc for Protégé 5 (the  latest
one <https://protege.stanford.edu/protege/4.3/docs/api/>   seems to be about
version 4.3). Is it possible to have an updated online version (without
having to generate it through all Protégé src)?

Thank you all in advance!

Axel



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-Developer-f4659816.html
_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev


_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
Reply | Threaded
Open this post in threaded view
|

Re: Debugging a Protege plugin in Eclipse IDE?

Yevgeny Kazakov
Dear Axel,

We recently made a step-by step instructions on how to setup a simple dummy plugin (an explanation service) for Protege in Eclipse:


It is possible to use the Eclipse debugger in this setup. 
I suggested to use it as a basis of the empty wiki page that you have mentioned:

You can also take a look at our plugins which were developed this way (the projects that start with “protege-”):

I hope it can help you to get started.

- Yevgeny 


On Wed 11. Oct 2017 at 19:27, Matthew Horridge <[hidden email]> wrote:
Hi Axel,

I recommend that you have a look at the examples here:


You can find instructions on how to work with Eclipse here:


The OWL API is closely based upon the OWL 2 specification.  This means that the terminology used is closely tied to OWL 2 terminology.  If you’re not too familiar with this then I recommend that you read the OWL 2 primer (https://www.w3.org/TR/owl2-primer/) with the "Functional-Style Syntax” visible – the names in this syntax directly correspond to interface names in the OWL API.  After reading the primer, you might then look at the OWL 2 Structural specification (https://www.w3.org/TR/owl2-primer/) – again, the interfaces in the OWL API are directly based on this.

There are significant differences between the Protege 3 “frame-like” view of an OWL ontology and the modern view of an OWL as a set of axioms.  Reading the primer and spec will help you get to grips with an axiomatic view of an ontology.

Protege uses version 4 of the OWL API.  You can find examples of how to code with this here:


I recommend that you develop the non-GUI portions of your plugin first, outside of Protege.  You can then write a wrapper around this code as Protege plugin.

I was about to say that all Javadoc is now published on Maven Central, but there appears to be some lapses with this that I need to investigate.  In the meantime I recommend that you attach the Protege sources in your IDE (Eclipse) as these are on maven central.

Cheers,

Matthew


My first question will be simple: I haven't found any doc about how to
develop a Protégé 5 plugin with the help of Eclipse IDE. For now I have
managed to create an example plugin in Eclipse and compiled it with maven,
which generates a functional jar. However I would like to be able to debug
my code directly from Eclipse without having the need to launch it
externally. I've found  this wiki page
<https://github.com/protegeproject/protege/wiki/Develop-a-Plugin>   but it
is empty...

More generally about the OWL API part, could you point me to interesting
tutorials explaining the essentials to manipulate the different ontology
objects? For example, I'm using the data factory to get an existing OWLClass
from its IRI but I'm not sure it is the correct way...

Bonus question: I didn't find any online Javadoc for Protégé 5 (the  latest
one <https://protege.stanford.edu/protege/4.3/docs/api/>   seems to be about
version 4.3). Is it possible to have an updated online version (without
having to generate it through all Protégé src)?

Thank you all in advance!

Axel



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-Developer-f4659816.html
_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev

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

_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
Reply | Threaded
Open this post in threaded view
|

Re: Debugging a Protege plugin in Eclipse IDE?

Yevgeny Kazakov
You can also take a look at this (a bit outdated) wiki page to understand how Protege plugins work:


- Yevgeny 


On Wed 11. Oct 2017 at 23:40, Yevgeny Kazakov <[hidden email]> wrote:
Dear Axel,

We recently made a step-by step instructions on how to setup a simple dummy plugin (an explanation service) for Protege in Eclipse:


It is possible to use the Eclipse debugger in this setup. 
I suggested to use it as a basis of the empty wiki page that you have mentioned:

You can also take a look at our plugins which were developed this way (the projects that start with “protege-”):

I hope it can help you to get started.

- Yevgeny 


On Wed 11. Oct 2017 at 19:27, Matthew Horridge <[hidden email]> wrote:
Hi Axel,

I recommend that you have a look at the examples here:


You can find instructions on how to work with Eclipse here:


The OWL API is closely based upon the OWL 2 specification.  This means that the terminology used is closely tied to OWL 2 terminology.  If you’re not too familiar with this then I recommend that you read the OWL 2 primer (https://www.w3.org/TR/owl2-primer/) with the "Functional-Style Syntax” visible – the names in this syntax directly correspond to interface names in the OWL API.  After reading the primer, you might then look at the OWL 2 Structural specification (https://www.w3.org/TR/owl2-primer/) – again, the interfaces in the OWL API are directly based on this.

There are significant differences between the Protege 3 “frame-like” view of an OWL ontology and the modern view of an OWL as a set of axioms.  Reading the primer and spec will help you get to grips with an axiomatic view of an ontology.

Protege uses version 4 of the OWL API.  You can find examples of how to code with this here:


I recommend that you develop the non-GUI portions of your plugin first, outside of Protege.  You can then write a wrapper around this code as Protege plugin.

I was about to say that all Javadoc is now published on Maven Central, but there appears to be some lapses with this that I need to investigate.  In the meantime I recommend that you attach the Protege sources in your IDE (Eclipse) as these are on maven central.

Cheers,

Matthew


My first question will be simple: I haven't found any doc about how to
develop a Protégé 5 plugin with the help of Eclipse IDE. For now I have
managed to create an example plugin in Eclipse and compiled it with maven,
which generates a functional jar. However I would like to be able to debug
my code directly from Eclipse without having the need to launch it
externally. I've found  this wiki page
<https://github.com/protegeproject/protege/wiki/Develop-a-Plugin>   but it
is empty...

More generally about the OWL API part, could you point me to interesting
tutorials explaining the essentials to manipulate the different ontology
objects? For example, I'm using the data factory to get an existing OWLClass
from its IRI but I'm not sure it is the correct way...

Bonus question: I didn't find any online Javadoc for Protégé 5 (the  latest
one <https://protege.stanford.edu/protege/4.3/docs/api/>   seems to be about
version 4.3). Is it possible to have an updated online version (without
having to generate it through all Protégé src)?

Thank you all in advance!

Axel



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-Developer-f4659816.html
_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev

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

_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
Reply | Threaded
Open this post in threaded view
|

Re: Debugging a Protege plugin in Eclipse IDE?

areymone

Hello all,

 

After several months, I have worked on all non-GUI portions of my plugin code and got quite well acquainted with the OWL API.

 

I am now trying to develop the GUI part and I managed to setup a debuggable project in Eclipse!

 

However, I seem to have additional problems with build paths: beforehand I split my code into a “core” java project (used by other non-plugin projects) and the plugin itself, which refers to the first project. When initializing the plugin, I get a “java.lang.LinkageError: loader constraint violation” on the OWLOntologyManager class. Apparently it is due to the fact that both the plugin AND my core project need the same libraries but the framework fails at loading the same class twice.

 

I’m very new to the OSGi framework and have no clue on the best way to go: the easiest solution would be to merge both projects I guess, but I find it quite inelegant…

 

Thanks in advance for your advice!

 

Axel


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