Class SSSOMTUriExpressionSlotValueFunction

  • All Implemented Interfaces:
    IFormatModifierFunction

    public class SSSOMTUriExpressionSlotValueFunction
    extends Object
    implements IFormatModifierFunction
    Represents the SSSOM/T substitution modifier function "uriexpr_slot_value".

    This function may be used to extract the value of a slot within a URI Expression, and insert it into a string.

    Example:

     "The value of 'field1' is: %{subject_id|uriexpr_slot_value(field1)}"
     

    Assuming that the subject ID of the mapping currently being processed is a URI Expression and that the expression does contain a field1 slot, this will insert the value of that slot into the string. Otherwise, the subject ID will be inserted unmodified.

    Note that CURIEs embedded with the URI Expression are expanded into their full-length form. To insert the slot value as a CURIE, append the short modifier after this function, as in:

     "The (CURIE) value of 'field1 is %{subject_id|uriexpr_slot_value(field1)|short}"
     
    • Constructor Detail

      • SSSOMTUriExpressionSlotValueFunction

        public SSSOMTUriExpressionSlotValueFunction​(PrefixManager prefixManager)
        Creates a new instance.
        Parameters:
        prefixManager - The prefix manager to use for expanding short IDs embedded within a URI Expression.
    • Method Detail

      • call

        public Object call​(Object value,
                           List<String> arguments)
        Description copied from interface: IFormatModifierFunction
        Executes the function.
        Specified by:
        call in interface IFormatModifierFunction
        Parameters:
        value - The original value this function is supposed to modify. It is guaranteed never to be null, but the exact type will depend on what the substituted placeholder was, and also on what any previous modifier function may have done with it.
        arguments - Additional arguments to the function, if any. If the function declared that it expects some mandatory arguments (through the IFormatModifierFunction.getSignature() method), it is guaranteed the list will contains as many arguments as expected.
        Returns:
        The modified value. It may not need be of the same type as the original value (e.g., a function could transform a list value into a string value).