public abstract class IVValueExpression<T extends IV> extends BOpBase implements IValueExpression<T>
Modifier and Type | Class and Description |
---|---|
static interface |
IVValueExpression.Annotations |
DEFAULT_INITIAL_CAPACITY
Constructor and Description |
---|
IVValueExpression(BOp[] args,
Map<String,Object> anns)
Required shallow copy constructor.
|
IVValueExpression(GlobalAnnotations globals,
NV... anns)
Zero arg convenience constructor.
|
IVValueExpression(IValueExpression<? extends IV> x,
GlobalAnnotations globals,
NV... anns)
One arg convenience constructor.
|
IVValueExpression(IVValueExpression<T> op)
Constructor required for
com.bigdata.bop.BOpUtility#deepCopy(FilterNode) . |
Modifier and Type | Method and Description |
---|---|
protected static Map<String,Object> |
anns(GlobalAnnotations globals,
NV... anns)
Used by subclasses to create the annotations object from the global
annotations and the custom annotations for the particular VE.
|
protected boolean |
areGlobalsRequired()
Returns
true unless overridden, meaning the
GlobalAnnotations are required for this value expression
(certain boolean value expressions do not require them). |
protected IV |
asIV(BigdataValue value,
IBindingSet bs)
Return an
IV for the Value . |
protected IV |
asIV(org.openrdf.model.Value value,
IBindingSet bs)
Return an
IV for the Value . |
static org.openrdf.model.Literal |
asLiteral(IV iv)
Return the
Literal for the IV . |
static org.openrdf.model.Value |
asValue(IV iv)
Return the
Value for the IV . |
IValueExpression<? extends IV> |
get(int i)
Return an argument to the operation.
|
protected IV |
getAndCheckBound(int i,
IBindingSet bs)
Get the function argument (a value expression) and evaluate it against
the source solution.
|
protected IV |
getAndCheckLiteral(int i,
IBindingSet bs)
Get the function argument (a value expression) and evaluate it against
the source solution.
|
protected org.openrdf.model.Literal |
getAndCheckLiteralValue(int i,
IBindingSet bs)
Combination of
getAndCheckLiteral(int, IBindingSet) and
asLiteral(IV) . |
protected ILexiconConfiguration<BigdataValue> |
getLexiconConfiguration(IBindingSet bset)
Return the
ILexiconConfiguration . |
protected String |
getNamespace()
Return the namespace of the
LexiconRelation . |
protected long |
getTimestamp()
Return the timestamp for the query.
|
protected BigdataValueFactory |
getValueFactory()
Return the
BigdataValueFactory for the LexiconRelation . |
protected String |
literalLabel(IV iv)
|
__replaceArg, _clearProperty, _set, _setProperty, annotations, annotationsCopy, annotationsEqual, annotationsRef, argIterator, args, argsCopy, arity, clearAnnotations, clearProperty, deepCopy, deepCopy, getProperty, setArg, setProperty, setUnboundProperty, toArray, toArray
annotationsEqual, annotationsToString, annotationsToString, annotationValueToString, checkArgs, clone, equals, getEvaluationContext, getId, getProperty, getRequiredProperty, hashCode, indent, isController, mutation, shortenName, toShortString, toString, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
get, toString
annotations, argIterator, args, arity, clone, getEvaluationContext, getId, getProperty, getRequiredProperty, isController, setProperty, toArray, toArray, toShortString, toString
getProperty
public IVValueExpression(GlobalAnnotations globals, NV... anns)
globals
- The global annotations, including the lexicon namespace.anns
- Any additional custom annotations.public IVValueExpression(IValueExpression<? extends IV> x, GlobalAnnotations globals, NV... anns)
globals
- The global annotations, including the lexicon namespace.anns
- Any additional custom annotations.public IVValueExpression(BOp[] args, Map<String,Object> anns)
public IVValueExpression(IVValueExpression<T> op)
com.bigdata.bop.BOpUtility#deepCopy(FilterNode)
.protected static Map<String,Object> anns(GlobalAnnotations globals, NV... anns)
globals
- The global annotations, including the lexicon namespace.anns
- Any additional custom annotations.public IValueExpression<? extends IV> get(int i)
BOp
get
in interface BOp
get
in class BOpBase
i
- The argument index in [0:BOp.arity()
-1].protected boolean areGlobalsRequired()
true
unless overridden, meaning the
GlobalAnnotations
are required for this value expression
(certain boolean value expressions do not require them). Global
annotations allow the method getValueFactory and getLexiconConfiguration
to work.protected BigdataValueFactory getValueFactory()
BigdataValueFactory
for the LexiconRelation
.
Note: This is lazily resolved and then cached.
protected String getNamespace()
LexiconRelation
.protected long getTimestamp()
protected ILexiconConfiguration<BigdataValue> getLexiconConfiguration(IBindingSet bset)
ILexiconConfiguration
. The result is cached. The cache
it will not be serialized when crossing a node boundary.
Note: It is more expensive to obtain the ILexiconConfiguration
than the BigdataValueFactory
because we have to resolve the
LexiconRelation
view. However, this happens once per function bop
in a query per node, so the cost is amortized.
bset
- A binding set flowing through this operator.ContextNotAvailableException
- if the context was not accessible on the solution.public static final org.openrdf.model.Literal asLiteral(IV iv)
Literal
for the IV
.iv
- The IV
.Literal
.SparqlTypeErrorException
- if the argument is null
.SparqlTypeErrorException
- if the argument does not represent a Literal
.NotMaterializedException
- if the IVCache
is not set and the IV
can not
be turned into a Literal
without an index read.public static final org.openrdf.model.Value asValue(IV iv)
Value
for the IV
.iv
- The IV
.Value
.SparqlTypeErrorException
- if the argument is null
.NotMaterializedException
- if the IVCache
is not set and the IV
can not
be turned into a Literal
without an index read.protected final String literalLabel(IV iv) throws NotMaterializedException
iv
- The IV
.Literal.getLabel()
for that IV
.NullPointerException
- if the argument is null
.NotMaterializedException
- if the IVCache
is not set and the IV
must be
materialized before it can be converted into an RDF
Value
.protected IV getAndCheckLiteral(int i, IBindingSet bs) throws SparqlTypeErrorException, NotMaterializedException
i
- The index of the function argument ([0...n-1]).bs
- The source solution.IndexOutOfBoundsException
- if the index is not the index of an operator for this
operator.SparqlTypeErrorException
- if the value expression at that index can not be evaluated.NotMaterializedException
- if evaluation encountered an IV
whose IVCache
was not set when the value expression required a materialized
RDF Value
.protected IV getAndCheckBound(int i, IBindingSet bs) throws SparqlTypeErrorException, NotMaterializedException
i
- The index of the function argument ([0...n-1]).bs
- The source solution.IndexOutOfBoundsException
- if the index is not the index of an operator for this
operator.SparqlTypeErrorException
- if the value expression at that index can not be evaluated.NotMaterializedException
protected org.openrdf.model.Literal getAndCheckLiteralValue(int i, IBindingSet bs)
getAndCheckLiteral(int, IBindingSet)
and
asLiteral(IV)
.protected final IV asIV(org.openrdf.model.Value value, IBindingSet bs)
IV
for the Value
.value
- The Value
.bs
- The bindings on the solution are ignored, but the reference is
used to obtain the ILexiconConfiguration
.IV
for that Value
.protected IV asIV(BigdataValue value, IBindingSet bs)
IV
for the Value
.
If the supplied BigdataValue has an IV, cache the BigdataValue on the IV and return it. If there is no IV, first check the LexiconConfiguration to see if an inline IV can be created. As a last resort, create a "dummy IV" (a TermIV with a "0" reference) for the value.
value
- The BigdataValue
bs
- The bindings on the solution are ignored, but the reference is
used to obtain the ILexiconConfiguration
.IV
for that BigdataValue
.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.