public abstract class BaseBuiltin extends Object implements Builtin
Modifier and Type | Field and Description |
---|---|
static String |
BASE_URI
Base URI for jena builtins
|
Constructor and Description |
---|
BaseBuiltin() |
Modifier and Type | Method and Description |
---|---|
boolean |
bodyCall(Node[] args,
int length,
RuleContext context)
This method is invoked when the builtin is called in a rule body.
|
void |
checkArgs(int length,
RuleContext context)
Check the argument length.
|
Node |
getArg(int n,
Node[] args,
RuleContext context)
Return the n'th argument node after dereferencing by what ever type of
rule engine binding environment is appropriate.
|
int |
getArgLength()
Return the expected number of arguments for this functor or 0 if the number is flexible.
|
String |
getURI()
Return the full URI which identifies this built in.
|
void |
headAction(Node[] args,
int length,
RuleContext context)
This method is invoked when the builtin is called in a rule head.
|
boolean |
isMonotonic()
Returns false if this builtin is non-monotonic.
|
boolean |
isSafe()
Returns false if this builtin has side effects when run in a body clause,
other than the binding of environment variables.
|
public static final String BASE_URI
public String getURI()
public int getArgLength()
getArgLength
in interface Builtin
public void checkArgs(int length, RuleContext context)
public boolean bodyCall(Node[] args, int length, RuleContext context)
bodyCall
in interface Builtin
args
- the array of argument values for the builtin, this is an array
of Nodes, some of which may be Node_RuleVariables.length
- the length of the argument list, may be less than the length of the args array
for some rule enginescontext
- an execution context giving access to other relevant datapublic void headAction(Node[] args, int length, RuleContext context)
headAction
in interface Builtin
args
- the array of argument values for the builtin, this is an array
of Nodes.length
- the length of the argument list, may be less than the length of the args array
for some rule enginescontext
- an execution context giving access to other relevant datapublic boolean isSafe()
public boolean isMonotonic()
isMonotonic
in interface Builtin
public Node getArg(int n, Node[] args, RuleContext context)
Licenced under the Apache License, Version 2.0