Package net.ssehub.easy.reasoning.core.reasoner
All classes and interfaces needed to implement a reasoner.
How to write a reasoner:
How to write a reasoner:
- Create an Eclipse Plugin project with Activator (even if "empty").
- Add
org.eclipse.equinox.dsto the required plugins andorg.osgi.service.componentto 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 ofReasonerDescriptorwhich 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 theactivatemethod will be called and it will register your instance with the reasoner core. - Create a folder named
OSGI-INFand put an XML file with the following contents into the new folder (let's call that filereasoner.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=trueas JVM parameter.
-
Interface Summary Interface Description ConstraintList.IModificationListener A listener to be informed if the underlying list changes.IChainingReasoner A specialized interface for reasoners, which, in principle, can be chained, i.e., composed to a chain of reasoners, passing along results and configurations.IMeasurementKey Base type for measurement keys.IReasoner General interface for reasoner, which can be registered to the ReasonerRegistry.IReasonerInterceptor An initial reasoner interceptor to be informed about the reasoning process in detail.IReasonerMessage Defines a message for internally sending signals among reasoners.IReasonerMessage.IType Defines the type of message types.IReasonerRegistry Public interface for this reasoner registry capable of handling multiple reasoners.ReasonerConfiguration.IAdditionalInformationLogger Describes an information logger. -
Class Summary Class Description AnnotationAssignmentConstraint Reasoner specific constraint type indicating aConstraint.Type.ANNOTATION_ASSIGNMENTconstraint.AttachedConstraint Implements a constraint with attached object (fixed andConstraint.Type.USUALtype).AttributesCheckVisitor A visitor for checking frozen values for all variables which correspond to a given (temporary) assignment of attribute values.AttributeValues Stores attributes and their assigned values as an additional information to be considered while reasoning.CommentResourceVisitor A visitor turning (partial) IVML elements into more or less explainable strings based on a givenCommentResource.ConstraintBase Implements the constraint base, a combination of linked list and map in order to quickly store, retrieve and delete constraints to be evaluated.ConstraintList Implements a constraint list.ConstraintList.Node The node type in a linked constraint base.ConstraintVariableConstraint Reasoner specific constraint type indicating aConstraint.Type.CONSTRAINT.DefaultConstraint Reasoner specific constraint type indicating aConstraint.Type.DEFAULTconstraint.DelegatingReasonerInstance Provides a default implementation for reasoner instances by delegating the respective calls to a given delegate reasoner.EvaluationResult A specific reasoning result for evaluations of presence conditions.EvaluationResult.EvaluationPair Defines a pair of a constraint and its evaluation result.FileUpgrader An upgrader for file input locations.IUpgrader Defines the interface to an installation upgrade mechanism.Message Part of theReasoningResultclass, expressing on error/warning of a completeReasoningResult.ReasonerConfiguration Describes the configuration to be passed via theReasonerFrontendto the individual reasoners.ReasonerDescriptor Represents descriptive information about a reasoner.ReasonerInterceptorAdaptor Default empty implementation.ReasoningErrorCodes Specifies to witch kind of error belongs failed constraint in the message generated by the reasoner.ReasoningResult Result of (one) reasoning step.TypedConstraint Reasoner specific constraint type indicating a typed constraint, e.g., a default constraint or a constraint originating from a constraint variable.ValueCreationResult Denotes the result of creating a value of an IVML variable through the reasoner considering the relevant constraints.ZipUpgrader An upgrader for zip and file input locations. -
Enum Summary Enum Description EvaluationResult.ConstraintEvaluationResult Denotes the possible results of a constraint evaluation.GeneralMeasures General reasoner measures.GeneralReasonerCapabilities Defines general reasoner capabilities.IReasonerMessage.Type Defines basic message types.Message.SuggestionType Defines supported suggestion types.ReasoningOperation Specifies which kind of reasoning should be performed by the reasoner. -
Exception Summary Exception Description AttributeException A specific exception which may occur when assigning values to attributes.