Class ReasonerHelper


  • public class ReasonerHelper
    extends java.lang.Object
    Some helpful methods for reasoners.
    Author:
    Holger Eichelberger
    • Constructor Summary

      Constructors 
      Constructor Description
      ReasonerHelper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.util.List<java.lang.String> appendMessage​(java.util.List<java.lang.String> messages, java.lang.String message)
      Appends a message text to the list of messages.
      private static java.util.List<java.lang.String> appendMessage​(java.util.List<java.lang.String> messages, java.lang.Throwable th)
      Appends the message of th to the list of messages.
      static ValueCreationResult createValue​(Configuration cfg, AbstractVariable var, IDatatype type, ReasonerConfiguration reasonerConfiguration, ProgressObserver observer)
      Creates the value for a certain IVML type/variable.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ReasonerHelper

        public ReasonerHelper()
    • Method Detail

      • createValue

        public static ValueCreationResult createValue​(Configuration cfg,
                                                      AbstractVariable var,
                                                      IDatatype type,
                                                      ReasonerConfiguration reasonerConfiguration,
                                                      ProgressObserver observer)
        Creates the value for a certain IVML type/variable. This method is intended as a generic fallback. It just uses the value factory and does not do any reasoning.
        Parameters:
        cfg - the configuration to operate on (will not be modified)
        var - the variable to create the value for (may be null if type is given, may imply additional constraints, takes precedence over type)
        type - the type to create the value for (may be null if var is given)
        reasonerConfiguration - the reasoner configuration to be used for reasoning (e.g. taken from the UI, may be null)
        observer - an optional progress observer, shall be ProgressObserver.NO_OBSERVER if unused
        Returns:
        the value creation result
      • appendMessage

        private static java.util.List<java.lang.String> appendMessage​(java.util.List<java.lang.String> messages,
                                                                      java.lang.Throwable th)
        Appends the message of th to the list of messages.
        Parameters:
        messages - the messages (may be null)
        th - the throwable to take the message from
        Returns:
        messages or a new list
      • appendMessage

        private static java.util.List<java.lang.String> appendMessage​(java.util.List<java.lang.String> messages,
                                                                      java.lang.String message)
        Appends a message text to the list of messages.
        Parameters:
        messages - the messages (may be null)
        message - the message to append
        Returns:
        messages or a new list