relaton / relaton-bipm

MIT License
2 stars 0 forks source link

`language` attribute is not in an array #49

Open ronaldtse opened 1 year ago

ronaldtse commented 1 year ago

Right now, Relaton returns the same item regardless of the input syntax, and already provides the French content:

$ bundle exec relaton fetch "CIPM Recommandation 5 (1989)"
<bibdata type="proceedings" schema-version="v1.2.3">
  <fetched>2023-04-19</fetched>
  <title format="text/plain" language="en" script="Latn">The International Temperature Scale of 1990</title>
  <title format="text/plain" language="fr" script="Latn">L’Échelle internationale de température de 1990</title>
  <uri type="citation" language="en" script="Latn">https://www.bipm.org/en/committees/ci/cipm/78-1989/resolution-5</uri>
  <uri type="citation" language="fr" script="Latn">https://www.bipm.org/fr/committees/ci/cipm/78-1989/resolution-5</uri>
  <uri type="src" language="en" script="Latn">https://raw.githubusercontent.com/metanorma/bipm-data-outcomes/main/cipm/meetings-en/meeting-78.yml</uri>
  <uri type="src" language="fr" script="Latn">https://raw.githubusercontent.com/metanorma/bipm-data-outcomes/main/cipm/meetings-fr/meeting-78.yml</uri>
  <uri type="pdf">https://www.bipm.org/documents/20126/17315032/CIPM78.pdf/078200cd-d8b2-f33b-da22-a2a3badeee10</uri>
  <docidentifier type="BIPM" primary="true">CIPM -- Recommendation 5 (1989)</docidentifier>
  <docidentifier type="BIPM" primary="true" language="en" script="Latn">CIPM -- Recommendation 5 (1989)</docidentifier>
  <docidentifier type="BIPM" primary="true" language="fr" script="Latn">CIPM -- Recommandation 5 (1989)</docidentifier>
  <docnumber>CIPM -- Recommendation 5 (1989)</docnumber>
  <date type="published">
    <on>1989-09-28</on>
  </date>
  <contributor>
    <role type="publisher"/>
    <organization>
      <name>Bureau International des Poids et Mesures</name>
      <abbreviation>BIPM</abbreviation>
      <uri>www.bipm.org</uri>
    </organization>
  </contributor>
  <contributor>
    <role type="author"/>
    <organization>
      <name language="en" script="Latn">International Committee for Weights and Measures</name>
      <name language="fr" script="Latn">Comité International des Poids et Mesures</name>
      <abbreviation>CIPM</abbreviation>
    </organization>
  </contributor>
  <language>en</language>
  <language>fr</language>
  <script>Latn</script>
  <place>
    <city>Paris</city>
  </place>
  <ext schema-version="v1.0.0">
    <doctype>recommendation</doctype>
    <structuredidentifier>
      <docnumber>5</docnumber>
    </structuredidentifier>
  </ext>
</bibdata>

In this output, language is not in an array. Since there are multiple languages, it probably should be an array or contains an array of codes.

  <language>en</language>
  <language>fr</language>

Originally from: https://github.com/metanorma/metanorma-bipm/issues/288

ronaldtse commented 1 year ago

I'm seeing that contributor is also not in an array, which is also strange...

andrew2net commented 1 year ago

@ronaldtse what does "not in array" mean? RelatonXML grammar defines the language element as zero or more elements

  <define name="BibliographicItem">
    ...
    <zeroOrMore>
      <ref name="language"/>
    </zeroOrMore>
    ...
  </define>
  ...
  <define name="language">
    <element name="language">
      <text/>
    </element>
  </define>
  ...

Elements like title and organization/name have a language attribute. In case we have content in many languages, we use multiple elements with language attributes. The language attribute denotes the content translation. I don't understand how the language attribute could be an array.