Package net.ssehub.easy.reasoning.core.reasoner

All classes and interfaces needed to implement a reasoner.

How to write a reasoner:
  • Create an Eclipse Plugin project with Activator (even if "empty").
  • Add org.eclipse.equinox.ds to the required plugins and org.osgi.service.component to the imported packages as your reasoner will be linked using OSGi descriptive services (DS) to the reasoner core. As in our case the automatic registering via references in DS turned out to be instable, we will combine the automatic initialization capabilities with hand-crafted code.
  • Implement IReasoner, the interface which represents an individual reasoner. Provide the reasoner with an appropriate instance of ReasonerDescriptor which is used to describe the license of the reasoner as well as additional information such as a URL to download licensed parts.
  • Add the following methods to the class implementing IReasoner: protected void activate(org.osgi.service.component.ComponentContext context){ ReasonerFrontend.getInstance().getRegistry().register(this); } protected void deactivate(org.osgi.service.component.ComponentContext context){ ReasonerFrontend.getInstance().getRegistry().unregister(this); } Upon creation of your reasoner class the activate method will be called and it will register your instance with the reasoner core.
  • Create a folder named OSGI-INF and put an XML file with the following contents into the new folder (let's call that file reasoner.xml). <?xml version="1.0" encoding="UTF-8"?&rt; <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="<your descriptive name&rt;"&rt; <implementation class="<your class name&rt;"/&rt; <service&rt; <provide interface="de.uni_hildesheim.sse.reasoning.core.reasoner.IReasoner"/&rt; </service&rt; </scr:component&rt;
  • Link the XML file to the manifest by adding Service-Component: OSGI-INF/reasoner.xml (i.e. your specific name).
  • While refactoring your code please note that Eclipse typically does not consider the names in the XML file, i.e. they have to be adjusted manually if required.
  • For debugging output please specify -Dequinox.ds.debug=true -Dequinox.ds.print=true as JVM parameter.