rdf_fusion_encoding/
encoding_name.rs

1/// Represents the name of a single [TermEncoding](crate::TermEncoding).
2///
3/// RDF Fusion allows users to define multiple encodings for RDF terms. This allows specializing the
4/// Arrow arrays used for holding the results of queries.
5///
6/// # Order
7///
8/// The order defined over the [EncodingName] defines how much information they preserve.
9/// - [Self::ObjectId] and [Self::PlainTerm] preserve the entire information.
10/// - [Self::TypedValue] preserves the value of the term, but not their lexical form.
11/// - [Self::Sortable] can loose information (e.g., precision in numerics)
12#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub enum EncodingName {
14    /// Name of the [ObjectIdEncoding](crate::object_id::ObjectIdEncoding). Represents all terms,
15    /// including literals, as a unique identifier.
16    ObjectId,
17    /// Name of the [PlainTermEncoding](crate::plain_term::PlainTermEncoding). Represents all terms,
18    /// including literals, using their lexical value.
19    PlainTerm,
20    /// Name of the [TypedValueEncoding](crate::typed_value::TypedValueEncoding). Represents
21    /// IRIs and blank nodes using their lexical value and literals as their typed value.
22    TypedValue,
23    /// Name of the [SortableTermEncoding](crate::sortable_term::SortableTermEncoding) which is used
24    /// for sorting. We plan to remove this encoding in the future, once we can introduce custom
25    /// orderings into the query engine.
26    Sortable,
27}