Interface Function
- All Superinterfaces:
Copyable<com.complexible.stardog.plan.filter.Expression>,com.complexible.stardog.plan.filter.Expression
- All Known Subinterfaces:
Aggregate
- All Known Implementing Classes:
AbstractFunction
public interface Function
extends com.complexible.stardog.plan.filter.Expression
This is the extension point for 17.6 (Extensible Value Testing) of the SPARQL spec.
For implementations of Function to be visible to the query parser and engine, they must be registered
via the JDK ServiceLoader. Create a file called
com.complexible.stardog.plan.filter.functions.Function in the META-INF/services directory.
The contents of this file should be all of the *fully-qualified* class names for the custom Functions. Then
if a jar containing the META-INF/services directory and the implementations for the Functions is
included on the classpath, Stardog will pick up the implementations on startup.
aGeo:distance(?axLoc, ?ayLoc, ?bxLoc, ?byLoc) , its signature is as follows:
{code
xsd:double aGeo:distance (numeric x1, numeric y1, numeric x2, numeric y2)
}
When evaluate is called, it will be provided four values via the ValueSolution,
which are the current values for the parameters, x1, y1, x2, and y2.- Since:
- 0.1
- Version:
- 3.0
- Author:
- Michael Grove
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncopy()Create a deep copy of the object which does not share any references with the original.default StringReturn a description of the function suitable to be included in user manual.getName()Return the string that uniquely identifies thisExpression, which should be a fully qualified URI.getNames()Return all the strings that uniquely identifies thisFunction.default voidInitialize this function.default booleanReturnstrueif the function result is uniquely determined by its inputs orfalseif the function may return different results for the same inputs.Methods inherited from interface com.complexible.stardog.plan.filter.Expression
accept, couldRaiseError, evaluate, getArgs, getCategory, replaceArg, setArgs
-
Method Details
-
getName
String getName()Return the string that uniquely identifies thisExpression, which should be a fully qualified URI. This URI is what is used to reference thisExpressionin a SPARQL query.- Returns:
- the URI
-
getNames
Return all the strings that uniquely identifies thisFunction. A function may have different names in different namespaces.- Returns:
- all aliases of this
Function - See Also:
-
getDescription
Return a description of the function suitable to be included in user manual.- Returns:
- description of the function
-
initialize
default void initialize()Initialize this function. In the case of a pure function, this is a no-op. However, in some cases, a function needs to keep some global state during query execution for it to work correctly.initializeshould prepare the function for execution by either clearing or otherwise preparing it's state for (re)execution. -
copy
Function copy()Create a deep copy of the object which does not share any references with the original. -
isDeterministic
default boolean isDeterministic()Returnstrueif the function result is uniquely determined by its inputs orfalseif the function may return different results for the same inputs. If the function has no inputs then every invocation should always return the same value for it to be deterministic, e.g.PI(), whereas a function likeUUID()is not deterministic.- Returns:
trueif the function is deterministic
-