Problem
Generic xsd:duration values are stored as canonical strings in the string dict at index build (resolver.rs, DurationStr arm — chosen because general durations have no total order), under OType::XSD_DURATION. But the binary decode path is a stub:
// fluree-db-binary-index/src/read/binary_index_store.rs (~:856)
DecodeKind::Duration => {
// Compound duration — not yet fully supported in V5 either.
Ok(FlakeValue::Null)
}
So an indexed generic duration decodes as Null on any binary-cursor read — the value is effectively lost after reindex on that path. (xsd:yearMonthDuration and xsd:dayTimeDuration are unaffected: they have inline order-preserving encodings and decode correctly.)
Knock-on effects
- Overlay translation deliberately keeps
FlakeValue::Duration in the unsupported set (value_to_otype_okey catch-all comment): translating a novelty duration into a binary row would lose the value, while the raw-flake merge path preserves it. Fixing the decode is the prerequisite for translating durations and removing them from the raw-flake lane.
Fix sketch
The stored o_key is a string dict id holding the canonical lexical form, so decode can resolve the string and parse it back (Duration::parse of the canonical string), mirroring how the value was written. Then add the matching translation arm (canonicalize → resolve_string_v3, which already covers dict-novelty strings).
Acceptance
- Insert → reindex → SELECT round-trips a generic
xsd:duration value on the binary path.
- Novelty durations translate into V3 overlay ops instead of taking the raw-flake lane.
Problem
Generic
xsd:durationvalues are stored as canonical strings in the string dict at index build (resolver.rs,DurationStrarm — chosen because general durations have no total order), underOType::XSD_DURATION. But the binary decode path is a stub:So an indexed generic duration decodes as
Nullon any binary-cursor read — the value is effectively lost after reindex on that path. (xsd:yearMonthDurationandxsd:dayTimeDurationare unaffected: they have inline order-preserving encodings and decode correctly.)Knock-on effects
FlakeValue::Durationin the unsupported set (value_to_otype_okeycatch-all comment): translating a novelty duration into a binary row would lose the value, while the raw-flake merge path preserves it. Fixing the decode is the prerequisite for translating durations and removing them from the raw-flake lane.Fix sketch
The stored o_key is a string dict id holding the canonical lexical form, so decode can resolve the string and parse it back (
Duration::parseof the canonical string), mirroring how the value was written. Then add the matching translation arm (canonicalize →resolve_string_v3, which already covers dict-novelty strings).Acceptance
xsd:durationvalue on the binary path.