Skip to main content

EncodedTerm

Enum EncodedTerm 

Source
pub enum EncodedTerm {
Show 33 variants DefaultGraph, Placeholder, NamedNode { iri_id: StrHash, }, NumericalBlankNode { id: [u8; 16], }, SmallBlankNode(SmallString), BigBlankNode { id_id: StrHash, }, SmallStringLiteral(SmallString), BigStringLiteral { value_id: StrHash, }, SmallSmallLangStringLiteral { value: SmallString, language: SmallString, }, SmallBigLangStringLiteral { value: SmallString, language_id: StrHash, }, BigSmallLangStringLiteral { value_id: StrHash, language: SmallString, }, BigBigLangStringLiteral { value_id: StrHash, language_id: StrHash, }, SmallTypedLiteral { value: SmallString, datatype_id: StrHash, }, BigTypedLiteral { value_id: StrHash, datatype_id: StrHash, }, BooleanLiteral(Boolean), FloatLiteral(Float), DoubleLiteral(Double), IntegerLiteral(Integer), DecimalLiteral(Decimal), DateTimeLiteral(DateTime), TimeLiteral(Time), DateLiteral(Date), GYearMonthLiteral(GYearMonth), GYearLiteral(GYear), GMonthDayLiteral(GMonthDay), GDayLiteral(GDay), GMonthLiteral(GMonth), DurationLiteral(Duration), YearMonthDurationLiteral(YearMonthDuration), DayTimeDurationLiteral(DayTimeDuration), LiteralPoint { x: f64, y: f64, crs: CrsId, geo_datatype: GeoDatatype, }, LiteralGeometry { geom_kind: GeomKind, crs: CrsId, geo_datatype: GeoDatatype, blob_id: StrHash, requires_spike_reduction: bool, }, BlobLiteral { datatype_id: StrHash, blob_id: StrHash, },
}
Expand description

Encoded RDF term for storage keys and wire transfer.

Variants§

§

DefaultGraph

Default graph (zero bytes on the wire).

§

Placeholder

Query-local intern sentinel only (TermDict map index 0; reverse lookup returns SPARQL unbound). Never written to hexastore keys. Wire type byte 48 ([TYPE_PLACEHOLDER]), zero payload.

§

NamedNode

Named node (always hash-referenced).

Fields

§iri_id: StrHash

IRI hash.

§

NumericalBlankNode

Blank node with a numeric unique id.

Fields

§id: [u8; 16]

u128 big-endian id bytes.

§

SmallBlankNode(SmallString)

Blank node with a short inline id.

§

BigBlankNode

Blank node with a long hash-referenced id.

Fields

§id_id: StrHash

Blank-node id hash.

§

SmallStringLiteral(SmallString)

Short plain literal.

§

BigStringLiteral

Long plain literal.

Fields

§value_id: StrHash

Lexical form hash.

§

SmallSmallLangStringLiteral

Lang string: small value, small language.

Fields

§value: SmallString

Lexical form.

§language: SmallString

Language tag.

§

SmallBigLangStringLiteral

Lang string: small value, big language.

Fields

§value: SmallString

Lexical form.

§language_id: StrHash

Language tag hash.

§

BigSmallLangStringLiteral

Lang string: big value, small language.

Fields

§value_id: StrHash

Lexical form hash.

§language: SmallString

Language tag.

§

BigBigLangStringLiteral

Lang string: big value, big language.

Fields

§value_id: StrHash

Lexical form hash.

§language_id: StrHash

Language tag hash.

§

SmallTypedLiteral

Typed literal: small value.

Fields

§value: SmallString

Lexical form.

§datatype_id: StrHash

Datatype IRI hash.

§

BigTypedLiteral

Typed literal: big value.

Fields

§value_id: StrHash

Lexical form hash.

§datatype_id: StrHash

Datatype IRI hash.

§

BooleanLiteral(Boolean)

xsd:boolean.

§

FloatLiteral(Float)

xsd:float.

§

DoubleLiteral(Double)

xsd:double.

§

IntegerLiteral(Integer)

xsd:integer family.

§

DecimalLiteral(Decimal)

xsd:decimal.

§

DateTimeLiteral(DateTime)

xsd:dateTime.

§

TimeLiteral(Time)

xsd:time.

§

DateLiteral(Date)

xsd:date.

§

GYearMonthLiteral(GYearMonth)

xsd:gYearMonth.

§

GYearLiteral(GYear)

xsd:gYear.

§

GMonthDayLiteral(GMonthDay)

xsd:gMonthDay.

§

GDayLiteral(GDay)

xsd:gDay.

§

GMonthLiteral(GMonth)

xsd:gMonth.

§

DurationLiteral(Duration)

xsd:duration.

§

YearMonthDurationLiteral(YearMonthDuration)

xsd:yearMonthDuration.

§

DayTimeDurationLiteral(DayTimeDuration)

xsd:dayTimeDuration.

§

LiteralPoint

Native 2D geo point: CRS84 lon/lat inline (f64 × 2), ingest CrsId recorded for output. 19 bytes on the wire. Minted only by the geo encode plugin after CRS transform + [geo::Validation]-style checks — plain From<&Literal> never parses GeoSPARQL.

Fields

§x: f64

Longitude in CRS84 (degrees).

§y: f64

Latitude in CRS84 (degrees).

§crs: CrsId

Ingest CRS (what geof:getSRID and WKT output name).

§geo_datatype: GeoDatatype

geo:wktLiteral or geo:wkbLiteral.

§

LiteralGeometry

Native non-point geometry: geom_kind / crs / geo_datatype inline, canonical CRS84 EWKB in the blob store (blob_id = SipHash of those bytes, same 16-byte layout as StrHash). 20 bytes on the wire. The spike-reduction flag occupies an otherwise unused high bit of the geometry-kind byte, so it adds no width. No inline bbox — the term is copied into every hexastore permutation and would blow the 33-byte limit once CRS/kind are present.

Fields

§geom_kind: GeomKind

Shape class (Point… GeometryCollection; Unknown for open kinds).

§crs: CrsId

Ingest CRS.

§geo_datatype: GeoDatatype

geo:wktLiteral or geo:wkbLiteral.

§blob_id: StrHash

Content-addressed blob id (SipHash of the CRS84 EWKB bytes).

§requires_spike_reduction: bool

The blob retains an exactly retraced zero-area spike. Spatial evaluation must derive the reduced geometry before covering or Relate; lexical materialization still renders the original blob.

§

BlobLiteral

Generic large binary typed literal (not UTF-8): datatype IRI hash + content-addressed blob id. 33 bytes on the wire. v1 write paths mint blobs only for geo EWKB (which uses EncodedTerm::LiteralGeometry in the hexastore); this variant exists so the blob store is not geo-only.

Fields

§datatype_id: StrHash

Datatype IRI hash (registered like any datatype IRI).

§blob_id: StrHash

Content-addressed blob id.

Implementations§

Source§

impl EncodedTerm

Source

pub const fn requires_spike_reduction(&self) -> bool

Whether this native geometry retains a tolerated zero-area spike that must be reduced before spatial evaluation.

Trait Implementations§

Source§

impl Clone for EncodedTerm

Source§

fn clone(&self) -> EncodedTerm

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EncodedTerm

Source§

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

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

impl From<&BlankNode> for EncodedTerm

Source§

fn from(blank_node: &BlankNode) -> Self

Converts to this type from the input type.
Source§

impl From<&GraphName> for EncodedTerm

Source§

fn from(name: &GraphName) -> Self

Converts to this type from the input type.
Source§

impl From<&Literal> for EncodedTerm

Source§

fn from(literal: &Literal) -> Self

Converts to this type from the input type.
Source§

impl From<&NamedNode> for EncodedTerm

Source§

fn from(named_node: &NamedNode) -> Self

Converts to this type from the input type.
Source§

impl From<&NamedOrBlankNode> for EncodedTerm

Source§

fn from(term: &NamedOrBlankNode) -> Self

Converts to this type from the input type.
Source§

impl From<&Term> for EncodedTerm

Source§

fn from(term: &Term) -> Self

Converts to this type from the input type.
Source§

impl Hash for EncodedTerm

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for EncodedTerm

Term identity is BIT identity, arm-for-arm with Hash: the engine’s hash-keyed structures (TermDict interning, DISTINCT seen-sets, join keys, walker membership sets) find buckets by Hash and confirm by this PartialEq, and storage keys plus the wire carry exact bits. The original derive was IEEE on the float payloads and broke the Eq/Hash contract in BOTH directions — +0.0 == -0.0 compared true where the bit hashes differ, and NaN != NaN compared false where the bit hashes agree — so one NaN literal double-interned into two TermIds and counted twice in COUNT(DISTINCT).

Value semantics never lived here and still do not: equals / value_equals compare numeric payloads (op:numeric-equal), so FILTER = keeps +0.0 = -0.0 → true and NaN = NaN → false. RDF term identity is lexical, and bit identity tracks it through the canonical value encoding: the same lexical parses to the same bits → one term (sameTerm("NaN", "NaN") is true), distinct lexicals (+0.0 / -0.0) stay distinct terms (sameTerm is false). See docs/modules/developer/pages/sparql-deviations.adoc.

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for EncodedTerm

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

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

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,