moonsdmx

    Structure-aware multidimensional statistical data exchange for MoonBit

    sdmx
    data-exchange
    dimensions
    metadata
    Download zip
    Author
    Version
    0.1.0
    License
    MIT
    Last updated
    1 hour ago
    Downloads
    2

    #MoonSDMX

    MoonBit 原生的结构感知多维数据交换库。 在 JSON/CSV 与图表、分析和导入管道之间,保留“维度键—观测值—单位—质量状态—附着范围”的含义。

    例如,两个部门都提交 120,只有结合地区、指标、报告期、单位和质量标记才能使用。MoonSDMX 读取明确受限的 SDMX-CSV 2.0.0 / SDMX-JSON Data Message 2.0.0,展开索引与继承属性,校验代码表及完整键,提供选择、重编码、修订比较和稳定分页。核心独立使用 MoonBit 实现,无 Python/Java/JS 计算绑定。

    #当前状态

    版本 0.1.0,模块 xingsiyi/moonsdmx,MIT 许可证;公开仓库 · Mooncakes · Linux/Windows CI。CI 固定 compiler/core 0.10.16+b1a0e846e。

    #能力与生态价值

    能力解决的问题
    结构校验代码表、有序维度、完整键、重复项、必需值及附着属性一致性
    结构感知交换CSV 列重排;JSON dataset/series/observation 索引与 keyPosition、多度量、默认及继承属性、注释
    精确值模型缺值与零分开、保留原小数文本、有界精确十进制、报告期区间
    安全转换维度选择、期间查询、保持身份的重排、全代码域无碰撞映射、保留必需元数据的投影
    修订及计划新增/撤回/逐字段修改;全快照前置条件和最终一致性校验的显式本地编辑
    分页与覆盖内容绑定 keyset 游标;缺值、未出现代码及频率分析,不暗中合并不同单位

    通用 DataFrame/CSV 库提供行列处理;本库增加 SDMX 语义解释,并可将结果交给这些库。它与本地纠删恢复、时间数据库、事件模式及流程发现项目具有不同核心。选题核查截至 2026-10-22:检索官方 3,226 模块目录、GitHub 近邻及本地 20 个项目,未发现相同 SDMX 核心;这是有范围的检索结论。

    #构建与运行

    验证环境:moonc v0.10.16、moon 0.1.20261016;仅依赖 core 和 moonbitlang/x@0.4.49。

    moon update moon check --target all --deny-warn moon build --target all --deny-warn moon test --target all --deny-warn moon run --target native examples/open_data moon run --target native examples/department_kpi moon run --target native examples/research_revision moon run --target native examples/energy_catalog moon run --target native --release examples/scale

    Windows v0.10.16 扩展驱动器路径问题可用 ./scripts/Invoke-Moon.ps1 test --target all --deny-warn 等同等命令。辅助脚本仅规范化安装的编译器/格式化器路径参数,不修改全局工具链。其他版本优先正常 moon 命令。

    #API 示例

    在已有 MoonBit 工程中安装:

    moon add xingsiyi/moonsdmx@0.1.0

    在使用方 moon.pkg 中配置 import { "xingsiyi/moonsdmx" @sdmx, }。以下代码可放在 fn main raise { ... } 内运行:

    let structure = @sdmx.Structure::new(
    @sdmx.StructureRef::new("DEMO", "METRICS", "1.0"), [
    @sdmx.Component::new("REGION", @sdmx.Dimension, @sdmx.Text),
    @sdmx.Component::new("TIME_PERIOD", @sdmx.TimeDimension, @sdmx.Period),
    @sdmx.Component::new("OBS_VALUE", @sdmx.Measure, @sdmx.Decimal),
    @sdmx.Component::new("UNIT", @sdmx.Attribute(["REGION"]), @sdmx.Text, required=true),
    ],
    )
    let row = @sdmx.Observation::new(
    structure, ["N", "2026-01"], [Some("1.2300")], [Some("kWh")],
    )
    let data = @sdmx.Dataset::new(structure, [row])
    let message = @sdmx.DataMessage::new(@sdmx.Datastructure, structure.reference(), data)
    let json = message.encode_json2(id="demo", sender="DEMO", prepared="2026-10-23T00:00:00Z")
    let restored = @sdmx.decode_json2(json, expected=Some(structure))
    assert_eq(restored.dataset().fingerprint(), data.fingerprint())

    接口见 pkg.generated.mbti,完整用法见 examples/。Structure::from_profile_json 使用本项目的 moonsdmx.structure/1 配置格式,不是 SDMX Registry Structure Message 解析器。

    #四个完整场景

    场景实际结果与失败路径示例
    开放数据到仪表盘三层维度展开、单位与注释继承、地区和月份筛选、null 与零保留;注释不能静默丢到 CSVexamples/open_data
    部门 KPI 交换共享 DSD 及代码表,接受不同列顺序,拒绝未知部门和附着单位冲突examples/department_kpi
    研究修订复核1 新增、1 撤回、2 修订;null→0 及状态变化;过期计划拒绝,旧快照不变examples/research_revision
    能源环境目录迁移全代码域重编码、保留 kWh/MWh 和月/季粒度、两页遍历、过期游标拒绝、覆盖缺口examples/energy_catalog

    examples/scale 验证 10,000 条观测的 JSON 交换、内容指纹一致和 79 页遍历,并断言 1,429 个缺值保留。elapsed_ms 为本机端到端墙钟观测,包含模型、编解码、排序/哈希及分页,不是跨机器性能承诺。

    #本地 CLI

    CLI 承诺 native 运行;仅读取显式文件,不跟随远程链接:

    moon run --target native cmd/moonsdmx -- json2csv MESSAGE.json moon run --target native cmd/moonsdmx -- json2csv --drop-annotations MESSAGE.json moon run --target native cmd/moonsdmx -- extract-structure MESSAGE.json moon run --target native cmd/moonsdmx -- validate-csv STRUCTURE.json DATA.csv moon run --target native cmd/moonsdmx -- csv2json STRUCTURE.json DATA.csv msg DEMO 2026-10-23T00:00:00Z moon run --target native cmd/moonsdmx -- reencode-json2 MESSAGE.json msg DEMO 2026-10-23T00:00:00Z

    末尾增加 --output NEW_PATH 输出精确 UTF-8,已有路径拒绝;完整验证后才写入。它不是并发文件系统事务,宿主应避免竞争写同一路径。stdout 适于交互查看;保存含换行字段的精确 CSV 应使用文件输出。

    #保证与边界

    支持范围 列出具体拒绝项。Information 交换与本地编辑分开,不将 SDMX Append/Replace/Delete 自动应用到存储。指纹和游标用于变化检测,不是身份认证。宿主负责授权、并发和持久化事务、业务冲突及单位转换。

    设 N 行、C 组件、D 维度、K 代码、P 页长,忽略字符串长度:构造/验证及转换约 O(NC),索引 O(N);确定性排序/指纹增加 O(N log N);分页快照 O(N log N·D),续页 O(log N·D+PC);重编码还需 O(K log K) 域核查。字符与哈希处理按文本长度收费。输入、展开总文本、字段、代码、行列、注释引用及输出均有上限;完整结果占 O(NC) 内存。

    #验证与维护

    测试覆盖结构/代码域/附着关系、CSV 引号及截断、JSON 索引/默认/继承/null、独立整数 oracle 小数比较、日历边界、注释转换、预算、映射碰撞、游标失效、计划原子性及修订。官方固定 JSON 2.0 Schema 和三种官方样本另在 Git 外完成完整键、值、属性及注释对照;未将其冒作原创数据。

    scripts/verify_repository.py 检查 >4,000 行有效生产 MoonBit、>30 条非空提交及私有材料不进入历史;排除测试、示例和生成接口。Linux/Windows CI 覆盖四后端检查/构建/测试、格式/接口、六个场景和打包卫生;独立官方样本验证与格式边界见支持范围,配置本身不替代执行结果。来源与许可见 THIRD_PARTY_NOTICES.md。

    #十一月新增功能

    结构一致的分区合并(Dataset::merge_partition);保留单位与缺值的精确分组汇总(Dataset::grouped_totals)。详见功能、用途和边界,运行 moon run examples/november --target native --deny-warn。功能已包含于0.1.0,安装方式见上文。

    SdmxError

    pub(all) suberror SdmxError {
    Invalid(path~ : String, reason~ : String)
    Limit(resource~ : String, maximum~ : Int)
    Unsupported(feature~ : String)
    Conflict(key~ : String, reason~ : String)
    } derive(
    Debug
    )

    SdmxError::message

    fn SdmxError::message(self : SdmxError) -> String

    Annotation

    pub struct Annotation {
    // private fields
    } derive(Eq,
    Debug
    )

    An annotation object is retained as bounded canonical JSON, without fetching URLs.

    Annotation::equal

    fn Annotation::equal(Annotation, Annotation) -> Bool

    Annotation::from_json

    fn Annotation::from_json(text : String, limits? : Limits) -> Annotation raise SdmxError

    Annotation::not_equal

    fn Annotation::not_equal(x : Annotation, y : Annotation) -> Bool

    Annotation::to_json

    fn Annotation::to_json(self : Annotation) -> String

    CodeList

    pub struct CodeList {
    // private fields
    } derive(
    Debug
    )

    CodeList::contains

    fn CodeList::contains(self : CodeList, code : String) -> Bool

    CodeList::entries

    fn CodeList::entries(self : CodeList) -> Array[(String, String)]

    CodeList::id

    fn CodeList::id(self : CodeList) -> String

    CodeList::label

    fn CodeList::label(self : CodeList, code : String) -> String?

    CodeList::new

    fn CodeList::new(id : String, entries : Array[(String, String)], limits? : Limits) -> CodeList raise SdmxError

    CodeList::to_repr

    CodeMapping

    pub struct CodeMapping {
    // private fields
    }

    CodeMapping::dimension

    fn CodeMapping::dimension(self : CodeMapping) -> String

    CodeMapping::new

    fn CodeMapping::new(dimension : String, pairs : Array[(String, String)], limits? : Limits) -> CodeMapping raise SdmxError

    Unspecified codes retain their identity. Only coded identifying dimensions may be recoded: measures and unit/other attributes require semantic conversion.

    Component

    pub struct Component {
    // private fields
    } derive(
    Debug
    )

    Component::id

    fn Component::id(self : Component) -> String

    Component::name

    fn Component::name(self : Component) -> String

    Component::new

    fn Component::new(id : String, role : Role, representation : Representation, name? : String, required? : Bool) -> Component raise SdmxError

    Component::representation

    fn Component::representation(self : Component) -> Representation

    Component::required

    fn Component::required(self : Component) -> Bool

    Component::role

    fn Component::role(self : Component) -> Role

    DataMessage

    pub struct DataMessage {
    // private fields
    } derive(
    Debug
    )

    A dissemination message. Mutating SDMX actions are deliberately not applied.

    DataMessage::annotations

    fn DataMessage::annotations(self : DataMessage) -> Array[Annotation]

    DataMessage::annotations_for

    fn DataMessage::annotations_for(self : DataMessage, key : Array[String]) -> Array[Annotation] raise SdmxError

    DataMessage::dataset

    fn DataMessage::dataset(self : DataMessage) -> Dataset

    DataMessage::encode_csv2

    fn DataMessage::encode_csv2(self : DataMessage) -> String raise SdmxError

    DataMessage::encode_json2

    fn DataMessage::encode_json2(self : DataMessage, id~ : String, sender~ : String, prepared~ : String) -> String raise SdmxError

    DataMessage::kind

    DataMessage::new

    fn DataMessage::new(kind : ExchangeKind, reference : StructureRef, dataset : Dataset) -> DataMessage raise SdmxError

    DataMessage::reference

    fn DataMessage::reference(self : DataMessage) -> StructureRef

    DataMessage::with_annotations

    fn DataMessage::with_annotations(self : DataMessage, notes : Array[Annotation], bindings : Array[(Array[String], Array[Int])]) -> DataMessage raise SdmxError

    DataMessage::without_annotations

    fn DataMessage::without_annotations(self : DataMessage) -> DataMessage

    Dataset

    pub struct Dataset {
    // private fields
    } derive(
    Debug
    )

    Dataset::apply_local_plan

    fn Dataset::apply_local_plan(self : Dataset, plan : LocalPlan) -> Dataset raise SdmxError

    Dataset::coverage

    fn Dataset::coverage(self : Dataset) -> DatasetCoverage raise SdmxError

    Coverage describes reported cells and vocabularies; it does not aggregate values across units, frequencies, quality statuses or unit multipliers.

    Dataset::dimension_values

    fn Dataset::dimension_values(self : Dataset, id : String) -> Array[String] raise SdmxError

    Dataset::fingerprint

    fn Dataset::fingerprint(self : Dataset) -> String raise SdmxError

    A deterministic content fingerprint, not a signature or authentication check.

    Dataset::get

    fn Dataset::get(self : Dataset, key : Array[String]) -> Observation? raise SdmxError

    Dataset::grouped_totals

    fn Dataset::grouped_totals(self : Dataset, measure : String, by : Array[String]) -> Array[MeasureTotal] raise SdmxError

    Explicit numeric measure only. All attributes and period frequency remain grouping keys, so units/quality/frequency are never silently combined. Caller chooses whether summing observations is meaningful for its metric.

    Dataset::length

    fn Dataset::length(self : Dataset) -> Int

    Dataset::merge_partition

    fn Dataset::merge_partition(self : Dataset, other : Dataset, allow_identical? : Bool) -> Dataset raise SdmxError

    Merge compatible partitions, preserving first-seen order. Repeated keys are rejected unless explicitly allowed AND every measure/attribute is identical.

    Dataset::new

    fn Dataset::new(structure : Structure, rows : Array[Observation]) -> Dataset raise SdmxError

    Dataset::observations

    fn Dataset::observations(self : Dataset) -> Array[Observation]

    Dataset::periods_contained

    fn Dataset::periods_contained(self : Dataset, window : PeriodWindow) -> Dataset raise SdmxError

    Dataset::periods_overlapping

    fn Dataset::periods_overlapping(self : Dataset, window : PeriodWindow) -> Dataset raise SdmxError

    Dataset::project

    fn Dataset::project(self : Dataset, target : Structure, measures : Array[String], attributes : Array[String]) -> Dataset raise SdmxError

    Project explicit measure/attribute lists; all dimensions and every required measure/attribute must remain. Optional metadata is dropped only by omission from the explicit list; retained metadata and attachments cannot be rewritten.

    Dataset::recode

    fn Dataset::recode(self : Dataset, target : Structure, mappings : Array[CodeMapping]) -> Dataset raise SdmxError

    Recode one or more coded dimensions without changing row identity cardinality. The target structure is explicit even for a same-version code-label migration. Mapping validation covers the full source domain, including unobserved codes.

    Dataset::reorder_dimensions

    fn Dataset::reorder_dimensions(self : Dataset, target : Structure) -> Dataset raise SdmxError

    Change dimension order using an explicitly supplied target structure. No dimension, measure, attachment, representation or metadata is removed.

    Dataset::revisions_to

    fn Dataset::revisions_to(self : Dataset, next : Dataset) -> DatasetRevision raise SdmxError

    Dataset::select

    fn Dataset::select(self : Dataset, selection : Selection) -> Dataset raise SdmxError

    Dataset::snapshot_signature

    fn Dataset::snapshot_signature(self : Dataset) -> String raise SdmxError

    Dataset::sorted

    fn Dataset::sorted(self : Dataset) -> Dataset raise SdmxError

    Dataset::structure

    fn Dataset::structure(self : Dataset) -> Structure

    Dataset::to_repr

    Dataset::validate_frequency

    fn Dataset::validate_frequency(self : Dataset, frequency_dimension : String) -> Unit raise SdmxError

    Optional cross-component constraint; only the documented A/S/Q/M/D codes apply.

    Dataset::validate_with

    fn Dataset::validate_with(self : Dataset, structure : Structure) -> Dataset raise SdmxError

    DatasetCoverage

    pub struct DatasetCoverage {
    // private fields
    } derive(
    Debug
    )

    DatasetCoverage::attributes

    DatasetCoverage::dimensions

    DatasetCoverage::measures

    DatasetCoverage::observation_count

    fn DatasetCoverage::observation_count(self : DatasetCoverage) -> Int

    DatasetCoverage::period_frequencies

    fn DatasetCoverage::period_frequencies(self : DatasetCoverage) -> Array[(String, Int)]

    DatasetCoverage::to_json

    fn DatasetCoverage::to_json(self : DatasetCoverage) -> String raise SdmxError

    DatasetPage

    pub struct DatasetPage {
    // private fields
    }

    DatasetPage::next_cursor

    fn DatasetPage::next_cursor(self : DatasetPage) -> PageCursor?

    DatasetPage::observations

    fn DatasetPage::observations(self : DatasetPage) -> Array[Observation]

    DatasetPage::snapshot

    fn DatasetPage::snapshot(self : DatasetPage) -> String

    DatasetRevision

    pub struct DatasetRevision {
    // private fields
    } derive(
    Debug
    )

    DatasetRevision::added

    DatasetRevision::changed

    DatasetRevision::is_empty

    fn DatasetRevision::is_empty(self : DatasetRevision) -> Bool

    DatasetRevision::removed

    DatasetRevision::to_json

    fn DatasetRevision::to_json(self : DatasetRevision) -> String raise SdmxError

    DecimalValue

    pub struct DecimalValue {
    // private fields
    } derive(Eq,
    Debug
    )

    DecimalValue::add

    fn DecimalValue::add(self : DecimalValue, other : DecimalValue) -> DecimalValue raise SdmxError

    DecimalValue::compare_value

    fn DecimalValue::compare_value(self : DecimalValue, other : DecimalValue) -> Int

    DecimalValue::equal

    DecimalValue::format

    fn DecimalValue::format(self : DecimalValue) -> String

    DecimalValue::is_integer

    fn DecimalValue::is_integer(self : DecimalValue) -> Bool

    DecimalValue::not_equal

    fn DecimalValue::not_equal(x : DecimalValue, y : DecimalValue) -> Bool

    DecimalValue::parse

    fn DecimalValue::parse(text : String) -> DecimalValue raise SdmxError

    DimensionCoverage

    pub(all) struct DimensionCoverage {
    id : String
    observed_values : Int
    declared_codes : Int?
    unseen_codes : Array[String]
    } derive(
    Debug
    )

    DimensionPredicate

    type DimensionPredicate

    ExchangeKind

    pub(all) enum ExchangeKind {
    Dataflow
    Datastructure
    Dataprovision
    } derive(Eq,
    Debug
    )

    ExchangeKind::equal

    ExchangeKind::format

    fn ExchangeKind::format(self : ExchangeKind) -> String

    ExchangeKind::not_equal

    fn ExchangeKind::not_equal(x : ExchangeKind, y : ExchangeKind) -> Bool

    ExchangeKind::parse

    fn ExchangeKind::parse(text : String) -> ExchangeKind raise SdmxError

    FieldRevision

    pub struct FieldRevision {
    // private fields
    } derive(Eq,
    Debug
    )

    FieldRevision::after

    fn FieldRevision::after(self : FieldRevision) -> String?

    FieldRevision::before

    fn FieldRevision::before(self : FieldRevision) -> String?

    FieldRevision::component

    fn FieldRevision::component(self : FieldRevision) -> String

    FieldRevision::equal

    FieldRevision::not_equal

    fn FieldRevision::not_equal(x : FieldRevision, y : FieldRevision) -> Bool

    Granularity

    pub(all) enum Granularity {
    Annual
    HalfYear
    Quarterly
    Monthly
    Daily
    } derive(Eq,
    Debug
    )

    Granularity::equal

    fn Granularity::equal(Granularity, Granularity) -> Bool

    Granularity::not_equal

    fn Granularity::not_equal(x : Granularity, y : Granularity) -> Bool

    Limits

    pub struct Limits {
    // private fields
    } derive(Eq,
    Debug
    )

    Limits::equal

    fn Limits::equal(Limits, Limits) -> Bool

    Limits::max_rows

    fn Limits::max_rows(self : Limits) -> Int

    Limits::new

    fn Limits::new(max_text? : Int, max_rows? : Int, max_columns? : Int, max_field? : Int, max_codes? : Int, max_output? : Int) -> Limits raise SdmxError

    Limits::not_equal

    fn Limits::not_equal(x : Limits, y : Limits) -> Bool

    Limits::standard

    fn Limits::standard() -> Limits

    Limits::to_repr

    LocalChangeKind

    type LocalChangeKind derive(
    Debug
    )

    LocalOperation

    pub struct LocalOperation {
    // private fields
    } derive(
    Debug
    )

    LocalOperation::attributes

    fn LocalOperation::attributes(self : LocalOperation) -> Array[String?]

    LocalOperation::delete_exact

    fn LocalOperation::delete_exact(base : Dataset, key : Array[String]) -> LocalOperation raise SdmxError

    LocalOperation::expected

    fn LocalOperation::expected(self : LocalOperation) -> Observation?

    LocalOperation::key

    fn LocalOperation::key(self : LocalOperation) -> Array[String]

    LocalOperation::kind

    fn LocalOperation::kind(self : LocalOperation) -> String

    LocalOperation::measures

    fn LocalOperation::measures(self : LocalOperation) -> Array[String?]

    LocalOperation::merge_present

    fn LocalOperation::merge_present(base : Dataset, key : Array[String], measures : Array[String?], attributes : Array[String?]) -> LocalOperation raise SdmxError

    LocalOperation::replace_observation

    fn LocalOperation::replace_observation(base : Dataset, key : Array[String], measures : Array[String?], attributes : Array[String?]) -> LocalOperation raise SdmxError

    LocalPlan

    pub struct LocalPlan {
    // private fields
    } derive(
    Debug
    )

    LocalPlan::base_signature

    fn LocalPlan::base_signature(self : LocalPlan) -> String

    LocalPlan::length

    fn LocalPlan::length(self : LocalPlan) -> Int

    LocalPlan::new

    fn LocalPlan::new(base : Dataset, operations : Array[LocalOperation]) -> LocalPlan raise SdmxError

    LocalPlan::operations

    fn LocalPlan::operations(self : LocalPlan) -> Array[LocalOperation]

    LocalPlan::to_json

    fn LocalPlan::to_json(self : LocalPlan) -> String raise SdmxError

    MeasureTotal

    pub(all) struct MeasureTotal {
    dimension_values : Array[String]
    attributes : Array[String?]
    frequency : String?
    reported : Int
    missing : Int
    total : String?
    }

    Observation

    pub struct Observation {
    // private fields
    } derive(Eq,
    Debug
    )

    Observation::attributes

    fn Observation::attributes(self : Observation) -> Array[String?]

    Observation::equal

    fn Observation::equal(Observation, Observation) -> Bool

    Observation::key

    fn Observation::key(self : Observation) -> Array[String]

    Observation::key_token

    fn Observation::key_token(self : Observation) -> String

    Observation::measures

    fn Observation::measures(self : Observation) -> Array[String?]

    Observation::new

    fn Observation::new(structure : Structure, key : Array[String], measures : Array[String?], attributes : Array[String?]) -> Observation raise SdmxError

    Observation::not_equal

    fn Observation::not_equal(x : Observation, y : Observation) -> Bool

    Observation::value

    fn Observation::value(self : Observation, structure : Structure, id : String) -> String? raise SdmxError

    ObservationRevision

    pub struct ObservationRevision {
    // private fields
    } derive(
    Debug
    )

    ObservationRevision::attributes

    ObservationRevision::key

    fn ObservationRevision::key(self : ObservationRevision) -> Array[String]

    ObservationRevision::measures

    PageCursor

    pub struct PageCursor {
    // private fields
    }

    PageCursor::after_key

    fn PageCursor::after_key(self : PageCursor) -> Array[String]

    PageCursor::from_json

    fn PageCursor::from_json(text : String, limits? : Limits) -> PageCursor raise SdmxError

    PageCursor::page_size

    fn PageCursor::page_size(self : PageCursor) -> Int

    PageCursor::snapshot

    fn PageCursor::snapshot(self : PageCursor) -> String

    PageCursor::to_json

    fn PageCursor::to_json(self : PageCursor, limits? : Limits) -> String raise SdmxError

    A bounded transport token, not an authorization credential or signed receipt.

    PageSnapshot

    pub struct PageSnapshot {
    // private fields
    }

    PageSnapshot::fingerprint

    fn PageSnapshot::fingerprint(self : PageSnapshot) -> String

    PageSnapshot::length

    fn PageSnapshot::length(self : PageSnapshot) -> Int

    PageSnapshot::new

    fn PageSnapshot::new(data : Dataset) -> PageSnapshot raise SdmxError

    Cache one immutable sorted index and one fingerprint. Rows are shared with the immutable dataset internally; pages detach only their selected records.

    PageSnapshot::page

    fn PageSnapshot::page(self : PageSnapshot, page_size? : Int, after? : PageCursor?) -> DatasetPage raise SdmxError

    Keyset continuation is bound to structure, values and page size. Changed content rejects old cursors, even when observation count and keys are equal. A selected/period-filtered dataset naturally has a different fingerprint.

    PeriodValue

    pub struct PeriodValue {
    // private fields
    } derive(Eq,
    Debug
    )

    PeriodValue::code

    fn PeriodValue::code(self : PeriodValue) -> String

    PeriodValue::compare_period

    fn PeriodValue::compare_period(self : PeriodValue, other : PeriodValue) -> Int

    PeriodValue::contains_period

    fn PeriodValue::contains_period(self : PeriodValue, other : PeriodValue) -> Bool

    PeriodValue::day_bounds

    fn PeriodValue::day_bounds(self : PeriodValue) -> (Int, Int)

    PeriodValue::equal

    fn PeriodValue::equal(PeriodValue, PeriodValue) -> Bool

    PeriodValue::frequency

    fn PeriodValue::frequency(self : PeriodValue) -> String

    PeriodValue::granularity

    fn PeriodValue::granularity(self : PeriodValue) -> Granularity

    PeriodValue::not_equal

    fn PeriodValue::not_equal(x : PeriodValue, y : PeriodValue) -> Bool

    PeriodValue::overlaps

    fn PeriodValue::overlaps(self : PeriodValue, other : PeriodValue) -> Bool

    PeriodValue::parse

    fn PeriodValue::parse(text : String) -> PeriodValue raise SdmxError

    PeriodWindow

    pub struct PeriodWindow {
    // private fields
    } derive(Eq,
    Debug
    )

    PeriodWindow::equal

    PeriodWindow::new

    fn PeriodWindow::new(first : PeriodValue, through : PeriodValue) -> PeriodWindow raise SdmxError

    PeriodWindow::not_equal

    fn PeriodWindow::not_equal(x : PeriodWindow, y : PeriodWindow) -> Bool

    Representation

    pub(all) enum Representation {
    Text
    Decimal
    Integer
    Period
    Coded(CodeList)
    } derive(
    Debug
    )

    Role

    pub(all) enum Role {
    Dimension
    TimeDimension
    Measure
    Attribute(Array[String])
    } derive(
    Debug
    )

    Role::to_repr

    Selection

    pub struct Selection {
    // private fields
    }

    Selection::new

    fn Selection::new(structure : Structure, terms : Array[(String, Array[String])]) -> Selection raise SdmxError

    Structure

    pub struct Structure {
    // private fields
    } derive(
    Debug
    )

    Structure::attributes

    fn Structure::attributes(self : Structure) -> Array[Component]

    Structure::component

    fn Structure::component(self : Structure, id : String) -> Component?

    Structure::components

    fn Structure::components(self : Structure) -> Array[Component]

    Structure::dimension_index

    fn Structure::dimension_index(self : Structure, id : String) -> Int?

    Structure::dimensions

    fn Structure::dimensions(self : Structure) -> Array[Component]

    Structure::fingerprint

    fn Structure::fingerprint(self : Structure) -> String raise SdmxError

    Structure::from_profile_json

    fn Structure::from_profile_json(text : String, limits? : Limits) -> Structure raise SdmxError

    Structure::measures

    fn Structure::measures(self : Structure) -> Array[Component]

    Structure::new

    fn Structure::new(reference : StructureRef, components : Array[Component], limits? : Limits) -> Structure raise SdmxError

    Structure::reference

    fn Structure::reference(self : Structure) -> StructureRef

    Structure::time_index

    fn Structure::time_index(self : Structure) -> Int?

    Structure::to_profile_json

    fn Structure::to_profile_json(self : Structure) -> String raise SdmxError

    StructureRef

    pub struct StructureRef {
    // private fields
    } derive(Eq,
    Debug
    )

    StructureRef::agency

    fn StructureRef::agency(self : StructureRef) -> String

    StructureRef::equal

    StructureRef::format

    fn StructureRef::format(self : StructureRef) -> String

    StructureRef::id

    fn StructureRef::id(self : StructureRef) -> String

    StructureRef::new

    fn StructureRef::new(agency : String, id : String, version : String) -> StructureRef raise SdmxError

    StructureRef::not_equal

    fn StructureRef::not_equal(x : StructureRef, y : StructureRef) -> Bool

    StructureRef::parse

    fn StructureRef::parse(text : String) -> StructureRef raise SdmxError

    StructureRef::version

    fn StructureRef::version(self : StructureRef) -> String

    ValueCoverage

    pub(all) struct ValueCoverage {
    id : String
    reported : Int
    omitted : Int
    distinct_values : Int
    } derive(
    Debug
    )

    decode_csv2

    fn decode_csv2(structure : Structure, text : String) -> DataMessage raise SdmxError

    decode_json2

    fn decode_json2(text : String, expected? : Structure?, limits? : Limits) -> DataMessage raise SdmxError

    Powered by MoonBit

    Site sourceReport issueModulesSkillsBuild queueStatistics

    © 2026 mooncakes.io