diff --git a/lib/translation_maps/has_type_from_contributor.yaml b/lib/translation_maps/has_type_from_contributor.yaml index 9e29f89d..72ef3830 100644 --- a/lib/translation_maps/has_type_from_contributor.yaml +++ b/lib/translation_maps/has_type_from_contributor.yaml @@ -1,3 +1,4 @@ +# type values from contributor mapped to cho_has_type abbey churches: Structures adornment: Adornments adze: Tools & Equipment @@ -33,6 +34,7 @@ applique: Other Objects aquamaniles: Containers archaeological sites: Archaeological Sites archer's ring: Armaments +architectural: Structures architectural relief: Structures architecture: Structures archival file: Other Texts @@ -313,6 +315,7 @@ cosmetic spatula: Other Objects cosmetic spoon: Other Objects costume: Adornments costume ornaments: Adornments +costumes: Adornments cover: Other Objects coverlet: Other Objects covers: Other Objects @@ -419,12 +422,14 @@ egg shell: Other Objects elephant tusks: Other Objects embroidery: Other Objects envelope: Other Objects -equestrian figurine: Other Objects +equestrian: Other Objects +equestrian figurine: Sculptures 'equipment for personal use: smoking and tobacco use': Other Objects ewers: Other Objects ewers (vessels): Containers eye bead: Other Objects eye-idol: Other Objects +faience: Other Objects falcon: Other Objects fals: Coins false door: Other Objects @@ -531,6 +536,7 @@ gold, silver & jewelry: Other Objects gourd: Other Objects gown: Adornments grain: Other Objects +graphics: grave marker: Funerary Objects grinder: Tools & Equipment grinding stone: Tools & Equipment @@ -603,6 +609,7 @@ illustration: Drawings illustrations (layout features): Drawings implement: Tools & Equipment implement fragment: Tools & Equipment +implements: Tools & Equipment impression: incense: Other Objects incense burner: Other Objects @@ -614,6 +621,7 @@ inlay: Other Objects inlay (uncertain): Other Objects inlay fragment: Other Objects inlays: Other Objects +inscribed: Inscriptions inscription: Inscriptions intaglio: Other Objects intaglios: Other Objects @@ -624,6 +632,7 @@ ivories: Other Objects ivory: Other Objects ivory & bone: Other Objects ivory fragment: Other Objects +ivory/bone: Other Objects jambiya: Armaments jar: Containers jar (uncertain): Other Objects @@ -848,6 +857,7 @@ panels: Other Objects panels (surface components): Other Objects panpipes: Musical Instruments pantaloons: Adornments +paper: papyri: Other Texts parchisi: Recreational Artifacts patch box: Containers @@ -879,6 +889,7 @@ periodical: Serials periodicals: Serials pestle: Other Objects pestle (uncertain): Other Objects +pewter: Other Objects phalium shell: Other Objects phallus: Other Objects photo, print, drawing: Photographs @@ -922,6 +933,7 @@ plate: Other Objects plater: Other Objects plates: Other Objects plates (dishes): Other Objects +plaster: Other Objects platter: Other Objects platter (uncertain): Other Objects playing cards: Recreational Artifacts @@ -1058,12 +1070,16 @@ sculpture: Sculptures sculpture (visual works): Sculptures scupture: Sculptures seal: Seals +seal (cylinder): Seals seal (object): Seals +seal (stamp): Seals seal (uncertain): Other Objects seal cap: Seals seal impression: Seals +seal impressions: Seals seal ring: Seals sealing: Seals +sealings: Seals seals (artifacts): Seals seals (cylinder): Seals seals (stamp): Seals @@ -1212,6 +1228,7 @@ strap fragment: Other Objects string of beads: Other Objects strt-convex scraper: Tools & Equipment structures furnishings: Furniture +stucco: Other Objects stud: Other Objects stud (uncertain): Other Objects studs: Other Objects @@ -1377,6 +1394,7 @@ wood: Other Objects wood fragment: Other Objects woodwork: Other Objects wool comb: Other Objects +woven: Other Objects wrap: Other Objects wreath: Other Objects writing & printing: Writing Accessories diff --git a/lib/translation_maps/norm_has_type_to_ar.yaml b/lib/translation_maps/norm_has_type_to_ar.yaml deleted file mode 100644 index 2796524c..00000000 --- a/lib/translation_maps/norm_has_type_to_ar.yaml +++ /dev/null @@ -1,30 +0,0 @@ -Bibliography: فهرس -Book: كتاب -Calligraphy: فن الخط -Cultural Artifact: قطعة أثرية ثقافية -Dictionary: قاموس -Drawing: فن البصري -Geospatial: الجغرافية المكانية -Historical Video: فيديو تاريخي -Interview: مقابلة -Letter: رسالة -Manuscript: مخطوط -Manuscript Illumination: إضاءة المخطوطات -Map: خريطة -Metalwork: الأعمال المعدنية -Motion Picture: فيلم -Music: موسيقي -Newspaper: صحيفة -Oral Narrative: الرواية الشفوية -Other Document: وثيقة أخرى -Painting: فن البصري -Periodical: مجلة دورية -Photograph: صورة فوتوغرافية -Postcard: بطاقة بريدية -Poster: ملصق -Pottery: فخار -Radio Broadcast: تسجيل إذاعي -Reference Book: كتاب مرجعي -Sound Recording: تسجيل صوتي -Stonework: الأعمال الحجرية -Visual Art: فن البصري diff --git a/lib/translation_maps/norm_types_to_ar.yaml b/lib/translation_maps/norm_types_to_ar.yaml deleted file mode 100644 index cb281ac2..00000000 --- a/lib/translation_maps/norm_types_to_ar.yaml +++ /dev/null @@ -1,8 +0,0 @@ -3D: ثلاثي الأبعاد -Dataset: مجموعة بيانات -Image: صورة -Interactive Resource: مرجع تفاعلي -Object: كائن -Sound: صوت -Text: نص -Video: فيديو diff --git a/lib/translation_maps/types.yaml b/lib/translation_maps/types.yaml deleted file mode 100644 index b4141a4c..00000000 --- a/lib/translation_maps/types.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# Basic mapping from common regex patterns to MODS, MARC, EDM, DCMI type terms. -3d: 3d -arms & armor: Object -architectural drawings (visual works): Image -artifact: Image -audio: Sound -black-and-white photographs: Image -brochure: Image -books: Text -bowls (vessels): Object -cartographic: Image -ceramics: Object -collection: Collection -color photographs: Image -cylinder seals: Object -dataset: Dataset -digital data: Dataset -finger rings: Object -glasswares: Object -gold, silver & jewelry: Object -helmets: Object -illuminated manuscripts: Text -image: Image -inlays: Object -interactive resource: Interactive Resource -ivory & bone: Object -jars: Object -lacquer & inlay: Object -lamps: Object -leather: Object -manuscript: Text -manuscripts: Text -manuscripts & rare books: Text -map: Image -maps: Image -metal: Object -mirrors: Object -mixed material: Text -movingimage: Video -moving image: Video -moving images: Video -multimedia: [Sound, Video] -mummies & cartonnage: Object -notated music: Text -software: Interactive Resource -software, multimedia: Interactive Resource -painting & drawing: Image -photographs: Image -plaques: Object -poster: Image -precious stones & gems: Object -reliefs: Object -scarabs: Object -sculpture: Object -shoes (footwear): Object -sound: Sound -sound recording: Sound -sound recording-musical: Sound -sound recording-nonmusical: Sound -statues: Object -statuettes (statues): Object -still image: Image -stillimage: Image -stone: Object -tablet: Object -tablets: Object -tactile: Image -tapestries: Object -textiles: Object -text: Text -three dimensional object: Image -vases: Object -vector digital data: Dataset -video: Video -wood: Object diff --git a/traject_configs/met_config.rb b/traject_configs/met_config.rb index 38a20bc0..cc72cf3f 100644 --- a/traject_configs/met_config.rb +++ b/traject_configs/met_config.rb @@ -7,6 +7,7 @@ require 'macros/dlme' require 'macros/each_record' require 'macros/met' +require 'macros/normalize_type' require 'macros/path_to_file' require 'macros/string_helper' require 'macros/timestamp' @@ -19,6 +20,7 @@ extend Macros::DLME extend Macros::EachRecord extend Macros::Met +extend Macros::NormalizeType extend Macros::PathToFile extend Macros::StringHelper extend Macros::Timestamp @@ -58,11 +60,11 @@ to_field 'cho_date_range_norm', csv_or_json_date_range('objectBeginDate', 'objectEndDate') to_field 'cho_dc_rights', public_domain, lang('en') to_field 'cho_dc_rights', extract_json('.rightsAndReproduction'), transform(&:presence), lang('en') -to_field 'cho_edm_type', literal('Object'), lang('en') -to_field 'cho_edm_type', literal('Object'), translation_map('norm_types_to_ar'), lang('ar-Arab') +to_field 'cho_edm_type', extract_json('.classification'), split('-'), normalize_has_type, normalize_edm_type, lang('en') +to_field 'cho_edm_type', extract_json('.classification'), split('-'), normalize_has_type, normalize_edm_type, translation_map('edm_type_ar_from_en'), lang('ar-Arab') to_field 'cho_extent', extract_json('.dimensions'), lang('en') -to_field 'cho_has_type', literal('Other Objects'), lang('en') -to_field 'cho_has_type', literal('Other Objects'), translation_map('norm_has_type_to_ar'), lang('ar-Arab') +to_field 'cho_has_type', extract_json('.classification'), split('-'), normalize_has_type, lang('en') +to_field 'cho_has_type', extract_json('.classification'), split('-'), normalize_has_type, translation_map('has_type_ar_from_en'), lang('ar-Arab') to_field 'cho_identifier', extract_json('.accessionNumber') to_field 'cho_medium', extract_json('.medium'), lang('en') to_field 'cho_spatial', extract_json('.city'), transform(&:presence), lang('en') diff --git a/traject_configs/yale_babylonian_config.rb b/traject_configs/yale_babylonian_config.rb index a26f212c..3390ea10 100644 --- a/traject_configs/yale_babylonian_config.rb +++ b/traject_configs/yale_babylonian_config.rb @@ -46,11 +46,11 @@ to_field 'cho_aat_material', column('era'), split(':'), strip, transform(&:downcase), translation_map('getty_aat_materials'), translation_map('getty_aat_materials_to_ar'), lang('ar-Arab') to_field 'cho_dc_rights', literal('http://creativecommons.org/publicdomain/zero/1.0/'), lang('en') to_field 'cho_description', column('type'), lang('en') -to_field 'cho_edm_type', literal('Object'), lang('en') -to_field 'cho_edm_type', literal('Object'), lang('ar-Arab') +to_field 'cho_edm_type', column('format'), split(';'), normalize_has_type, normalize_edm_type, lang('en') +to_field 'cho_edm_type', column('format'), split(';'), normalize_has_type, normalize_edm_type, translation_map('edm_type_ar_from_en'), lang('ar-Arab') to_field 'cho_format', column('format'), lang('en') -to_field 'cho_has_type', column('format'), split(';'), strip, translation_map('object_has_types'), lang('en') -to_field 'cho_has_type', column('format'), split(';'), strip, translation_map('object_has_types'), translation_map('norm_types_to_ar'), lang('ar-Arab') +to_field 'cho_has_type', column('format'), split(';'), normalize_has_type, lang('en') +to_field 'cho_has_type', column('format'), split(';'), normalize_has_type, translation_map('has_type_ar_from_en'), lang('ar-Arab') to_field 'cho_identifier', column('callnumber'), prepend('Catalog Number: ') to_field 'cho_identifier', column('type'), split(';'), last, gsub(' original catalog number ', ''), prepend('Original Number: ') to_field 'cho_medium', column('era'), lang('en')