public abstract class AbstractFunction extends com.complexible.stardog.plan.filter.AbstractExpression implements Function
Abstract stub implementation of a Function. Checks that the arguments to the function meet the expected number of arguments before evaluating the function.
| Modifier and Type | Field and Description |
|---|---|
protected com.google.common.collect.Range<Integer> |
mNumReqArgs
The number of required arguments
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractFunction(AbstractFunction theFunction) |
protected |
AbstractFunction(int theNumReqArgs,
String... theURIs) |
protected |
AbstractFunction(List<com.complexible.stardog.plan.filter.Expression> theExpressions,
int theNumReqArgs,
String... theURIs)
Create a new AbstractFunction
|
protected |
AbstractFunction(List<com.complexible.stardog.plan.filter.Expression> theExpressions,
com.google.common.collect.Range<Integer> theRange,
String... theURIs)
Create a new AbstractFunction
|
protected |
AbstractFunction(com.google.common.collect.Range<Integer> theNumReqArgs,
String... theURIs) |
| Modifier and Type | Method and Description |
|---|---|
protected org.openrdf.model.BNode |
assertBNode(org.openrdf.model.Value theValue)
Assert that the value is a BNode
|
protected org.openrdf.model.Literal |
assertDecimalLiteral(org.openrdf.model.Value theValue)
Assert that the literal is a decimal literal.
|
protected org.openrdf.model.Literal |
assertIntegerLiteral(org.openrdf.model.Value theValue)
Assert that the literal is an integer literal.
|
protected org.openrdf.model.IRI |
assertIRI(org.openrdf.model.Value theValue)
Assert that the value is a URI
|
protected org.openrdf.model.Literal |
assertLiteral(org.openrdf.model.Value theValue)
Assert that the value is a literal
|
protected org.openrdf.model.Literal |
assertLiteral(org.openrdf.model.Value theValue,
com.google.common.base.Predicate<org.openrdf.model.IRI> theDatatypeChecker) |
protected org.openrdf.model.Literal |
assertNumericLiteral(org.openrdf.model.Value theValue)
Assert that the literal is a numeric literal
|
protected org.openrdf.model.Literal |
assertPlainLiteral(org.openrdf.model.Value theValue)
Assert that the value is a plain literal
|
protected void |
assertRequiredArgs(int theArgs)
Validate that the arguments passed to the function match the expected number
|
protected org.openrdf.model.Literal |
assertSimpleLiteral(org.openrdf.model.Value theValue)
Assert that the value is a simple literal
|
protected org.openrdf.model.Literal |
assertStringLiteral(org.openrdf.model.Value theValue)
Assert that the value is a String literal
|
protected org.openrdf.model.Literal |
assertTypedLiteral(org.openrdf.model.Value theValue,
org.openrdf.model.IRI theDatatype)
Assert that the literal has the provided datatype
|
boolean |
equals(Object o) |
org.openrdf.model.Value |
evaluate(org.openrdf.model.Value... theValues)
Directly evaluate the function for the given arguments
|
org.openrdf.model.Value |
evaluate(com.complexible.stardog.plan.filter.ValueSolution theArgs) |
String |
getName()
Return the string that uniquely identifies this
Expression, which should be a fully qualified URI. |
List<String> |
getNames()
Return all the strings that uniquely identifies this
Function. |
int |
hashCode() |
protected abstract org.openrdf.model.Value |
internalEvaluate(org.openrdf.model.Value... theArgs)
Evaluate the function
|
void |
setArgs(List<com.complexible.stardog.plan.filter.Expression> theArgs) |
String |
toString() |
getArg, getArgs, getFirstArg, getSecondArg, getThirdArg, isTrue, replaceArgclone, finalize, getClass, notify, notifyAll, wait, wait, waitcopy, initializeprotected final com.google.common.collect.Range<Integer> mNumReqArgs
protected AbstractFunction(int theNumReqArgs,
String... theURIs)
protected AbstractFunction(com.google.common.collect.Range<Integer> theNumReqArgs, String... theURIs)
protected AbstractFunction(List<com.complexible.stardog.plan.filter.Expression> theExpressions, int theNumReqArgs, String... theURIs)
theNumReqArgs - the number of required arguments.theURIs - the URIs of the function. These are the URI's which identify this function in a SPARQL query.protected AbstractFunction(List<com.complexible.stardog.plan.filter.Expression> theExpressions, com.google.common.collect.Range<Integer> theRange, String... theURIs)
theRange - the range of valid #'s of arguments to the function.theURIs - the URIs of the function. These are the URI's which identify this function in a SPARQL query.protected AbstractFunction(AbstractFunction theFunction)
public void setArgs(List<com.complexible.stardog.plan.filter.Expression> theArgs)
setArgs in interface com.complexible.stardog.plan.filter.ExpressionsetArgs in class com.complexible.stardog.plan.filter.AbstractExpressionpublic boolean equals(Object o)
equals in class com.complexible.stardog.plan.filter.AbstractExpressionpublic int hashCode()
hashCode in class com.complexible.stardog.plan.filter.AbstractExpressionpublic final String getName()
Expression, which should be a fully qualified URI. This
URI is what is used to reference this Expression in a SPARQL query.public final List<String> getNames()
Function. A function may have different names
in different namespaces.getNames in interface FunctionFunctionFunction.getName()public final org.openrdf.model.Value evaluate(com.complexible.stardog.plan.filter.ValueSolution theArgs)
throws com.complexible.stardog.plan.filter.ExpressionEvaluationException
evaluate in interface com.complexible.stardog.plan.filter.Expressioncom.complexible.stardog.plan.filter.ExpressionEvaluationExceptionpublic org.openrdf.model.Value evaluate(org.openrdf.model.Value... theValues)
throws com.complexible.stardog.plan.filter.ExpressionEvaluationException
theValues - the arguments to the functioncom.complexible.stardog.plan.filter.ExpressionEvaluationException - if there is an error while evaluating the functionprotected abstract org.openrdf.model.Value internalEvaluate(org.openrdf.model.Value... theArgs)
throws com.complexible.stardog.plan.filter.ExpressionEvaluationException
theArgs - the arguments to the functioncom.complexible.stardog.plan.filter.ExpressionEvaluationException - if there is an error while evaluating the functionprotected void assertRequiredArgs(int theArgs)
throws com.complexible.stardog.plan.filter.ExpressionEvaluationException
theArgs - the arguments to validatecom.complexible.stardog.plan.filter.ExpressionEvaluationException - if the function is missing, or has too many, argumentsprotected final org.openrdf.model.IRI assertIRI(org.openrdf.model.Value theValue)
throws com.complexible.stardog.plan.filter.ExpressionEvaluationException
theValue - the valuecom.complexible.stardog.plan.filter.ExpressionEvaluationException - if the value is not a URIprotected final org.openrdf.model.BNode assertBNode(org.openrdf.model.Value theValue)
throws com.complexible.stardog.plan.filter.ExpressionEvaluationException
theValue - the valuecom.complexible.stardog.plan.filter.ExpressionEvaluationException - if the value is not a BNodeprotected final org.openrdf.model.Literal assertLiteral(org.openrdf.model.Value theValue)
throws com.complexible.stardog.plan.filter.ExpressionEvaluationException
theValue - the valuecom.complexible.stardog.plan.filter.ExpressionEvaluationException - if the value is not a Literalprotected final org.openrdf.model.Literal assertStringLiteral(org.openrdf.model.Value theValue)
throws com.complexible.stardog.plan.filter.ExpressionEvaluationException
theValue - the valuecom.complexible.stardog.plan.filter.ExpressionEvaluationException - if the value is not a string Literalprotected final org.openrdf.model.Literal assertTypedLiteral(org.openrdf.model.Value theValue,
org.openrdf.model.IRI theDatatype)
throws com.complexible.stardog.plan.filter.ExpressionEvaluationException
theValue - the valuecom.complexible.stardog.plan.filter.ExpressionEvaluationException - if the value is not a Literalprotected final org.openrdf.model.Literal assertNumericLiteral(org.openrdf.model.Value theValue)
throws com.complexible.stardog.plan.filter.ExpressionEvaluationException
theValue - the valuecom.complexible.stardog.plan.filter.ExpressionEvaluationException - if the value is not a numeric Literalprotected final org.openrdf.model.Literal assertDecimalLiteral(org.openrdf.model.Value theValue)
throws com.complexible.stardog.plan.filter.ExpressionEvaluationException
theValue - the valuecom.complexible.stardog.plan.filter.ExpressionEvaluationException - if the value is not a decimal Literalprotected final org.openrdf.model.Literal assertIntegerLiteral(org.openrdf.model.Value theValue)
throws com.complexible.stardog.plan.filter.ExpressionEvaluationException
theValue - the valuecom.complexible.stardog.plan.filter.ExpressionEvaluationException - if the value is not an integer Literalprotected final org.openrdf.model.Literal assertSimpleLiteral(org.openrdf.model.Value theValue)
throws com.complexible.stardog.plan.filter.ExpressionEvaluationException
theValue - the valuecom.complexible.stardog.plan.filter.ExpressionEvaluationException - if the value is not a simple Literalprotected final org.openrdf.model.Literal assertPlainLiteral(org.openrdf.model.Value theValue)
throws com.complexible.stardog.plan.filter.ExpressionEvaluationException
theValue - the valuecom.complexible.stardog.plan.filter.ExpressionEvaluationException - if the value is not a plain Literalprotected final org.openrdf.model.Literal assertLiteral(org.openrdf.model.Value theValue,
com.google.common.base.Predicate<org.openrdf.model.IRI> theDatatypeChecker)
throws com.complexible.stardog.plan.filter.ExpressionEvaluationException
com.complexible.stardog.plan.filter.ExpressionEvaluationExceptionCopyright © 2010-2016 Stardog Union. All Rights Reserved.