public class FullyInlineTypedLiteralIV<V extends BigdataLiteral> extends AbstractLiteralIV<V,String> implements IInlineUnicode, org.openrdf.model.Literal
Literal
s. Literals may be plain (just a
label), have a datatype URI, or have a language code. In each case, all
information is inlined. This class is mainly targeted at inlining small plain
literals and language code literals, but may also be used to fully inline
literals in scale-out (which can be an attractive option).
Note: Optimized support for xsd:string
inlining is provided by
the XSDStringExtension
.
TODO Validate methods on this class against Literal
and
BigdataLiteralImpl
(API compliance).
flags
Constructor and Description |
---|
FullyInlineTypedLiteralIV(String label) |
FullyInlineTypedLiteralIV(String label,
boolean temp) |
FullyInlineTypedLiteralIV(String label,
String languageCode,
org.openrdf.model.URI datatypeURI) |
FullyInlineTypedLiteralIV(String label,
String languageCode,
org.openrdf.model.URI datatypeURI,
boolean temp) |
FullyInlineTypedLiteralIV(String label,
String languageCode,
org.openrdf.model.URI datatypeURI,
int byteLength) |
FullyInlineTypedLiteralIV(String label,
String languageCode,
org.openrdf.model.URI datatypeURI,
int byteLength,
boolean temp) |
Modifier and Type | Method and Description |
---|---|
int |
_compareTo(IV o)
Compare two
IV s having the same intrinsic datatype. |
V |
asValue(LexiconRelation lex)
If the value is not already cached, then inflate an inline RDF value to a
BigdataValue and cache it on a private field. |
int |
byteLength()
The byte length of the encoded
IV . |
IV<V,String> |
clone(boolean clearCache)
Return a copy of this
IV . |
boolean |
equals(Object o)
Return true iff the two
IV s are the same point in the same value
space. |
org.openrdf.model.URI |
getDatatype()
Overrides
AbstractLiteralIV.getDatatype() . |
String |
getInlineValue()
Return the Java
Object corresponding to the inline value. |
String |
getLabel()
Overrides
AbstractLiteralIV.getLabel() . |
String |
getLanguage()
Overrides
AbstractLiteralIV.getLanguage() . |
byte |
getTermCode()
Indicates what "type" of literal this is.
|
int |
hashCode()
Return the hash code of the label (per
Literal.hashCode() ) |
boolean |
isNullIV()
|
void |
setByteLength(int byteLength)
Cache the byteLength on the
IV . |
booleanValue, byteValue, calendarValue, decimalValue, doubleValue, floatValue, integerValue, intValue, longValue, needsMaterialization, shortValue, stringValue, toString
isInline
compareTo, encode, flags, getDTE, getDTE, getDTEX, getInternalValueTypeEnum, getValue, getValueCache, getVTE, getVTE, hasValue, isBigNumeric, isBNode, isExtension, isExtension, isFixedNumeric, isFloatingPointNumeric, isInline, isLiteral, isNumeric, isResource, isSignedNumeric, isStatement, isUnsignedNumeric, isURI, isVocabulary, setValue, toFlags
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
booleanValue, byteValue, calendarValue, decimalValue, doubleValue, floatValue, integerValue, intValue, longValue, shortValue
encode, flags, getDTE, getDTEX, getVTE, isBigNumeric, isBNode, isExtension, isFixedNumeric, isFloatingPointNumeric, isInline, isLiteral, isNumeric, isResource, isSignedNumeric, isStatement, isUnsignedNumeric, isURI, isVocabulary
compareTo
public FullyInlineTypedLiteralIV(String label)
public FullyInlineTypedLiteralIV(String label, boolean temp)
public FullyInlineTypedLiteralIV(String label, String languageCode, org.openrdf.model.URI datatypeURI)
public FullyInlineTypedLiteralIV(String label, String languageCode, org.openrdf.model.URI datatypeURI, boolean temp)
public FullyInlineTypedLiteralIV(String label, String languageCode, org.openrdf.model.URI datatypeURI, int byteLength)
public IV<V,String> clone(boolean clearCache)
IVCache
IV
.
Note: This method exists to defeat the hard reference from the IV
to the cached BigdataValue
in order to avoid a memory leak when
the IV
is used as the key in a weak value cache whose value is
the BigdataValue
. Therefore, certain IV
implementations
MAY return this when they are used for limited collections. The
vocabulary IVs are the primary example. For the same reason, we do not
need to recursively break the link from the IV
to the
BigdataValue
for IV
s which embed other IV
s.
clone
in interface IVCache<V extends BigdataLiteral,String>
clearCache
- When true
the cached reference (if any) will NOT
be set on the copy.(Thread-local
cache combined with unbounded thread pools causes effective memory
leak)
public final String getInlineValue()
IV
Object
corresponding to the inline value.getInlineValue
in interface IV<V extends BigdataLiteral,String>
Object
.public boolean isNullIV()
AbstractIV
true
iff the IV
represents a null
IV
reference. null
IV
s are somewhat special.
They get used as wild cards for the keys in the justifications index and
perhaps (?) in a few other locations.
This implementation returns false
. It is overridden by
TermId
.
isNullIV
in interface IV<V extends BigdataLiteral,String>
isNullIV
in class AbstractIV<V extends BigdataLiteral,String>
public final String getLabel()
AbstractLiteralIV.getLabel()
.getLabel
in interface org.openrdf.model.Literal
getLabel
in class AbstractLiteralIV<V extends BigdataLiteral,String>
public final String getLanguage()
AbstractLiteralIV.getLanguage()
.getLanguage
in interface org.openrdf.model.Literal
getLanguage
in class AbstractLiteralIV<V extends BigdataLiteral,String>
public final org.openrdf.model.URI getDatatype()
AbstractLiteralIV.getDatatype()
.getDatatype
in interface org.openrdf.model.Literal
getDatatype
in class AbstractLiteralIV<V extends BigdataLiteral,String>
public final byte getTermCode()
ITermIndexCodes
public V asValue(LexiconRelation lex)
IVCache
BigdataValue
and cache it on a private field.
Note: Query plans are responsible for ensuring that IV
s have been
materialized before operators are evaluated which invoke this method.
This pattern ensures that efficient batch operators are used to
materialize Value
s, and thereby avoids heavy RMI overhead in
scale-out, and provides operators which use IVCache.getValue()
with a
simple method signature which does not require access to the lexicon.
Query plans are also responsible for dropping variables once they are no
longer needed or, in the case of large values and BLOBs, dropping the
cached BigdataValue
when possible in order to avoid excess
network and heap overhead.
asValue
in interface IVCache<V extends BigdataLiteral,String>
lex
- The lexicon relation (this is required in order to access the
BigdataValueFactory
for the namespace associated with
lexicon when we materialize an inline IV
).BigdataValue
.public boolean equals(Object o)
AbstractIV
IV
s are the same point in the same value
space. Points in different value spaces (as identified by different
datatype URIs) are NOT equal even if they have the same value in the
corresponding primitive data type.
Note: The IV
implementations typically DO NOT compare equals()
with BigdataValue
s. Therefore you MUST NOT mix IV
s and
BigdataValue
s in the keys of a map or the values of a set.
equals
in interface org.openrdf.model.Literal
equals
in class AbstractIV<V extends BigdataLiteral,String>
public int hashCode()
Literal.hashCode()
)hashCode
in interface org.openrdf.model.Literal
hashCode
in class AbstractIV<V extends BigdataLiteral,String>
public int byteLength()
IV
IV
.byteLength
in interface IV<V extends BigdataLiteral,String>
public final void setByteLength(int byteLength)
IInlineUnicode
IV
.setByteLength
in interface IInlineUnicode
byteLength
- The byteLength.public int _compareTo(IV o)
IV
s having the same intrinsic datatype.
Note: The ordering here is defined over the datatype or language code
followed by the label. The Unicode compression scheme (BOCU) preserves
the code point order, so we can compare the String
values of the
datatype URI and/or language code and the labels to determine the
ordering. The ordering provided is disjoint across distinct datatypes and
language codes. It is the same order which is present for the keys in the
index. The [termCode] is used to partition the space into plain literals,
language code literals, and datatype literals. Orderings are defined
within those partitions.
_compareTo
in class AbstractIV<V extends BigdataLiteral,String>
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.