Class SSSOMTDeclareFunction
- java.lang.Object
-
- org.incenp.obofoundry.sssom.owl.SSSOMTDeclareFunction
-
- All Implemented Interfaces:
ISSSOMTFunction<Void>
public class SSSOMTDeclareFunction extends Object implements ISSSOMTFunction<Void>
Represents the SSSOM/T-OWL "declare" function.This function may be used to make sure that some entities are known to the SSSOM/T-OWL application, before they can be used in
create_axiom.It expects an arbitrary number of arguments, each argument being the IRI of an entity to declare. By default, entities are declared as OWL classes. To declare entities of another type, use the
/type=parameter.For example, to declare an object property:
declare(BFO:0000066, /type="object_property");
All types of entities can be declared (
class, which is the default,object_property,data_property,individual,datatype, andannotation_property. Onlyclassandobject_propertyare expected to be useful, though.
-
-
Constructor Summary
Constructors Constructor Description SSSOMTDeclareFunction(SSSOMTOwlApplication application)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Voidcall(List<String> arguments, Map<String,String> keyedArguments)Executes the function.StringgetName()Gets the name of the function, by which it can be called in a SSSOM/T ruleset.StringgetSignature()Gets the expected signature of the function.
-
-
-
Constructor Detail
-
SSSOMTDeclareFunction
public SSSOMTDeclareFunction(SSSOMTOwlApplication application)
Creates a new instance.- Parameters:
application- The SSSOM/T-OWL application object.
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:ISSSOMTFunctionGets the name of the function, by which it can be called in a SSSOM/T ruleset.- Specified by:
getNamein interfaceISSSOMTFunction<Void>- Returns:
- The function name.
-
getSignature
public String getSignature()
Description copied from interface:ISSSOMTFunctionGets 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 singleScharacter 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:
SSSfor 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).
- Specified by:
getSignaturein interfaceISSSOMTFunction<Void>- Returns:
- The function signature.
-
call
public Void call(List<String> arguments, Map<String,String> keyedArguments) throws SSSOMTransformError
Description copied from interface:ISSSOMTFunctionExecutes 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
argumentslist will contains two items).- Specified by:
callin interfaceISSSOMTFunction<Void>- Parameters:
arguments- The arguments to the function. May be empty, but notnull.keyedArguments- The keyed arguments to the function. May be empty, butnull.- 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).
-
-