public class GeoSpatialLiteralExtension<V extends BigdataValue> extends Object implements IExtension<V>
"2#4"^^
The two components are first broken down long integers, namely
- 2 -> 00000000 00000000 00000010
- 4 -> 00000000 00000000 00000100
The z-order encoding of these two strings is then
00000000 00000000 00000000 00000000 00000000 00000000 00011000
Interpreted as BigInteger, this is the value 24, which is stored as integer
literal in the database. The asValue method reverts this (lossless) encoding.Constructor and Description |
---|
GeoSpatialLiteralExtension(IDatatypeURIResolver resolver,
GeoSpatialDatatypeConfiguration config)
Constructor setting up an instance with a default schema description.
|
Modifier and Type | Method and Description |
---|---|
long[] |
asLongArray(LiteralExtensionIV iv)
Decodes an xsd:integer into the long values of the z-order components
represented through the xsd:integer.
|
V |
asValue(LiteralExtensionIV iv,
BigdataValueFactory vf)
Decodes an xsd:integer into an n-dimensional string of the form
|
long[] |
componentsAsLongArr(Object[] components,
GeoSpatialDatatypeConfiguration datatypeConfig)
Convert the components into a long array.
|
LiteralExtensionIV |
createIV(Object[] components)
Create an IV from a given value (where the value must be a Literal).
|
LiteralExtensionIV |
createIV(org.openrdf.model.Value value)
Create an IV from a given value (where the value must be a Literal).
|
LiteralExtensionIV |
createIVFromZOrderByteArray(byte[] zOrderByteArray)
Create an IV from a two's complement byte array
Implements transformation E->F
|
protected Long |
decodeRangeShift(Long val,
Long minValue)
Invert
encodeRangeShift(Long, Long) operation. |
protected Long |
encodeRangeShift(Long val,
Long minValue)
Shift values according to the minValue, making sure that we encode the
lowest value in the range as the lowest value 00000000...
|
long[] |
fromZOrderByteArray(byte[] byteArr)
Converts a z-order byte array to a long array representing the components.
|
GeoSpatialDatatypeConfiguration |
getDatatypeConfig() |
Set<BigdataURI> |
getDatatypes()
Return the fully resolved datatype(s) handled by this interface in the
form of a
BigdataURI with the TermId already set. |
int |
getNumDimensions()
Return the number of dimensions of the literal
|
Object[] |
longArrAsComponentArr(long[] arr)
Converts a a Long[] reflecting the long values of the individual
components back into a component array representing the literal.
|
byte[] |
padLeadingZero(byte[] arr)
Pads a leading zero byte to the byte array.
|
Object[] |
toComponentArray(LiteralExtensionIV iv)
Conversion of a an IV into its component array.
|
byte[] |
toZOrderByteArray(AbstractLiteralIV<BigdataLiteral,?> literalIV)
Converts an IV to a zOrderByte array (without leading zero).
|
byte[] |
toZOrderByteArray(BigInteger bigInt)
Decodes a BigInteger into a zOrder byte[] (without leading zero).
|
byte[] |
toZOrderByteArray(long[] componentsAsLongArr,
GeoSpatialDatatypeConfiguration datatypeConfig)
Converts a long array representing the components to a z-order byte array.
|
byte[] |
toZOrderByteArray(Object[] components)
Create a two-components byte[] from a component array.
|
byte[] |
unpadLeadingZero(byte[] arr)
Reverts method {
padLeadingZero(byte[]) . |
public GeoSpatialLiteralExtension(IDatatypeURIResolver resolver, GeoSpatialDatatypeConfiguration config)
resolver
- public Set<BigdataURI> getDatatypes()
IExtension
BigdataURI
with the TermId
already set.getDatatypes
in interface IExtension<V extends BigdataValue>
public LiteralExtensionIV createIV(org.openrdf.model.Value value)
createIV
in interface IExtension<V extends BigdataValue>
value
- The RDF Value
IV
-or- null
if the
Value
can not be inlined using this IExtension
.public LiteralExtensionIV createIV(Object[] components)
public byte[] toZOrderByteArray(Object[] components)
public LiteralExtensionIV createIVFromZOrderByteArray(byte[] zOrderByteArray)
public final long[] componentsAsLongArr(Object[] components, GeoSpatialDatatypeConfiguration datatypeConfig)
SchemaDescription
.
Implements step B->C.public byte[] toZOrderByteArray(long[] componentsAsLongArr, GeoSpatialDatatypeConfiguration datatypeConfig)
protected Long encodeRangeShift(Long val, Long minValue)
public byte[] padLeadingZero(byte[] arr)
BigInteger
constructor (which expects a two's complement input).
Implements step D->E.public V asValue(LiteralExtensionIV iv, BigdataValueFactory vf)
asValue
in interface IExtension<V extends BigdataValue>
iv
- The extension IV
vf
- The bigdata value factoryValue
public long[] asLongArray(LiteralExtensionIV iv)
iv
- public Object[] toComponentArray(LiteralExtensionIV iv)
public byte[] toZOrderByteArray(BigInteger bigInt)
public byte[] toZOrderByteArray(AbstractLiteralIV<BigdataLiteral,?> literalIV)
public long[] fromZOrderByteArray(byte[] byteArr)
protected Long decodeRangeShift(Long val, Long minValue)
encodeRangeShift(Long, Long)
operation.
Implements steps D1->C.public final Object[] longArrAsComponentArr(long[] arr)
public byte[] unpadLeadingZero(byte[] arr)
padLeadingZero(byte[])
.
Implements step E->D.public int getNumDimensions()
public GeoSpatialDatatypeConfiguration getDatatypeConfig()
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.