-
Notifications
You must be signed in to change notification settings - Fork 11
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
Simplify mappings file and related code #7
Comments
Updated CdmToMods metadata parser class to handle the simplified mappings file structure in commit feac7a3. Documentation and examples are still required. |
The private function getCDMtoModsMappingArray in CdmToMods.php is duplicated in the (also private) parent Mods class. I would recommend removing it from the Modc class but the mapping doesn't need to be specific to CONTENTdm. Could we keep it in the Mods class and reference it from the CdmToMods class so we could reuse it in other child classes? |
Thank you @mjordan for the comment. I'll review the code in the classes more closely and make changes as appropriate. My first thought is that we will need to rename getCDMtoModsMappingArray to remove the short-hand reference to CONTENTdm in the method in the parent Mods class and use something more generic. |
Just tested creating a mappings file in Excel 2013, LibreOffice Calc, and Google Sheets. Excel and Sheets export CSV like this:
That is, with annoying escaped quotation marks around the attribute value, and no option that I could see to not do that. LibreOffice Calc did provide an option to define the text delimiter, which allows you to specify none, producing this ready-to-use mappings file:
I can't think of a case where a comma would appear in any of these fields other than the note field, or perhaps in the target element field if the target was a literal string containing a comma. |
After reflecting on the use of "language of field" in the mapping file, it was determined that it was best to handle this in the "target element", which is typically an XML snippet. In the case of MODS XML snippets, manually setting the lang attribute in a MODS element (or child element) provides greater control. TASK: Remove "language of field" from the mappings file and related code. |
The 'language of field' has been removed from the default mappings file structure. See commit 76118cd. The default mappings file now has the following structure:
The 'note' field is optional. |
A mapping file will also be necessary for non-CONTENTdm sources.
Task: Simplify the mapping structure. For example, using these columns:
The 'Language of field' and 'note' columns would be optional.
Thank you to @mjordan for the suggestions.
The text was updated successfully, but these errors were encountered: