Skip to content

Commit

Permalink
Warn about 'ingest.iiif.library.ucla.edu' URLs (#880)
Browse files Browse the repository at this point in the history
Co-authored-by: Parinita Mulak <[email protected]>
  • Loading branch information
sourcefilter and pghorpade authored Jun 1, 2021
1 parent b435e81 commit 582a3fb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/uploaders/csv_manifest_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ def validate_records
end
end

# Row has an incorrect IIIF url
[*CalifornicaMapper.californica_terms_map[:iiif_manifest_url], *CalifornicaMapper.californica_terms_map[:access_copy]].each do |header_term|
this_row_warnings << "'#{header_term}' points to ingest.iiif.library.ucla.edu." if row[header_term]&.match?('ingest.iiif.library.ucla.edu')
end

# Row has a File Name that doesn't exist
if @mapper.preservation_copy
if @mapper.preservation_copy.start_with?('masters.in.library.ucla.edu/')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Object Type,Project Name,Parent ARK,Item ARK,Subject,Type.typeOfResource,Rights.copyrightStatus,Type.genre,Name.subject,Coverage.geographic,Relation.isPartOf,Publisher.publisherName,Rights.countryCreation,Rights.rightsHolderContact,Name.architect,Name.photographer,Name.repository,Date.normalized,AltIdentifier.local,Title,Date.creation,Format.extent,Format.medium,Format.dimensions,Description.note,Description.fundingNote,Description.longitude,Description.latitude,Description.caption,File Name,AltTitle.other,AltTitle.translated,Place of origin,AltTitle.uniform,Support,Author,Summary,Page layout,Text direction,Binding note,viewingHint,IIIF Range,Illustrations note,Provenance,Table of Contents,Subject.conceptTopic,Subject.descriptiveTopic,Collation,Foliation note,Foliation,Illuminator,Name.illuminator,Name.lyricist,Name.composer,Scribe,Name.scribe,Condition note,Rights.statementLocal,Masthead,Representative image,Featured image,Tagline,Commentator,Name.commentator,Translator,Name.translator,Subject temporal,Opac url,Subject geographic,Colophon,Description.colophon,Finding Aid URL,Alt ID.url,Rubricator,Name.rubricator,Name.creator,Illustrator,Name.illustrator,Calligrapher,Name.calligrapher,Editor,Name.editor,Engraver,Name.engraver,Note,Printmaker,Name.printmaker,Contents note,Description.contents,Thumbnail,IIIF Manifest URL
Work,Los Angeles Daily News Negatives,21198/zz00294nz8,21198/zz0002nq4w,Eminent domain--California--Los Angeles|~|Demonstrations--California--Los Angeles County|~|Express highways--California--Los Angeles County--Design and construction|~|Government|~|Transportation|~|Activism|~|Interstate 10,still image,copyrighted,news photographs,Los Angeles County (Calif.). $b Board of Supervisors,Los Angeles (Calif.),"Los Angeles Daily News Negatives. Department of Special Collections, Charles E. Young Research Library, University of California at Los Angeles.",Los Angeles Daily News,US,"UCLA Charles E. Young Research Library Department of Special Collections, A1713 Young Research Library, Box 951575, Los Angeles, CA 90095-1575. E-mail: [email protected]. Phone: (310)825-4988",,,,1947-09-17,uclalat_1387_b107_40098,"Protesters with signs in gallery of Los Angeles County Supervisors hearing over eminent domain for construction of Harbor Freeway, Calif., 1947","September 17, 1947",1 photograph,b&w negative,10 x 12.5 cm.,"At the Hall of Records, 220 N. Broadway.|~|Description 2",Info about funding,-118.243865,34.054133,This example does not have a caption.,clusc_1_1_00010432a.tif,"Protesters with signs"," manifestante n común",Los Angeles,Los Angeles Daily News Negatives,UCLA,Famous Author,Protesters with signs,images,left-to-right,Green,paged,iiif-range,illustration-note,history-description,table of contents,concept-topic,descriptive-topic,collated,follated,also follated,illuminated,also illuminated,la la la,Schubert,Amat-Mamu,Sin-liqe-unninni,condition_note,local_statement,local_masthead,local_representative_image,local_featured_image,local_tagline,commentator_1,commentator_2,translator_1,translator_2,subject_temporal_1,example_opac_url,subject_geographic_1,colophon_text,colophon_text_2,finding_aid_url_1,finding_aid_url_2,rubricator_1,rubricator_2,name_creator,Illustrator-1,Illustrator-2,Calligrapher-1,Name-calligrapher,Editor-1,Name-editor,Engraver-1,Name-engraver,Note-1,Printmaker-1,Name-printmaker,contents_note-1,Description-contents,https://fake.url/iiif/ark%3A%2F21198%2Fzz0002nq4w,https://ingest.iiif.library.ucla.edu/id/manifest
9 changes: 9 additions & 0 deletions spec/uploaders/csv_manifest_validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,15 @@
end
end

context 'when the csv has an \'ingest.iiif\' URL' do
let(:csv_file) { File.join(fixture_path, 'csv_import', 'csv_files_with_problems', 'example-ingest_dot_iiif_url.csv') }

it 'gives a warning' do
validator.validate
expect(validator.warnings).to contain_exactly("Row 2: 'IIIF Manifest URL' points to ingest.iiif.library.ucla.edu.")
end
end

describe '#valid_headers' do
it 'Contains all the values from CalifornicaMapper.CALIFORNICA_TERMS_MAP' do
expect(validator.valid_headers).to contain_exactly(
Expand Down

0 comments on commit 582a3fb

Please sign in to comment.