Skip to content

Create/use lutaml-path (something like object path, VPath, XPath but for lutaml-model) #173

Closed

Description

@HassanAkbar
No description provided.

Activity

  1. self-assigned this
    on Nov 19, 2024
  2. HassanAkbar commented on Jan 3, 2025

    @HassanAkbar
    MemberAuthor

    @ronaldtse From what I understand we need to support something like what xpath does i.e lutaml_model_instance.model_path(<expression>).

    Is this correct?

  3. ronaldtse commented on Jan 3, 2025

    @ronaldtse
    Contributor

    Yes, that's correct. What we are doing in root_mappings / child_mappings is like that:

        map_root to: :units, root_mappings: { id: :key, name: %w[root_units enumerated_root_units] }
    

    i.e. root_units enumerated_root_units => in YAML input.root_units.enumerated_root_units.

    We need to think about it.

  4. ronaldtse commented on Jan 8, 2025

    @ronaldtse
    Contributor

    We have a gem for lutaml-path.

    We need a specification for lutaml-path and to extend it.

  5. ronaldtse commented on Oct 14, 2026

    @ronaldtse
    Contributor

    Delivered end-to-end and now wired to lutaml-model.

    The gem already carried the parser for both RS 3002 syntaxes (87 green
    examples covering model-definition paths and instance paths with the
    full filter grammar). What #173 asked for beyond parsing — using paths
    against lutaml-model — is now in PR lutaml/lutaml-path#10:

    • Lutaml::Path.resolve(root, "obj.contributor[role.type='publisher'].organization.name")
      walks real lutaml-model instances: Serializable attribute trees,
      hashes, and collections.
    • Filters evaluate the full condition grammar (comparisons with
      numeric coercion, list membership, existence, &&/||/!,
      wildcards) against each candidate node.
    • Plain chains return the single value; filters and wildcards return
      collections — the two return forms RS 3002 specifies.

    With this, the three pieces line up: RS 3002's grammar (already
    parsed here), lutaml-model's instance objects (0.8.x), and the
    resolution bridge between them. Suggest closing #173 when the PR
    merges, with #172 (vCard on VFORMAT) as the natural first consumer.

  6. ronaldtse commented on Oct 14, 2026

    @ronaldtse
    Contributor

    Delivered: lutaml/lutaml-path#10 (merged) adds the resolution half — Lutaml::Path.resolve(root, path) walks real lutaml-model instances (Serializable trees, hashes, collections) with the full RS 3002 filter grammar, and InstancePath#resolve carries it on the path object itself. The parser half was already in the gem. Closing; #172 (vCard on VFORMAT) is the natural first consumer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions