Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extensions in YAML #172

Closed
opoudjis opened this issue Oct 29, 2024 · 3 comments
Closed

Extensions in YAML #172

opoudjis opened this issue Oct 29, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@opoudjis
Copy link
Contributor

I need to specify

<bibdata>
...
  <ext>
    <ics><code> 25.040.40</code></ics>
    <price-code>XL</price-code>
  </ext>
</bibdata>

in Relaton YAML for metanorma/metanorma-iso#1217 . I've written:

title:
  - type: main
    content: STEP Module and Resource Library (SMRL)
type: standard
edition: "11"
docid:
  - type: SMRL
    id: 2024(E)
date:
  - type: published
    "on": 2024
ext:
  ics:
    code: 25.040.40
  price-code: XL
copyright:
   owner:
     name: International Organization for Standardization
     abbreviation: ISO
     url: www.iso.org
   from: '2024'
contributor:
  - organization:
      name: International Organization for Standardization
      url: www.iso.org
      abbreviation: ISO
    role:
      type: publisher


The Relaton YAML parser appears to be ignoring ext. Is that the case?

@opoudjis opoudjis added the bug Something isn't working label Oct 29, 2024
@andrew2net
Copy link
Contributor

andrew2net commented Oct 29, 2024

@opoudjis we didn't have ext in YAML at the beginning. I started adding new elements that belong to ext in XML into the ext YAML element. But most of elements under ext in XML are root in YAML. I planned to move all the elements to YAML ext with new Relaton powered with lutaml-model.

@opoudjis
Copy link
Contributor Author

opoudjis commented Oct 29, 2024

Right. This will indeed need to be fixed, because people need to be able to predict what the YAML looks like if they data enter it, and the XML grammar is the only way to until now. There is a need from this to document Relaton YAML, although I can make do with handcrafting Relaton XML and converting it back to YAML.

ext/price-code is defined for IEC, but I see it is being ignored still when converting Relaton XML back to YAML; I assume that's expected?

  <ext>
    <ics><code>1.2.3</code></ics>
    <price-code>XML</price-code>
  </ext>

converts to just

ics:
- code: 1.2.3

@andrew2net
Copy link
Contributor

In relaton v1.20.0 all flavor data moved under ext section in YAML

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants