Class SSSOMTUriExpressionExpandFunction
- java.lang.Object
-
- org.incenp.obofoundry.sssom.uriexpr.SSSOMTUriExpressionExpandFunction
-
- All Implemented Interfaces:
IFormatModifierFunction
public class SSSOMTUriExpressionExpandFunction extends Object implements IFormatModifierFunction
Represents the SSSOM/T-OWL substitution modifier function "uriexpr_expand".Use this function to turn a URI Expression into whatever expression has been associated with the expression’s schema (through the
uriexpr_declare_formatdirective).Example:
declare_uriexpr_format(<https://example.org/schema/0001>, "(<{field1}> and <{field2}>)"); ... -> create_axiom("%{subject_id|uriexpr_expand} EquivalentTo: <%{object_id}>");
-
-
Constructor Summary
Constructors Constructor Description SSSOMTUriExpressionExpandFunction(SSSOMTOwlApplication application)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectcall(Object value, List<String> arguments)Executes the function.StringgetName()Gets the name by which the function should be called in a placeholder.StringgetSignature()Gets the expected signature of the function.
-
-
-
Constructor Detail
-
SSSOMTUriExpressionExpandFunction
public SSSOMTUriExpressionExpandFunction(SSSOMTOwlApplication application)
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:IFormatModifierFunctionGets the name by which the function should be called in a placeholder.- Specified by:
getNamein interfaceIFormatModifierFunction- Returns:
- The function name.
-
getSignature
public String getSignature()
Description copied from interface:IFormatModifierFunctionGets the expected signature of the function. This works similarly toISSSOMTFunction.getSignature(), but it only concerns the additional arguments beyond the value of the substituted placeholder to modify (e.g.extra_arg1in the example above).- Specified by:
getSignaturein interfaceIFormatModifierFunction- Returns:
- The function signature.
-
call
public Object call(Object value, List<String> arguments)
Description copied from interface:IFormatModifierFunctionExecutes the function.- Specified by:
callin interfaceIFormatModifierFunction- Parameters:
value- The original value this function is supposed to modify. It is guaranteed never to benull, 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 theIFormatModifierFunction.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).
-
-