Coder Social home page Coder Social logo

Comments (7)

MarcusBarnes avatar MarcusBarnes commented on May 28, 2024

Updated CdmToMods metadata parser class to handle the simplified mappings file structure in commit feac7a3. Documentation and examples are still required.

from mik.

mjordan avatar mjordan commented on May 28, 2024

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?

from mik.

MarcusBarnes avatar MarcusBarnes commented on May 28, 2024

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.

from mik.

MarcusBarnes avatar MarcusBarnes commented on May 28, 2024

@mjordan I've opened a more general review issue related to your comment. Thank you again for your ongoing suggestions and comments.

from mik.

mjordan avatar mjordan commented on May 28, 2024

Just tested creating a mappings file in Excel 2013, LibreOffice Calc, and Google Sheets. Excel and Sheets export CSV like this:

title,,<titleInfo><title>%value%</title></titleInfo>,Testing titles
subject,en,"<subject authority=""foo"">%value%</subject>",Testing subjects….

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:

title,,<titleInfo><title>%value%</title></titleInfo>,,Just testing
subject,,<subject authority="lsch"><topic>%value%</topic></subject>,,Testing

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.

from mik.

MarcusBarnes avatar MarcusBarnes commented on May 28, 2024

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.

from mik.

MarcusBarnes avatar MarcusBarnes commented on May 28, 2024

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:

source field label target element note

The 'note' field is optional.

from mik.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.