webprotege icon indicating copy to clipboard operation
webprotege copied to clipboard

Extension for WebProtege

Open titoferreira opened this issue 5 years ago • 10 comments

Hi,

I'm developing an extension for WebProtege that consists of a reasoner that answer queries over hybrid theories composed of an OWL ontology and a set of non-monotonic rules (there already exists a corresponding plugin for the desktop version - the NoHR reasoner), and I would like to ask two questions.

  • I have created two tabs and two portlets for the user interface of the extension. Now I'm trying to figure out the remote procedure calls that WebProtege uses to communicate with the server. More specifically, I am trying to use some of the NoHR classes on the client-side of WebProtege but it seems that the GWT framework does not allow me to use some classes that import libraries from external sources. Is there anything I can do about this?

  • I have created a new type of object - the rules - but I can't simply use some WebProtege classes because rules do not extend an owlEntity. I want to ask you for some tips on the best way to create a new type of object (in this case rules) that is integrated with WebProtege's existing structure.

Thanks in advance for your help/support.

titoferreira avatar Nov 08 '19 15:11 titoferreira

Hi,

I'm doing a similar extension for web protege. Did you solve your questions? By the way, how did you create the new portlets? I noticed that webprotege-maven-plugin and dagger will automatically generate the porletFactory classes, but have no idea how does it work.

Bodawen avatar May 06 '20 10:05 Bodawen

Hi,

Yes, I solved the questions that I mentioned in my post.

To create new portlets you must first create a few classes for your portlet.

  • PortletPresenter.java
  • Presenter.java
  • View (interface)
  • ViewImpl.java
  • ViewImpl.ui.xml

You can check the existing portlets and open these classes to see what is contained inside and make your own changes.

Next, you have to provide an instance of your portlet to the application. In class "ClientApplicationModule.java", you have to add a provide annotation (@Provides) to your created portlet.

After compiling and deploying server, you can add your view (portlet) in "Add View" menu in any tab menu.

I hope this information can help you.

titoferreira avatar May 14 '20 11:05 titoferreira

Hi, Thanks for reply. But it does not work for me. I created a new portlet "Debugger" according to Individualslist portlet and added View provide into "ClientApplicationModule.java".

But nothing changed after compiling and deploying. Should I do something for PortletPresenter? I notice that in "PortletFactoryGenerateded.java" all presenters of the portlet are instanced, except my new portlet.

Bodawen avatar May 17 '20 10:05 Bodawen

Hi,

You have to create your own portletPresenter for your new portlet.

If everything is ok, the GWT should automatically generate all needed factory classes.

For compile, I personally use mvn clean compile and to create the .war file I use mvn package

In mvn clean compile all classes should be generated

titoferreira avatar Jun 22 '20 15:06 titoferreira

Hi @titoferreira , would you please share your code? We need the same reasoner for our ontology.

laotao avatar Dec 20 '22 01:12 laotao

Hi @laotao, my code is in this repository: https://github.com/NoHRReasoner/WebNoHR

there is also a running application using this version of webprotege: https://web.nohr.di.fct.unl.pt/

titoferreira avatar Dec 20 '22 18:12 titoferreira

Thanks, I'll try.

laotao avatar Jan 10 '23 23:01 laotao

Hi @laotao, my code is in this repository: https://github.com/NoHRReasoner/WebNoHR

there is also a running application using this version of webprotege: https://web.nohr.di.fct.unl.pt/

Hi @titoferreira , I've tried the application and created a project in it. But I don't know how to add rules. The NoHR Rule tab seems only a text editor. And I don't know how to create SWRL rules. Would you please share an example project with me? My accout is tao.

laotao avatar Feb 03 '23 01:02 laotao

Hi @laotao, sorry for the delay but I'm not working in this project anymore. I suggest you to talk to Matthias Knorr who was my master degree advisor and is a contributor to the project in github as well

titoferreira avatar Mar 15 '23 08:03 titoferreira

@titoferreira Sure. Thanks.

laotao avatar Mar 20 '23 01:03 laotao