relaton / relaton-py

Python library for Relaton
MIT License
1 stars 1 forks source link

Support new Relaton name model for formatted initials #39

Closed ronaldtse closed 2 years ago

ronaldtse commented 2 years ago

As described in https://github.com/relaton/relaton-ietf/issues/99, which is required by the following tasks:

We need to update the Relaton name model to support the preservation of formatted initials of names issued by the RFC Production Center (RPC).

At the model level it has been updated in:

This task is to update relaton-py to support:

  1. The new formatted-initials element
  2. The updated forename element which contains the initialattribute
ronaldtse commented 2 years ago

@stefanomunarini the data has been updated. Can you verify that the changes to relaton-py work with the new data files? Thanks.

stefanomunarini commented 2 years ago

@ronaldtse Can you please confirm the final agreed format? Is it this?

- person:
  name:
    formatted-initials:
      content: J.P.
    forename:
    - initial: J
      content: Jhon
    - initial: P
    - content: Jhonny
    surname: Lang
    completename: J.P. Lang

Thanks

ronaldtse commented 2 years ago

@opoudjis and @andrew2net can you confirm that the above structure is the one that will happen? We MUST finish implementing support in relaton-py BEFORE deploying the Relaton data structure change.

@stefanomunarini the particular document to monitor is this one:

https://github.com/ietf-tools/relaton-data-rfcs/blob/e6b1d288d5416497fd268039e28b547dbca0d8f2/data/RFC4872.yaml#L22-L38

contributor:
- person:
    name:
      surname:
        content: Lang
        language:
        - en
        script:
        - Latn
      completename:
        content: J.P. Lang
        language:
        - en
        script:
        - Latn
  role:
  - editor
stefanomunarini commented 2 years ago

@opoudjis and @andrew2net can you confirm that the above structure is the one that will happen? We MUST finish implementing support in relaton-py BEFORE deploying the Relaton data structure change.

@stefanomunarini the particular document to monitor is this one:

https://github.com/ietf-tools/relaton-data-rfcs/blob/e6b1d288d5416497fd268039e28b547dbca0d8f2/data/RFC4872.yaml#L22-L38

contributor:
- person:
    name:
      surname:
        content: Lang
        language:
        - en
        script:
        - Latn
      completename:
        content: J.P. Lang
        language:
        - en
        script:
        - Latn
  role:
  - editor

@ronaldtse I am very confused as I do not see any change compared to the currently implemented format?

andrew2net commented 2 years ago

@ronaldtse I confirm we use following structure:

- person:
  name:
    given:
      formatted_initials:
        content: J.P.
        language:
        - en
        script:
        - Latn
      forename:
      - initial: J
        content: Jhon
      - initial: P
    surname: Lang
    completename: J.P. Lang
andrew2net commented 2 years ago

@ronaldtse I am very confused as I do not see any change compared to the currently implemented format?

@stefanomunarini sorry, the repository is updated daily. It remains 3 hours until the next update. I'm unable to force the update, I don't have permission for the ietf-tools/relaton-data-rfcs repository.

stefanomunarini commented 2 years ago

Thanks @andrew2net .

Can you please point at the updated grammar file? The relaton-models grammar does not match the format above.

stefanomunarini commented 2 years ago

@ronaldtse is this new data format for RFC entries only?

andrew2net commented 2 years ago

@stefanomunarini it's not only for RFC, but it's also for all Relaton documents.

Can you please point at the updated grammar file? The relaton-models grammar does not match the format above.

The person element contains fullname, that contains forename and formatted-initials https://github.com/relaton/relaton-models/blob/ee413e3fb6e8f098972a0a0f528141e1db730633/grammars/biblio.rnc#L112-L114

The forename element has an initial attribute now https://github.com/relaton/relaton-models/blob/ee413e3fb6e8f098972a0a0f528141e1db730633/grammars/biblio.rnc#L120-L123

The formatted_initials name is used for the formatted-initials in the YAML output because we handle it as Symbol in Relaton's Ruby script

stefanomunarini commented 2 years ago

I can't find any reference to given in this grammar @andrew2net . Shouldn't it be included too?

andrew2net commented 2 years ago

@stefanomunarini the gramma describes Relaton XML format. We discussed the YAML format update in the issue. We don't have updated documentation for YAML yet.

stefanomunarini commented 2 years ago

Thanks @andrew2net .

formatted-initials is a LocalizedString, which requires the attribute content to be filled in. I've found one (but there might be more) case where this attribute is not filled in (see https://github.com/ietf-tools/relaton-data-nist/blob/ba303335424fd2df413114b5a142856df1a57184/data/NBS_BH_1.yaml#L36).

Did you forget to provide a value for content here?

ronaldtse commented 2 years ago

Thanks @stefanomunarini for noticing this case. @andrew2net seems like a bug to fix? Thanks.

andrew2net commented 2 years ago

Thanks @stefanomunarini for noticing this case. @andrew2net seems like a bug to fix? Thanks.

@stefanomunarini @ronaldtse fixed and will be updated on the GHA schedule.

stefanomunarini commented 2 years ago

I think there is another problem with data formatting here

- person:
  name:
    given:
      formatted_initials:
        content: J.P.
        language:
        - en
        script:
        - Latn
      forename:
      - initial: J
        content: Jhon
      - initial: P
    surname: Lang
    completename: J.P. Lang

As for the grammar

FullNameType = 
    (( prefix*, forename*, formatted-initials?, surname, addition* ) | completeName ),
    biblionote*, variantname*

surname and completename should be attributes of given and not of name.

Can you please confirm this issue @andrew2net @ronaldtse ?

andrew2net commented 2 years ago

@stefanomunarini surname in not a given name, completename contains surname and technically in't a given name also.

stefanomunarini commented 2 years ago

I will wait for YAML documentation to be updated.

ronaldtse commented 2 years ago

Sorry @stefanomunarini @andrew2net can you arrange a call to get this resolved? I don’t see why it’s not yet being updated. Thanks.

stefanomunarini commented 2 years ago

@ronaldtse this is actually done here.

There is a PR in BibXML-service (https://github.com/ietf-tools/bibxml-service/pull/287) but it's not being merged as it requires implementation of integration tests against data source.

ronaldtse commented 2 years ago

Update: I just discovered that the work is continued here: https://github.com/ietf-ribose/bibxml-service/pull/2

ronaldtse commented 2 years ago

@stefanomunarini should we close this ticket now? Thanks.