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

Emend relaton records with bibliographic spans #726

Closed
opoudjis opened this issue Dec 28, 2022 · 4 comments
Closed

Emend relaton records with bibliographic spans #726

opoudjis opened this issue Dec 28, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@opoudjis
Copy link
Contributor

The records being fetched from Crossref by relaton-doi are pretty patchy, and are often missing critical information. To deal with this, we will permit bibliographic spans to overwrite information in the fetched record.

  • If the span presents information absent in the fetched record, it is added to it
  • If the span presents information corresponding in the fetched record, it overwrites it
  • Information is broken down by type: if an identifier, or URI, or date is of a given type, it overwrites only identifiers of the same type in the fetched record
    • Contributor role type is counted as a type
  • Information is replaced, not additive: if there are multiple authors in the fetched record, they are replaced by the listing of multiple authors in the bibliographic spans.
@opoudjis opoudjis added the enhancement New feature or request label Dec 28, 2022
@opoudjis opoudjis self-assigned this Dec 28, 2022
@opoudjis
Copy link
Contributor Author

opoudjis commented Dec 28, 2022

@andrew2net I have a problem

I want to be able to change a relaton record, by merging it with a new record:

  • I have a RelatonBib record
  • I have a partial new RelatonBib record
  • I want to selectively overwrite fields in the old record with fields in the new record

Almost all the fields I want to overwrite are attr_reader.

How can I change them? Can I do RelatonBib::BibliographicItem.new(item.to_hash), for example? If so, I can just change the fields in item.to_hash before passing it to the initialiser.

Trying with changing all the keys of item.to_hash from strings to symbols...

@opoudjis
Copy link
Contributor Author

opoudjis commented Dec 28, 2022

I've got it working, @andrew2net :

old = RelatonBib::XMLParser.from_xml bibitem.to_xml
hash = old.to_hash.symbolize_all_keys
out = RelatonBib::HashConverter.hash_to_bib(hash)
RelatonBib::BibliographicItem.new(**out).to_xml

But why has the docidentifier disappeared? I'm stripping it somewhere, and not putting it back in time...

@opoudjis
Copy link
Contributor Author

OK, fixed. I can do this, I just won't do this before release.

@opoudjis
Copy link
Contributor Author

I did do it before release.

ronaldtse pushed a commit to metanorma/metanorma.org that referenced this issue Mar 2, 2024
ronaldtse pushed a commit to metanorma/metanorma.org that referenced this issue Mar 3, 2024
kwkwan pushed a commit to metanorma/metanorma.org that referenced this issue Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

1 participant