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).
NumericalBlankNode
Blank node with a numeric unique id.
SmallBlankNode(SmallString)
Blank node with a short inline id.
BigBlankNode
Blank node with a long hash-referenced id.
SmallStringLiteral(SmallString)
Short plain literal.
BigStringLiteral
Long plain literal.
SmallSmallLangStringLiteral
Lang string: small value, small language.
SmallBigLangStringLiteral
Lang string: small value, big language.
BigSmallLangStringLiteral
Lang string: big value, small language.
BigBigLangStringLiteral
Lang string: big value, big language.
SmallTypedLiteral
Typed literal: small value.
BigTypedLiteral
Typed literal: big value.
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
geo_datatype: GeoDatatypegeo: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
geo_datatype: GeoDatatypegeo:wktLiteral or geo:wkbLiteral.
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.
Implementations§
Source§impl EncodedTerm
impl EncodedTerm
Sourcepub const fn requires_spike_reduction(&self) -> bool
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
impl Clone for EncodedTerm
Source§fn clone(&self) -> EncodedTerm
fn clone(&self) -> EncodedTerm
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EncodedTerm
impl Debug for EncodedTerm
Source§impl From<&BlankNode> for EncodedTerm
impl From<&BlankNode> for EncodedTerm
Source§impl From<&GraphName> for EncodedTerm
impl From<&GraphName> for EncodedTerm
Source§impl From<&Literal> for EncodedTerm
impl From<&Literal> for EncodedTerm
Source§impl From<&NamedNode> for EncodedTerm
impl From<&NamedNode> for EncodedTerm
Source§impl From<&NamedOrBlankNode> for EncodedTerm
impl From<&NamedOrBlankNode> for EncodedTerm
Source§fn from(term: &NamedOrBlankNode) -> Self
fn from(term: &NamedOrBlankNode) -> Self
Source§impl From<&Term> for EncodedTerm
impl From<&Term> for EncodedTerm
Source§impl Hash for EncodedTerm
impl Hash for EncodedTerm
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).
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.