Closed arcadiafalcone closed 1 year ago
@arcadiafalcone I understand that in this batch of records, the identifier.uri
should be used for the nameIdentifier value and identifier.source.code
becomes the type attribute. Is it required to have a identifier.source.code
when a identifier.uri
is used or is the type attribute optional? I'm looking back at #538 where it says "One of source.code, source.value, or source.uri should be required if there is identifier.value or identifier.code, but not required for identifier.uri."?
Are there other scenarios that we should transform here? I don't think we're expecting to see identifier.code
for example; we're looking for identifier.value
only at the moment.
It might be good to do a comparison between the current name-identifier mapping code and the subject-name-identifier mapping code and see how they are the same and how they are different ... and decide what is desired.
For developers, the best way to express what is desired is in specs. Let us know how we can help.
Given that so far this has only happened in one collection, and that collection has been addressed, I would say this is
whew!
This project, and specifically the use of Wikidata URIs in this project, is the subject of a paper two SUL staff are writing. The paper doesn't have a hard deadline, but it would be good to get this done (at least to the point of the URI appearing in the MODS) sooner rather than later. I think the minimum logic to handle this use case is "if no identifier.value, use identifier.uri instead."
@arcadiafalcone what we need to proceed here is some specs from you ... because the subject-name-identifier code is not the same as the contributor-name-identifier code, and it's unclear to us what exactly we need to change.
There's an existing spec for it at https://github.com/sul-dlss/cocina-models/blob/06c90b69dc3183b643b236f948d658cb0966167e/spec/cocina/models/mapping/descriptive/mods/subject_name_spec.rb#L1370 which is not working in the Cocina>MODS direction. If there's another spec you need, let me know.
@arcadiafalcone @ndushay Hmmm, I may be misunderstanding. That spec looks like it's set up and not skipped, and when I run it, I see:
$ rspec spec/cocina/models/mapping/descriptive/mods/subject_name_spec.rb:1370
MODS subject name <--> cocina mappings
Name subject with RWO identifier
behaves like MODS cocina mapping
when mapping from MODS (to cocina)
mods snippet(s) produce valid MODS
cocina hash produces valid cocina Description
MODS maps to expected cocina
notifier receives warning and/or error messages as specified
when mapping to MODS (from cocina)
cocina Description maps to expected MODS
cocina Description maps to normalized MODS
when mapping from roundtrip MODS (to cocina)
roundtrip MODS maps to expected cocina
roundtrip cocina maps to roundtrip MODS
roundtrip cocina maps to normalized roundtrip MODS
Finished in 0.07003 seconds (files took 1.82 seconds to load)
9 examples, 0 failures
Is the data in the spec wrong or not rigged up correctly?
@arcadiafalcone I looked at this last month and had a question ☝🏻
I think we should close this until it's clear what needs fixing. Feel free to re-open then!
See https://purl.stanford.edu/bh354nc2071.mods
Desired output for MODS: