TypedValueEncoding

Struct TypedValueEncoding 

Source
pub struct TypedValueEncoding;
Expand description

The TypedValueEncoding stores the value of an RDF term as a union of possible types.

§Value Spaces

Each RDF literal type has an associated value space (e.g., xsd:int has the value space of 32-bit integers). Transforming the transformation from the lexical space to the value space might be a lossy transformation. For example, the two distinct RDF terms "1"^^xsd::int and "01"^^xsd::int map to the same value. The TypedValueEncoding cannot distinguish between these two terms and therefore should only be used for query parts that do not rely on this distinction.

§Future Plans

Currently, the TypedValue encoding has a fixed Arrow DataType. We plan to change that in the future such that users can provide custom encodings for domain-specific literals (e.g., geospatial coordinates).

Implementations§

Trait Implementations§

Source§

impl Debug for TypedValueEncoding

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl TermDecoder<TypedValueEncoding> for BooleanTermValueDecoder

Source§

type Term<'data> = Boolean

The resulting value type of decoding an RDF term.
Source§

fn decode_terms( array: &<TypedValueEncoding as TermEncoding>::Array, ) -> impl Iterator<Item = ThinResult<Self::Term<'_>>>

Allows extracting an iterator over all RDF terms in array that are compatible with this decoder (see TermDecoder for more information). Read more
Source§

fn decode_term( scalar: &<TypedValueEncoding as TermEncoding>::Scalar, ) -> ThinResult<Self::Term<'_>>

Allows extracting an iterator over all RDF terms in array that are compatible with this decoder (see TermDecoder for more information). Read more
Source§

impl TermDecoder<TypedValueEncoding> for DateTimeTermValueDecoder

Source§

type Term<'data> = DateTime

The resulting value type of decoding an RDF term.
Source§

fn decode_terms( array: &<TypedValueEncoding as TermEncoding>::Array, ) -> impl Iterator<Item = ThinResult<Self::Term<'_>>>

Allows extracting an iterator over all RDF terms in array that are compatible with this decoder (see TermDecoder for more information). Read more
Source§

fn decode_term( scalar: &<TypedValueEncoding as TermEncoding>::Scalar, ) -> ThinResult<Self::Term<'_>>

Allows extracting an iterator over all RDF terms in array that are compatible with this decoder (see TermDecoder for more information). Read more
Source§

impl TermDecoder<TypedValueEncoding> for DefaultTypedValueDecoder

Source§

type Term<'data> = TypedValueRef<'data>

The resulting value type of decoding an RDF term.
Source§

fn decode_terms( array: &<TypedValueEncoding as TermEncoding>::Array, ) -> impl Iterator<Item = ThinResult<Self::Term<'_>>>

Allows extracting an iterator over all RDF terms in array that are compatible with this decoder (see TermDecoder for more information). Read more
Source§

fn decode_term( scalar: &<TypedValueEncoding as TermEncoding>::Scalar, ) -> ThinResult<Self::Term<'_>>

Allows extracting an iterator over all RDF terms in array that are compatible with this decoder (see TermDecoder for more information). Read more
Source§

impl TermDecoder<TypedValueEncoding> for IntegerTermValueDecoder

Source§

type Term<'data> = Integer

The resulting value type of decoding an RDF term.
Source§

fn decode_terms( array: &<TypedValueEncoding as TermEncoding>::Array, ) -> impl Iterator<Item = ThinResult<Self::Term<'_>>>

Allows extracting an iterator over all RDF terms in array that are compatible with this decoder (see TermDecoder for more information). Read more
Source§

fn decode_term( scalar: &<TypedValueEncoding as TermEncoding>::Scalar, ) -> ThinResult<Self::Term<'_>>

Allows extracting an iterator over all RDF terms in array that are compatible with this decoder (see TermDecoder for more information). Read more
Source§

impl TermDecoder<TypedValueEncoding> for NamedNodeRefTermValueDecoder

Source§

type Term<'data> = NamedNodeRef<'data>

The resulting value type of decoding an RDF term.
Source§

fn decode_terms( array: &<TypedValueEncoding as TermEncoding>::Array, ) -> impl Iterator<Item = ThinResult<Self::Term<'_>>>

Allows extracting an iterator over all RDF terms in array that are compatible with this decoder (see TermDecoder for more information). Read more
Source§

fn decode_term( scalar: &<TypedValueEncoding as TermEncoding>::Scalar, ) -> ThinResult<Self::Term<'_>>

Allows extracting an iterator over all RDF terms in array that are compatible with this decoder (see TermDecoder for more information). Read more
Source§

impl TermDecoder<TypedValueEncoding> for NumericTermValueDecoder

Source§

type Term<'data> = Numeric

The resulting value type of decoding an RDF term.
Source§

fn decode_terms( array: &<TypedValueEncoding as TermEncoding>::Array, ) -> impl Iterator<Item = ThinResult<Self::Term<'_>>>

Allows extracting an iterator over all RDF terms in array that are compatible with this decoder (see TermDecoder for more information). Read more
Source§

fn decode_term( scalar: &<TypedValueEncoding as TermEncoding>::Scalar, ) -> ThinResult<Self::Term<'_>>

Allows extracting an iterator over all RDF terms in array that are compatible with this decoder (see TermDecoder for more information). Read more
Source§

impl TermDecoder<TypedValueEncoding> for SimpleLiteralRefTermValueDecoder

Source§

type Term<'data> = SimpleLiteralRef<'data>

The resulting value type of decoding an RDF term.
Source§

fn decode_terms( array: &<TypedValueEncoding as TermEncoding>::Array, ) -> impl Iterator<Item = ThinResult<Self::Term<'_>>>

Allows extracting an iterator over all RDF terms in array that are compatible with this decoder (see TermDecoder for more information). Read more
Source§

fn decode_term( scalar: &<TypedValueEncoding as TermEncoding>::Scalar, ) -> ThinResult<Self::Term<'_>>

Allows extracting an iterator over all RDF terms in array that are compatible with this decoder (see TermDecoder for more information). Read more
Source§

impl TermDecoder<TypedValueEncoding> for StringLiteralRefTermValueDecoder

Source§

type Term<'data> = StringLiteralRef<'data>

The resulting value type of decoding an RDF term.
Source§

fn decode_terms( array: &<TypedValueEncoding as TermEncoding>::Array, ) -> impl Iterator<Item = ThinResult<Self::Term<'_>>>

Allows extracting an iterator over all RDF terms in array that are compatible with this decoder (see TermDecoder for more information). Read more
Source§

fn decode_term( scalar: &<TypedValueEncoding as TermEncoding>::Scalar, ) -> ThinResult<Self::Term<'_>>

Allows extracting an iterator over all RDF terms in array that are compatible with this decoder (see TermDecoder for more information). Read more
Source§

impl TermEncoder<TypedValueEncoding> for BlankNodeRefTermValueEncoder

Source§

type Term<'data> = BlankNodeRef<'data>

The value type that is being encoded.
Source§

fn encode_terms<'data>( terms: impl IntoIterator<Item = ThinResult<Self::Term<'data>>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Array>

Allows encoding an iterator over RDF terms in an Arrow array.
Source§

fn encode_term( term: ThinResult<Self::Term<'_>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Scalar>

Allows encoding a scalar RDF term in an Arrow scalar.
Source§

impl TermEncoder<TypedValueEncoding> for BlankNodeTermValueEncoder

Source§

type Term<'data> = BlankNode

The value type that is being encoded.
Source§

fn encode_terms<'data>( terms: impl IntoIterator<Item = ThinResult<Self::Term<'data>>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Array>

Allows encoding an iterator over RDF terms in an Arrow array.
Source§

fn encode_term( term: ThinResult<Self::Term<'_>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Scalar>

Allows encoding a scalar RDF term in an Arrow scalar.
Source§

impl TermEncoder<TypedValueEncoding> for BooleanTermValueEncoder

Source§

type Term<'data> = Boolean

The value type that is being encoded.
Source§

fn encode_terms<'data>( terms: impl IntoIterator<Item = ThinResult<Self::Term<'data>>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Array>

Allows encoding an iterator over RDF terms in an Arrow array.
Source§

fn encode_term( term: ThinResult<Self::Term<'_>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Scalar>

Allows encoding a scalar RDF term in an Arrow scalar.
Source§

impl TermEncoder<TypedValueEncoding> for DateTimeTermValueEncoder

Source§

type Term<'data> = DateTime

The value type that is being encoded.
Source§

fn encode_terms<'data>( terms: impl IntoIterator<Item = ThinResult<Self::Term<'data>>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Array>

Allows encoding an iterator over RDF terms in an Arrow array.
Source§

fn encode_term( term: ThinResult<Self::Term<'_>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Scalar>

Allows encoding a scalar RDF term in an Arrow scalar.
Source§

impl TermEncoder<TypedValueEncoding> for DayTimeDurationTermValueEncoder

Source§

type Term<'data> = DayTimeDuration

The value type that is being encoded.
Source§

fn encode_terms<'data>( terms: impl IntoIterator<Item = ThinResult<Self::Term<'data>>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Array>

Allows encoding an iterator over RDF terms in an Arrow array.
Source§

fn encode_term( term: ThinResult<Self::Term<'_>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Scalar>

Allows encoding a scalar RDF term in an Arrow scalar.
Source§

impl TermEncoder<TypedValueEncoding> for DecimalTermValueEncoder

Source§

type Term<'data> = Decimal

The value type that is being encoded.
Source§

fn encode_terms<'data>( terms: impl IntoIterator<Item = ThinResult<Self::Term<'data>>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Array>

Allows encoding an iterator over RDF terms in an Arrow array.
Source§

fn encode_term( term: ThinResult<Self::Term<'_>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Scalar>

Allows encoding a scalar RDF term in an Arrow scalar.
Source§

impl TermEncoder<TypedValueEncoding> for DefaultTypedValueEncoder

Source§

type Term<'data> = TypedValueRef<'data>

The value type that is being encoded.
Source§

fn encode_terms<'data>( terms: impl IntoIterator<Item = ThinResult<Self::Term<'data>>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Array>

Allows encoding an iterator over RDF terms in an Arrow array.
Source§

fn encode_term( term: ThinResult<Self::Term<'_>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Scalar>

Allows encoding a scalar RDF term in an Arrow scalar.
Source§

impl TermEncoder<TypedValueEncoding> for DoubleTermValueEncoder

Source§

type Term<'data> = Double

The value type that is being encoded.
Source§

fn encode_terms<'data>( terms: impl IntoIterator<Item = ThinResult<Self::Term<'data>>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Array>

Allows encoding an iterator over RDF terms in an Arrow array.
Source§

fn encode_term( term: ThinResult<Self::Term<'_>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Scalar>

Allows encoding a scalar RDF term in an Arrow scalar.
Source§

impl TermEncoder<TypedValueEncoding> for FloatTermValueEncoder

Source§

type Term<'data> = Float

The value type that is being encoded.
Source§

fn encode_terms<'data>( terms: impl IntoIterator<Item = ThinResult<Self::Term<'data>>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Array>

Allows encoding an iterator over RDF terms in an Arrow array.
Source§

fn encode_term( term: ThinResult<Self::Term<'_>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Scalar>

Allows encoding a scalar RDF term in an Arrow scalar.
Source§

impl TermEncoder<TypedValueEncoding> for IntTermValueEncoder

Source§

type Term<'data> = Int

The value type that is being encoded.
Source§

fn encode_terms<'data>( terms: impl IntoIterator<Item = ThinResult<Self::Term<'data>>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Array>

Allows encoding an iterator over RDF terms in an Arrow array.
Source§

fn encode_term( term: ThinResult<Self::Term<'_>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Scalar>

Allows encoding a scalar RDF term in an Arrow scalar.
Source§

impl TermEncoder<TypedValueEncoding> for IntegerTermValueEncoder

Source§

type Term<'data> = Integer

The value type that is being encoded.
Source§

fn encode_terms<'data>( terms: impl IntoIterator<Item = ThinResult<Self::Term<'data>>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Array>

Allows encoding an iterator over RDF terms in an Arrow array.
Source§

fn encode_term( term: ThinResult<Self::Term<'_>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Scalar>

Allows encoding a scalar RDF term in an Arrow scalar.
Source§

impl TermEncoder<TypedValueEncoding> for LiteralRefTermValueEncoder

Source§

type Term<'data> = LiteralRef<'data>

The value type that is being encoded.
Source§

fn encode_terms<'data>( terms: impl IntoIterator<Item = ThinResult<Self::Term<'data>>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Array>

Allows encoding an iterator over RDF terms in an Arrow array.
Source§

fn encode_term( term: ThinResult<Self::Term<'_>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Scalar>

Allows encoding a scalar RDF term in an Arrow scalar.
Source§

impl TermEncoder<TypedValueEncoding> for NamedNodeRefTermValueEncoder

Source§

type Term<'data> = NamedNodeRef<'data>

The value type that is being encoded.
Source§

fn encode_terms<'data>( terms: impl IntoIterator<Item = ThinResult<Self::Term<'data>>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Array>

Allows encoding an iterator over RDF terms in an Arrow array.
Source§

fn encode_term( term: ThinResult<Self::Term<'_>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Scalar>

Allows encoding a scalar RDF term in an Arrow scalar.
Source§

impl TermEncoder<TypedValueEncoding> for NamedNodeTermValueEncoder

Source§

type Term<'data> = NamedNode

The value type that is being encoded.
Source§

fn encode_terms<'data>( terms: impl IntoIterator<Item = ThinResult<Self::Term<'data>>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Array>

Allows encoding an iterator over RDF terms in an Arrow array.
Source§

fn encode_term( term: ThinResult<Self::Term<'_>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Scalar>

Allows encoding a scalar RDF term in an Arrow scalar.
Source§

impl TermEncoder<TypedValueEncoding> for NumericTypedValueEncoder

Source§

type Term<'data> = Numeric

The value type that is being encoded.
Source§

fn encode_terms<'data>( terms: impl IntoIterator<Item = ThinResult<Self::Term<'data>>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Array>

Allows encoding an iterator over RDF terms in an Arrow array.
Source§

fn encode_term( term: ThinResult<Self::Term<'_>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Scalar>

Allows encoding a scalar RDF term in an Arrow scalar.
Source§

impl TermEncoder<TypedValueEncoding> for OwnedStringLiteralTermValueEncoder

Source§

type Term<'data> = OwnedStringLiteral

The value type that is being encoded.
Source§

fn encode_terms<'data>( terms: impl IntoIterator<Item = ThinResult<Self::Term<'data>>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Array>

Allows encoding an iterator over RDF terms in an Arrow array.
Source§

fn encode_term( term: ThinResult<Self::Term<'_>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Scalar>

Allows encoding a scalar RDF term in an Arrow scalar.
Source§

impl TermEncoder<TypedValueEncoding> for SimpleLiteralRefTermValueEncoder

Source§

type Term<'data> = SimpleLiteralRef<'data>

The value type that is being encoded.
Source§

fn encode_terms<'data>( terms: impl IntoIterator<Item = ThinResult<Self::Term<'data>>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Array>

Allows encoding an iterator over RDF terms in an Arrow array.
Source§

fn encode_term( term: ThinResult<Self::Term<'_>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Scalar>

Allows encoding a scalar RDF term in an Arrow scalar.
Source§

impl TermEncoder<TypedValueEncoding> for StringLiteralRefTermValueEncoder

Source§

type Term<'data> = StringLiteralRef<'data>

The value type that is being encoded.
Source§

fn encode_terms<'data>( terms: impl IntoIterator<Item = ThinResult<Self::Term<'data>>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Array>

Allows encoding an iterator over RDF terms in an Arrow array.
Source§

fn encode_term( term: ThinResult<Self::Term<'_>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Scalar>

Allows encoding a scalar RDF term in an Arrow scalar.
Source§

impl TermEncoder<TypedValueEncoding> for TermRefTypedValueEncoder

Source§

type Term<'data> = TermRef<'data>

The value type that is being encoded.
Source§

fn encode_terms<'data>( terms: impl IntoIterator<Item = ThinResult<Self::Term<'data>>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Array>

Allows encoding an iterator over RDF terms in an Arrow array.
Source§

fn encode_term( term: ThinResult<Self::Term<'_>>, ) -> DFResult<<TypedValueEncoding as TermEncoding>::Scalar>

Allows encoding a scalar RDF term in an Arrow scalar.
Source§

impl TermEncoding for TypedValueEncoding

Source§

type Array = TypedValueArray

Represents a wrapper for Arrow arrays of this encoding. This can be used in conjunction with TermDecoder to obtain the values from an Arrow array.
Source§

type Scalar = TypedValueScalar

Represents a wrapper for Arrow scalars of this encoding. This can be used in conjunction with TermDecoder to obtain the values from an Arrow scalar.
Source§

fn name(&self) -> EncodingName

Returns the name of the encoding.
Source§

fn data_type(&self) -> DataType

Returns the DataType that is used for this encoding. Read more
Source§

fn try_new_array(&self, array: ArrayRef) -> DFResult<Self::Array>

Checks whether array contains a value with the correct encoding (i.e., type and possibly metadata checks). If yes, returns an instance of Self::Array. Otherwise, an error is returned.
Source§

fn try_new_scalar(&self, scalar: ScalarValue) -> DFResult<Self::Scalar>

Checks whether scalar contains a value with the correct encoding (i.e., type and possibly metadata checks). If yes, returns an instance of Self::Scalar. Otherwise, an error is returned.
Source§

fn try_new_datum( &self, value: ColumnarValue, number_rows: usize, ) -> DFResult<EncodingDatum<Self>>

Checks whether value contains a value with the correct encoding (i.e., type and possibly metadata checks). If yes, returns a datum that either wraps an array or a scalar. Otherwise, an error is returned.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> ErasedDestructor for T
where T: 'static,