qurator-spk / mods4pandas

Extract the MODS/ALTO metadata of a bunch of METS/ALTO files into pandas DataFrames for data analysis
Apache License 2.0
11 stars 0 forks source link

Handle multiple mods:role/mods:roleTerm #4

Closed mikegerber closed 2 years ago

mikegerber commented 2 years ago

mods:names now may have more than one role:

    <mods:mods xmlns:mods="http://www.loc.gov/mods/v3">                                                                  
    <mods:name type="personal" valueURI="http://d-nb.info/gnd/117357669">                                                
      <mods:displayForm>Wurm, Mary</mods:displayForm>                                                                    
      <mods:namePart type="given">Mary</mods:namePart>                                                                   
      <mods:nameIdentifier type="gbv-ppn">078789583</mods:nameIdentifier>                                                
      <mods:namePart type="family">Wurm</mods:namePart>                                                                  
      <mods:role>                                                                                                        
        <mods:roleTerm authority="marcrelator" type="code">cmp</mods:roleTerm>                                           
      </mods:role>                                                                                                       
      <mods:role>                                                                                                        
        <mods:roleTerm authority="marcrelator" type="code">aut</mods:roleTerm>                                           
      </mods:role>                                                                                                       
    </mods:name>                                                                                                                                             
    </mods:mods>           

This should be merged into one column, e.g. d['name0_role_roleTerm'] == {'cmp', 'aut'}

mikegerber commented 2 years ago

Fixed in 9a8f7f6