Interface ISSSOMTFunction<T>

Type Parameters:
T - The return type of the function.
All Known Implementing Classes:
SSSOMTAnnotateFunction, SSSOMTAnnotateObjectFunction, SSSOMTAnnotateSubjectFunction, SSSOMTAssignFunction, SSSOMTCheckObjectExistenceFunction, SSSOMTCheckSubjectExistenceFunction, SSSOMTCreateAxiomFunction, SSSOMTDeclareClassFunction, SSSOMTDeclareFunction, SSSOMTDeclareObjectPropertyFunction, SSSOMTDirectFunction, SSSOMTDuplicateFunction, SSSOMTEditFunction, SSSOMTExistsFunction, SSSOMTHasExtensionFunction, SSSOMTInferCardinalityFunction, SSSOMTInvertFunction, SSSOMTIsAFunction, SSSOMTOwlSetvarFunction, SSSOMTReplaceFunction, SSSOMTSetvarCallbackFunction, SSSOMTSetvarFunction, SSSOMTStopFunction, SSSOMTUriExpressionContainsFunction, SSSOMTUriExpressionDeclareFormatFunction, SSSOMTUriExpressionToExtFunction

public interface ISSSOMTFunction<T>
Represents a function in a SSSOM/Transform application.
  • Method Summary

    Modifier and Type
    Method
    Description
    call(List<String> arguments, Map<String,String> keyedArguments)
    Executes the function.
    Gets the name of the function, by which it can be called in a SSSOM/T ruleset.
    Gets the expected signature of the function.
  • Method Details

    • getName

      String getName()
      Gets the name of the function, by which it can be called in a SSSOM/T ruleset.
      Returns:
      The function name.
    • getSignature

      String getSignature()
      Gets the expected signature of the function. It should be a string that represents how many arguments (excluding keyed arguments) the function is expecting, where a single S character represents an argument.

      Regular expression syntax may be used to represent arguments that are optional or represent other kinds of constraints about the arguments list.

      Examples:

      • SSS for a function that expects exactly 3 arguments;
      • S+ for a function that expects at least one argument, possibly more;
      • (SS)+ for a function that one or more pairs of arguments (e.g. 2, 4, 6, but not 3 or 5).
      Returns:
      The function signature.
    • call

      T call(List<String> arguments, Map<String,String> keyedArguments) throws SSSOMTransformError
      Executes the function.

      Before this method is called, the arguments list will have been checked against the signature and will be guaranteed to be correct (e.g. if the function declared to expects two arguments, it is guaranteed the arguments list will contains two items).

      Parameters:
      arguments - The arguments to the function. May be empty, but not null.
      keyedArguments - The keyed arguments to the function. May be empty, but null.
      Returns:
      The result of executing the function.
      Throws:
      SSSOMTransformError - If any error occurred when executing the function (which may include the case where the number of arguments was correct but their contents was not).