Ejemplo n.º 1
0
def reverse_dewey_decimal_classification_number(self, key, value):
    """Reverse - Dewey Decimal Classification Number."""
    field_map = {
        "classification_number_element_single_number_or_beginning_number_of_span": "a",
        "classification_number_element_ending_number_of_span": "b",
        "explanatory_term": "c",
        "table_sequence_number_for_internal_subarrangement_or_add_table": "y",
        "table_identification_table_number": "z",
        "edition_number": "2",
        "institution_to_which_field_applies": "5",
        "linkage": "6",
        "field_link_and_sequence_number": "8",
    }
    order = utils.map_order(field_map, value)

    indicator_map1 = {"Abridged": "1", "Full": "0", "Other edition specified in subfield $2": "7"}
    indicator_map2 = {"Assigned by LC": "0", "Assigned by agency other than LC": "4"}
    return {
        "__order__": tuple(order) if len(order) else None,
        "a": value.get("classification_number_element_single_number_or_beginning_number_of_span"),
        "c": value.get("explanatory_term"),
        "b": value.get("classification_number_element_ending_number_of_span"),
        "2": value.get("edition_number"),
        "5": utils.reverse_force_list(value.get("institution_to_which_field_applies")),
        "6": value.get("linkage"),
        "y": utils.reverse_force_list(value.get("table_sequence_number_for_internal_subarrangement_or_add_table")),
        "8": utils.reverse_force_list(value.get("field_link_and_sequence_number")),
        "z": value.get("table_identification_table_number"),
        "$ind1": "7"
        if value.get("type_of_edition") and value.get("type_of_edition") == value.get("edition_number")
        else indicator_map1.get(value.get("type_of_edition"), "_"),
        "$ind2": indicator_map2.get(value.get("source_of_classification_number"), "_"),
    }
Ejemplo n.º 2
0
def reverse_cartographic_mathematical_data(self, key, value):
    """Reverse - Cartographic Mathematical Data."""
    field_map = {
        'statement_of_scale': 'a',
        'statement_of_projection': 'b',
        'statement_of_coordinates': 'c',
        'statement_of_zone': 'd',
        'statement_of_equinox': 'e',
        'outer_g_ring_coordinate_pairs': 'f',
        'exclusion_g_ring_coordinate_pairs': 'g',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': value.get('statement_of_scale'),
        'c': value.get('statement_of_coordinates'),
        'b': value.get('statement_of_projection'),
        'e': value.get('statement_of_equinox'),
        'd': value.get('statement_of_zone'),
        'g': value.get('exclusion_g_ring_coordinate_pairs'),
        'f': value.get('outer_g_ring_coordinate_pairs'),
        '6': value.get('linkage'),
        '8': utils.reverse_force_list(
            value.get('field_link_and_sequence_number')
        ),
        '$ind1': '_',
        '$ind2': '_',
    }
Ejemplo n.º 3
0
def reverse_added_entry_geographic_name(self, key, value):
    """Reverse - Added Entry-Geographic Name."""
    field_map = {
        'geographic_name': 'a',
        'relator_term': 'e',
        'authority_record_control_number_or_standard_number': '0',
        'source_of_heading_or_term': '2',
        'materials_specified': '3',
        'relator_code': '4',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': value.get('geographic_name'),
        'e': utils.reverse_force_list(
            value.get('relator_term')),
        '0': utils.reverse_force_list(
            value.get('authority_record_control_number_or_standard_number')),
        '2': value.get('source_of_heading_or_term'),
        '3': value.get('materials_specified'),
        '4': utils.reverse_force_list(
            value.get('relator_code')),
        '6': value.get('linkage'),
        '8': utils.reverse_force_list(
            value.get('field_link_and_sequence_number')),
        '$ind1': '_',
        '$ind2': '_',
    }
Ejemplo n.º 4
0
def reverse_government_document_call_number(self, key, value):
    """Reverse - Government Document Call Number."""
    field_map = {
        "call_number": "a",
        "volumes_dates_to_which_call_number_applies": "d",
        "canceled_invalid_call_number": "z",
        "institution_to_which_field_applies": "5",
        "linkage": "6",
        "field_link_and_sequence_number": "8",
    }

    indicator_map1 = {
        "Superintendent of Documents Classification System": "0",
        "Government of Canada Publications: Outline of Classification": "1",
    }

    if value.get("number_source") not in indicator_map1:
        field_map["number_source"] = "2"

    order = utils.map_order(field_map, value)

    return {
        "__order__": tuple(order) if len(order) else None,
        "a": value.get("call_number"),
        "d": value.get("volumes_dates_to_which_call_number_applies"),
        "2": value.get("number_source") if value.get("number_source") not in indicator_map1 else None,
        "5": utils.reverse_force_list(value.get("institution_to_which_field_applies")),
        "6": value.get("linkage"),
        "8": utils.reverse_force_list(value.get("field_link_and_sequence_number")),
        "z": utils.reverse_force_list(value.get("canceled_invalid_call_number")),
        "$ind1": indicator_map1.get(value.get("number_source"), "_"),
        "$ind2": "_",
    }
Ejemplo n.º 5
0
def reverse_imprint_statement_for_sound_recordings_pre_aacr_1(
        self,
        key,
        value):
    """Reverse - Imprint Statement for Sound Recordings (Pre-AACR 1)."""
    field_map = {
        'place_of_production_release': 'a',
        'publisher_or_trade_name': 'b',
        'date_of_production_release': 'c',
        'serial_identification': 'k',
        'matrix_and_or_take_number': 'l',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': value.get('place_of_production_release'),
        'c': value.get('date_of_production_release'),
        'b': value.get('publisher_or_trade_name'),
        'k': value.get('serial_identification'),
        'l': value.get('matrix_and_or_take_number'),
        '6': value.get('linkage'),
        '8': utils.reverse_force_list(
            value.get('field_link_and_sequence_number')
        ),
        '$ind1': '_',
        '$ind2': '_',
    }
Ejemplo n.º 6
0
def see_also_from_tracing_medium_of_performance_term(self, key, value):
    """See Also From Tracing-Medium of Performance Term."""
    field_map = {
        'a': 'medium_of_performance_term',
        'i': 'relationship_information',
        'w': 'control_subfield',
        '0': 'authority_record_control_number_or_standard_number',
        '4': 'relationship_code',
        '5': 'institution_to_which_field_applies',
        '6': 'linkage',
        '8': 'field_link_and_sequence_number',
    }
    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'medium_of_performance_term': value.get('a'),
        'relationship_information': utils.force_list(
            value.get('i')
        ),
        'authority_record_control_number_or_standard_number': utils.force_list(
            value.get('0')
        ),
        'institution_to_which_field_applies': utils.force_list(
            value.get('5')
        ),
        'relationship_code': utils.force_list(
            value.get('4')
        ),
        'control_subfield': value.get('w'),
        'linkage': value.get('6'),
        'field_link_and_sequence_number': utils.force_list(
            value.get('8')
        ),
    }
Ejemplo n.º 7
0
def reverse_added_entry_uncontrolled_name(self, key, value):
    """Reverse - Added Entry-Uncontrolled Name."""
    indicator_map1 = {
        'Not specified': '_',
        'Other': '2',
        'Personal': '1',
    }

    field_map = {
        'name': 'a',
        'relator_term': 'e',
        'relator_code': '4',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': value.get('name'),
        'e': utils.reverse_force_list(
            value.get('relator_term')),
        '4': utils.reverse_force_list(
            value.get('relator_code')),
        '6': value.get('linkage'),
        '8': utils.reverse_force_list(
            value.get('field_link_and_sequence_number')),
        '$ind1': indicator_map1.get(
            value.get('type_of_name'),
            '_'),
        '$ind2': '_',
    }
Ejemplo n.º 8
0
def public_general_note(self, key, value):
    """Public General Note."""
    field_map = {
        'a': 'heading_or_subdivision_term',
        'i': 'explanatory_text',
        '5': 'institution_to_which_field_applies',
        '6': 'linkage',
        '8': 'field_link_and_sequence_number',
    }
    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'heading_or_subdivision_term': utils.force_list(
            value.get('a')
        ),
        'field_link_and_sequence_number': utils.force_list(
            value.get('8')
        ),
        'institution_to_which_field_applies': utils.force_list(
            value.get('5')
        ),
        'explanatory_text': utils.force_list(
            value.get('i')
        ),
        'linkage': value.get('6'),
    }
Ejemplo n.º 9
0
def deleted_heading_information(self, key, value):
    """Deleted Heading Information."""
    field_map = {
        'a': 'replacement_heading',
        'i': 'explanatory_text',
        '0': 'replacement_authority_record_control_number',
        '6': 'linkage',
        '8': 'field_link_and_sequence_number',
    }
    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'replacement_heading': utils.force_list(
            value.get('a')
        ),
        'replacement_authority_record_control_number': utils.force_list(
            value.get('0')
        ),
        'explanatory_text': utils.force_list(
            value.get('i')
        ),
        'field_link_and_sequence_number': utils.force_list(
            value.get('8')
        ),
        'linkage': value.get('6'),
    }
Ejemplo n.º 10
0
def reverse_key_title(self, key, value):
    """Reverse - Key Title."""
    indicator_map2 = {str(x): str(x) for x in range(10)}
    field_map = {
        'linkage': '6',
        'key_title': 'a',
        'qualifying_information': 'b',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    if indicator_map2.get(value.get('nonfiling_characters'), '7') != '7':
        try:
            order.remove(field_map.get('nonfiling_characters'))
        except ValueError:
            pass

    return {
        '__order__': tuple(order) if len(order) else None,
        '6': value.get('linkage'),
        'a': value.get('key_title'),
        'b': value.get('qualifying_information'),
        '8': utils.reverse_force_list(
            value.get('field_link_and_sequence_number')
        ),
        '$ind1': '_',
        '$ind2': indicator_map2.get(value.get('nonfiling_characters'), '_'),
    }
Ejemplo n.º 11
0
def bibliographical_or_historical_data(self, key, value):
    """Biographical or Historical Data."""
    field_map = {
        'a': 'biographical_or_historical_data',
        'b': 'expansion',
        'u': 'uniform_resource_identifier',
        '6': 'linkage',
        '8': 'field_link_and_sequence_number',
    }
    order = utils.map_order(field_map, value)

    indicator_map1 = {
        '_': 'No information provided',
        '1': 'Biographical sketch',
        '2': 'Administrative history',
    }

    if key[3] in indicator_map1:
        order.append('type_of_data')

    return {
        '__order__': tuple(order) if len(order) else None,
        'biographical_or_historical_data': value.get('a'),
        'expansion': value.get('b'),
        'uniform_resource_identifier': value.get('u'),
        'field_link_and_sequence_number': utils.force_list(
            value.get('8')
        ),
        'linkage': value.get('6'),
        'type_of_data': indicator_map1.get(key[3]),
    }
Ejemplo n.º 12
0
def key_title(self, key, value):
    """Key Title."""
    indicator_map2 = {str(x): str(x) for x in range(10)}
    field_map = {
        '6': 'linkage',
        'b': 'qualifying_information',
        '8': 'field_link_and_sequence_number',
        'a': 'key_title',
    }

    order = utils.map_order(field_map, value)

    if key[4] in indicator_map2:
        order.append('nonfiling_characters')

    return {
        '__order__': tuple(order) if len(order) else None,
        'linkage': value.get('6'),
        'qualifying_information': value.get('b'),
        'field_link_and_sequence_number': utils.force_list(
            value.get('8')
        ),
        'key_title': value.get('a'),
        'nonfiling_characters': indicator_map2.get(key[4]),
    }
Ejemplo n.º 13
0
def reverse_complex_see_reference_subject(self, key, value):
    """Reverse - Complex See Reference-Subject."""
    field_map = {
        'heading_referred_to': 'a',
        'explanatory_text': 'i',
        'authority_record_control_number': '0',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }
    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': utils.reverse_force_list(
            value.get('heading_referred_to')
        ),
        '0': utils.reverse_force_list(
            value.get('authority_record_control_number')
        ),
        'i': utils.reverse_force_list(
            value.get('explanatory_text')
        ),
        '8': utils.reverse_force_list(
            value.get('field_link_and_sequence_number')
        ),
        '6': value.get('linkage'),
        '$ind1': '_',
        '$ind2': '_',
    }
Ejemplo n.º 14
0
def reverse_hours(self, key, value):
    """Reverse - Hours, Etc.."""
    indicator_map1 = {
        'Hours': '_',
        'No display constant generated': '8',
    }

    field_map = {
        'hours': 'a',
        'additional_information': 'b',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': utils.reverse_force_list(value.get('hours')),
        '8': utils.reverse_force_list(value.get('field_link_and_sequence_number')),
        'b': utils.reverse_force_list(value.get('additional_information')),
        '6': utils.reverse_force_list(value.get('linkage')),
        '$ind1': indicator_map1.get(value.get('display_constant_controller'), '_'),
        '$ind2': '_',
    }
Ejemplo n.º 15
0
def reverse_associated_language(self, key, value):
    """Reverse - Associated Language."""
    indicator_map2 = {
        'MARC language code': '_',
        'Source specified in subfield $2': '7',
    }

    field_map = {
        'language_code': 'a',
        'language_term': 'l',
        'source': '2',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    if indicator_map2.get(value.get('source_of_code'), '7') != '7':
        try:
            order.remove('2')
        except ValueError:
            pass

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': utils.reverse_force_list(value.get('language_code')),
        '8': utils.reverse_force_list(value.get('field_link_and_sequence_number')),
        '2': utils.reverse_force_list(value.get('source')),
        'l': utils.reverse_force_list(value.get('language_term')),
        '6': utils.reverse_force_list(value.get('linkage')),
        '$ind1': '_',
        '$ind2': indicator_map2.get(value.get('source_of_code'), '_'),
    }
Ejemplo n.º 16
0
def reverse_digital_graphic_representation(self, key, value):
    """Reverse - Digital Graphic Representation."""
    field_map = {
        'direct_reference_method': 'a',
        'object_type': 'b',
        'object_count': 'c',
        'row_count': 'd',
        'column_count': 'e',
        'vertical_count': 'f',
        'vpf_topology_level': 'g',
        'indirect_reference_description': 'i',
        'format_of_the_digital_image': 'q',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': utils.reverse_force_list(value.get('direct_reference_method')),
        'c': utils.reverse_force_list(value.get('object_count')),
        'b': utils.reverse_force_list(value.get('object_type')),
        'e': utils.reverse_force_list(value.get('column_count')),
        'd': utils.reverse_force_list(value.get('row_count')),
        'g': utils.reverse_force_list(value.get('vpf_topology_level')),
        'f': utils.reverse_force_list(value.get('vertical_count')),
        'i': utils.reverse_force_list(value.get('indirect_reference_description')),
        'q': utils.reverse_force_list(value.get('format_of_the_digital_image')),
        '6': utils.reverse_force_list(value.get('linkage')),
        '8': utils.reverse_force_list(value.get('field_link_and_sequence_number')),
        '$ind1': '_',
        '$ind2': '_',
    }
Ejemplo n.º 17
0
def reverse_dates_of_publication_and_or_sequential_designation(
        self,
        key,
        value):
    """Reverse - Dates of Publication and/or Sequential Designation."""
    indicator_map1 = {
        'Formatted style': '0',
        'Unformatted note': '1',
    }

    field_map = {
        'dates_of_publication_and_or_sequential_designation': 'a',
        'source_of_information': 'z',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': utils.reverse_force_list(
            value.get('dates_of_publication_and_or_sequential_designation')),
        '8': utils.reverse_force_list(
            value.get('field_link_and_sequence_number')),
        'z': utils.reverse_force_list(
            value.get('source_of_information')),
        '6': utils.reverse_force_list(
            value.get('linkage')),
        '$ind1': indicator_map1.get(
            value.get('format_of_date'),
            '_'),
        '$ind2': '_',
    }
Ejemplo n.º 18
0
def reverse_digital_file_characteristics(self, key, value):
    """Reverse - Digital File Characteristics."""
    field_map = {
        'file_type': 'a',
        'encoding_format': 'b',
        'file_size': 'c',
        'resolution': 'd',
        'regional_encoding': 'e',
        'encoded_bitrate': 'f',
        'authority_record_control_number_or_standard_number': '0',
        'source': '2',
        'materials_specified': '3',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': utils.reverse_force_list(value.get('file_type')),
        'c': utils.reverse_force_list(value.get('file_size')),
        'b': utils.reverse_force_list(value.get('encoding_format')),
        'e': utils.reverse_force_list(value.get('regional_encoding')),
        'd': utils.reverse_force_list(value.get('resolution')),
        'f': utils.reverse_force_list(value.get('encoded_bitrate')),
        '0': utils.reverse_force_list(value.get('authority_record_control_number_or_standard_number')),
        '3': utils.reverse_force_list(value.get('materials_specified')),
        '2': utils.reverse_force_list(value.get('source')),
        '6': utils.reverse_force_list(value.get('linkage')),
        '8': utils.reverse_force_list(value.get('field_link_and_sequence_number')),
        '$ind1': '_',
        '$ind2': '_',
    }
Ejemplo n.º 19
0
def reverse_format_of_notated_music(self, key, value):
    """Reverse - Format of Notated Music."""
    field_map = {
        'format_of_notated_music_term': 'a',
        'format_of_notated_music_code': 'b',
        'authority_record_control_number_or_standard_number': '0',
        'source_of_term': '2',
        'materials_specified': '3',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': utils.reverse_force_list(
            value.get('format_of_notated_music_term')),
        'b': utils.reverse_force_list(
            value.get('format_of_notated_music_code')),
        '0': utils.reverse_force_list(
            value.get('authority_record_control_number_or_standard_number')),
        '2': value.get('source_of_term'),
        '3': value.get('materials_specified'),
        '6': value.get('linkage'),
        '8': utils.reverse_force_list(
            value.get('field_link_and_sequence_number')),
        '$ind1': '_',
        '$ind2': '_',
    }
Ejemplo n.º 20
0
def reverse_projection_characteristics_of_moving_image(self, key, value):
    """Reverse - Projection Characteristics of Moving Image."""
    field_map = {
        'presentation_format': 'a',
        'projection_speed': 'b',
        'authority_record_control_number_or_standard_number': '0',
        'source': '2',
        'materials_specified': '3',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': utils.reverse_force_list(value.get('presentation_format')),
        'b': utils.reverse_force_list(value.get('projection_speed')),
        '0': utils.reverse_force_list(value.get('authority_record_control_number_or_standard_number')),
        '3': utils.reverse_force_list(value.get('materials_specified')),
        '2': utils.reverse_force_list(value.get('source')),
        '6': utils.reverse_force_list(value.get('linkage')),
        '8': utils.reverse_force_list(value.get('field_link_and_sequence_number')),
        '$ind1': '_',
        '$ind2': '_',
    }
Ejemplo n.º 21
0
def reverse_video_characteristics(self, key, value):
    """Reverse - Video Characteristics."""
    field_map = {
        'video_format': 'a',
        'broadcast_standard': 'b',
        'authority_record_control_number_or_standard_number': '0',
        'source': '2',
        'materials_specified': '3',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': utils.reverse_force_list(value.get('video_format')),
        'b': utils.reverse_force_list(value.get('broadcast_standard')),
        '0': utils.reverse_force_list(value.get('authority_record_control_number_or_standard_number')),
        '3': utils.reverse_force_list(value.get('materials_specified')),
        '2': utils.reverse_force_list(value.get('source')),
        '6': utils.reverse_force_list(value.get('linkage')),
        '8': utils.reverse_force_list(value.get('field_link_and_sequence_number')),
        '$ind1': '_',
        '$ind2': '_',
    }
Ejemplo n.º 22
0
def reverse_physical_description(self, key, value):
    """Reverse - Physical Description."""
    field_map = {
        'extent': 'a',
        'other_physical_details': 'b',
        'dimensions': 'c',
        'accompanying_material': 'e',
        'type_of_unit': 'f',
        'size_of_unit': 'g',
        'materials_specified': '3',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': utils.reverse_force_list(value.get('extent')),
        'c': utils.reverse_force_list(value.get('dimensions')),
        'b': utils.reverse_force_list(value.get('other_physical_details')),
        'e': utils.reverse_force_list(value.get('accompanying_material')),
        'g': utils.reverse_force_list(value.get('size_of_unit')),
        'f': utils.reverse_force_list(value.get('type_of_unit')),
        '3': utils.reverse_force_list(value.get('materials_specified')),
        '6': utils.reverse_force_list(value.get('linkage')),
        '8': utils.reverse_force_list(value.get('field_link_and_sequence_number')),
        '$ind1': '_',
        '$ind2': '_',
    }
Ejemplo n.º 23
0
def reverse_audience_characteristics(self, key, value):
    """Reverse - Audience Characteristics."""
    field_map = {
        'audience_term': 'a',
        'audience_code': 'b',
        'demographic_group_term': 'm',
        'demographic_group_code': 'n',
        'authority_record_control_number_or_standard_number': '0',
        'source': '2',
        'materials_specified': '3',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': utils.reverse_force_list(value.get('audience_term')),
        'b': utils.reverse_force_list(value.get('audience_code')),
        'm': utils.reverse_force_list(value.get('demographic_group_term')),
        'n': utils.reverse_force_list(value.get('demographic_group_code')),
        '0': utils.reverse_force_list(value.get('authority_record_control_number_or_standard_number')),
        '3': utils.reverse_force_list(value.get('materials_specified')),
        '2': utils.reverse_force_list(value.get('source')),
        '6': utils.reverse_force_list(value.get('linkage')),
        '8': utils.reverse_force_list(value.get('field_link_and_sequence_number')),
        '$ind1': '_',
        '$ind2': '_',
    }
Ejemplo n.º 24
0
def reverse_other_distinguishing_characteristics_of_work_or_expression(
        self,
        key,
        value):
    """Reverse - Other Distinguishing Characteristics of Work or Expression."""
    field_map = {
        'other_distinguishing_characteristic': 'a',
        'uniform_resource_identifier': 'u',
        'source_of_information': 'v',
        'record_control_number': '0',
        'source_of_term': '2',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': utils.reverse_force_list(value.get('other_distinguishing_characteristic')),
        'v': utils.reverse_force_list(value.get('source_of_information')),
        '0': utils.reverse_force_list(value.get('record_control_number')),
        '2': utils.reverse_force_list(value.get('source_of_term')),
        'u': utils.reverse_force_list(value.get('uniform_resource_identifier')),
        '6': utils.reverse_force_list(value.get('linkage')),
        '8': utils.reverse_force_list(value.get('field_link_and_sequence_number')),
        '$ind1': '_',
        '$ind2': '_',
    }
Ejemplo n.º 25
0
def reverse_numeric_designation_of_musical_work(self, key, value):
    """Reverse - Numeric Designation of Musical Work."""
    field_map = {
        'serial_number': 'a',
        'opus_number': 'b',
        'thematic_index_number': 'c',
        'thematic_index_code': 'd',
        'publisher_associated_with_opus_number': 'e',
        'source': '2',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': utils.reverse_force_list(value.get('serial_number')),
        'c': utils.reverse_force_list(value.get('thematic_index_number')),
        'b': utils.reverse_force_list(value.get('opus_number')),
        'e': utils.reverse_force_list(value.get('publisher_associated_with_opus_number')),
        'd': utils.reverse_force_list(value.get('thematic_index_code')),
        '2': utils.reverse_force_list(value.get('source')),
        '6': utils.reverse_force_list(value.get('linkage')),
        '8': utils.reverse_force_list(value.get('field_link_and_sequence_number')),
        '$ind1': '_',
        '$ind2': '_',
    }
Ejemplo n.º 26
0
def replacement_record_information(self, key, value):
    """Replacement Record Information."""
    field_map = {
        'a': 'replacement_title',
        'i': 'explanatory_text',
        'w': 'replacement_bibliographic_record_control_number',
        '6': 'linkage',
        '8': 'field_link_and_sequence_number',
    }

    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'replacement_title': utils.force_list(
            value.get('a')
        ),
        'explanatory_text': utils.force_list(
            value.get('i')
        ),
        'replacement_bibliographic_record_control_number': utils.force_list(
            value.get('w')
        ),
        'linkage': value.get('6'),
        'field_link_and_sequence_number': utils.force_list(
            value.get('8')
        ),
    }
Ejemplo n.º 27
0
def reverse_index_term_curriculum_objective(self, key, value):
    """Reverse - Index Term-Curriculum Objective."""
    field_map = {
        'field_link_and_sequence_number': '8',
        'main_curriculum_objective': 'a',
        'curriculum_code': 'c',
        'source_of_term_or_code': '2',
        'linkage': '6',
        'subordinate_curriculum_objective': 'b',
        'correlation_factor': 'd',
    }

    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        '8': utils.reverse_force_list(
            value.get('field_link_and_sequence_number')
        ),
        'a': value.get('main_curriculum_objective'),
        'c': value.get('curriculum_code'),
        '2': value.get('source_of_term_or_code'),
        '6': value.get('linkage'),
        'b': utils.reverse_force_list(
            value.get('subordinate_curriculum_objective')
        ),
        'd': value.get('correlation_factor'),
        '$ind1': '_',
        '$ind2': '_',
    }
Ejemplo n.º 28
0
def reverse_time_period_of_creation(self, key, value):
    """Reverse - Time Period of Creation."""
    indicator_map1 = {
        'No information provided': '_',
        'Creation of work': '1',
        'Creation of aggregate work': '2',
    }

    field_map = {
        'time_period_of_creation_term': 'a',
        'authority_record_control_number_or_standard_number': '0',
        'source_of_term': '2',
        'materials_specified': '3',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': utils.reverse_force_list(
            value.get('time_period_of_creation_term')),
        '0': utils.reverse_force_list(
            value.get('authority_record_control_number_or_standard_number')),
        '2': value.get('source_of_term'),
        '3': value.get('materials_specified'),
        '6': value.get('linkage'),
        '8': utils.reverse_force_list(
            value.get('field_link_and_sequence_number')),
        '$ind1': indicator_map1.get(
            value.get('type_of_time_period'),
            '_'),
        '$ind2': '_',
    }
Ejemplo n.º 29
0
def reverse_government_document_classification_number(self, key, value):
    """Reverse - Government Document Classification Number."""
    field_map = {
        "classification_number_element_single_number_of_beginning_number_of_span": "a",
        "classification_number_element_ending_number_of_span": "b",
        "explanatory_information": "c",
        "linkage": "6",
        "field_link_and_sequence_number": "8",
    }

    indicator_map1 = {
        "Superintendent of Documents Classification System": "0",
        "Government of Canada Publications: Outline of Classification": "1",
    }

    if value.get("number_source") not in indicator_map1:
        field_map["number_source"] = "2"

    order = utils.map_order(field_map, value)

    return {
        "__order__": tuple(order) if len(order) else None,
        "a": value.get("classification_number_element_single_number_of_beginning_number_of_span"),
        "c": value.get("explanatory_information"),
        "b": value.get("classification_number_element_ending_number_of_span"),
        "2": value.get("number_source") if value.get("number_source") not in indicator_map1 else None,
        "6": value.get("linkage"),
        "8": utils.reverse_force_list(value.get("field_link_and_sequence_number")),
        "$ind1": indicator_map1.get(value.get("number_source"), "_"),
        "$ind2": "_",
    }
Ejemplo n.º 30
0
def reverse_planar_coordinate_data(self, key, value):
    """Reverse - Planar Coordinate Data."""
    field_map = {
        'planar_coordinate_encoding_method': 'a',
        'planar_distance_units': 'b',
        'abscissa_resolution': 'c',
        'ordinate_resolution': 'd',
        'distance_resolution': 'e',
        'bearing_resolution': 'f',
        'bearing_units': 'g',
        'bearing_reference_direction': 'h',
        'bearing_reference_meridian': 'i',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': utils.reverse_force_list(value.get('planar_coordinate_encoding_method')),
        'c': utils.reverse_force_list(value.get('abscissa_resolution')),
        'b': utils.reverse_force_list(value.get('planar_distance_units')),
        'e': utils.reverse_force_list(value.get('distance_resolution')),
        'd': utils.reverse_force_list(value.get('ordinate_resolution')),
        'g': utils.reverse_force_list(value.get('bearing_units')),
        'f': utils.reverse_force_list(value.get('bearing_resolution')),
        'i': utils.reverse_force_list(value.get('bearing_reference_meridian')),
        'h': utils.reverse_force_list(value.get('bearing_reference_direction')),
        '6': utils.reverse_force_list(value.get('linkage')),
        '8': utils.reverse_force_list(value.get('field_link_and_sequence_number')),
        '$ind1': '_',
        '$ind2': '_',
    }
Ejemplo n.º 31
0
Archivo: bd6xx.py Proyecto: tind/dojson
def reverse_subject_added_entry_faceted_topical_terms(self, key, value):
    """Reverse - Subject Added Entry-Faceted Topical Terms."""
    indicator_map1 = {
        'No information provided': '_',
        'No level specified': '0',
        'Primary': '1',
        'Secondary': '2',
    }

    field_map = {
        'focus_term': 'a',
        'non_focus_term': 'b',
        'facet_hierarchy_designation': 'c',
        'relator_term': 'e',
        'form_subdivision': 'v',
        'chronological_subdivision': 'y',
        'geographic_subdivision': 'z',
        'authority_record_control_number_or_standard_number': '0',
        'source_of_heading_or_term': '2',
        'materials_specified': '3',
        'relator_code': '4',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': utils.reverse_force_list(
            value.get('focus_term')
        ),
        'b': utils.reverse_force_list(
            value.get('non_focus_term')
        ),
        'c': utils.reverse_force_list(
            value.get('facet_hierarchy_designation')
        ),
        'e': utils.reverse_force_list(
            value.get('relator_term')
        ),
        'v': utils.reverse_force_list(
            value.get('form_subdivision')
        ),
        'y': utils.reverse_force_list(
            value.get('chronological_subdivision')
        ),
        'z': utils.reverse_force_list(
            value.get('geographic_subdivision')
        ),
        '0': utils.reverse_force_list(
            value.get('authority_record_control_number_or_standard_number')
        ),
        '2': value.get('source_of_heading_or_term'),
        '3': value.get('materials_specified'),
        '4': utils.reverse_force_list(
            value.get('relator_code')
        ),
        '6': value.get('linkage'),
        '8': utils.reverse_force_list(
            value.get('field_link_and_sequence_number')
        ),
        '$ind1': indicator_map1.get(value.get('level_of_subject'), '_'),
        '$ind2': '_',
    }
Ejemplo n.º 32
0
def added_entry_uniform_title(self, key, value):
    """Added Entry-Uniform Title."""
    indicator_map1 = {str(x): str(x) for x in range(10)}
    indicator_map2 = {"2": "Analytical entry", "_": "No information provided"}
    field_map = {
        "t": "title_of_a_work",
        "a": "uniform_title",
        "5": "institution_to_which_field_applies",
        "8": "field_link_and_sequence_number",
        "3": "materials_specified",
        "g": "miscellaneous_information",
        "x": "international_standard_serial_number",
        "s": "version",
        "p": "name_of_part_section_of_a_work",
        "0": "authority_record_control_number_or_standard_number",
        "m": "medium_of_performance_for_music",
        "r": "key_for_music",
        "f": "date_of_a_work",
        "h": "medium",
        "i": "relationship_information",
        "k": "form_subheading",
        "o": "arranged_statement_for_music",
        "l": "language_of_a_work",
        "6": "linkage",
        "d": "date_of_treaty_signing",
        "n": "number_of_part_section_of_a_work",
    }

    order = utils.map_order(field_map, value)

    if key[3] in indicator_map1:
        order.append("nonfiling_characters")

    if key[4] in indicator_map2:
        order.append("type_of_added_entry")

    return {
        "__order__": tuple(order) if len(order) else None,
        "title_of_a_work": value.get("t"),
        "uniform_title": value.get("a"),
        "institution_to_which_field_applies": value.get("5"),
        "field_link_and_sequence_number": utils.force_list(value.get("8")),
        "materials_specified": value.get("3"),
        "miscellaneous_information": utils.force_list(value.get("g")),
        "international_standard_serial_number": value.get("x"),
        "version": value.get("s"),
        "name_of_part_section_of_a_work": utils.force_list(value.get("p")),
        "authority_record_control_number_or_standard_number": utils.force_list(
            value.get("0")
        ),
        "medium_of_performance_for_music": utils.force_list(value.get("m")),
        "key_for_music": value.get("r"),
        "date_of_a_work": value.get("f"),
        "medium": value.get("h"),
        "relationship_information": utils.force_list(value.get("i")),
        "form_subheading": utils.force_list(value.get("k")),
        "arranged_statement_for_music": value.get("o"),
        "language_of_a_work": value.get("l"),
        "linkage": value.get("6"),
        "date_of_treaty_signing": utils.force_list(value.get("d")),
        "number_of_part_section_of_a_work": utils.force_list(value.get("n")),
        "nonfiling_characters": indicator_map1.get(key[3]),
        "type_of_added_entry": indicator_map2.get(key[4]),
    }
Ejemplo n.º 33
0
def added_entry_personal_name(self, key, value):
    """Added Entry-Personal Name."""
    indicator_map1 = {"0": "Forename", "1": "Surname", "3": "Family name"}
    indicator_map2 = {"2": "Analytical entry", "_": "No information provided"}
    field_map = {
        "t": "title_of_a_work",
        "g": "miscellaneous_information",
        "i": "relationship_information",
        "3": "materials_specified",
        "x": "international_standard_serial_number",
        "4": "relator_code",
        "e": "relator_term",
        "f": "date_of_a_work",
        "h": "medium",
        "k": "form_subheading",
        "b": "numeration",
        "6": "linkage",
        "d": "dates_associated_with_a_name",
        "a": "personal_name",
        "5": "institution_to_which_field_applies",
        "8": "field_link_and_sequence_number",
        "0": "authority_record_control_number_or_standard_number",
        "q": "fuller_form_of_name",
        "s": "version",
        "p": "name_of_part_section_of_a_work",
        "l": "language_of_a_work",
        "c": "titles_and_other_words_associated_with_a_name",
        "r": "key_for_music",
        "u": "affiliation",
        "o": "arranged_statement_for_music",
        "j": "attribution_qualifier",
        "m": "medium_of_performance_for_music",
        "n": "number_of_part_section_of_a_work",
    }

    order = utils.map_order(field_map, value)

    if key[3] in indicator_map1:
        order.append("type_of_personal_name_entry_element")

    if key[4] in indicator_map2:
        order.append("type_of_added_entry")

    return {
        "__order__": tuple(order) if len(order) else None,
        "title_of_a_work": value.get("t"),
        "miscellaneous_information": utils.force_list(value.get("g")),
        "relationship_information": utils.force_list(value.get("i")),
        "materials_specified": value.get("3"),
        "international_standard_serial_number": value.get("x"),
        "relator_code": utils.force_list(value.get("4")),
        "relator_term": utils.force_list(value.get("e")),
        "date_of_a_work": value.get("f"),
        "medium": value.get("h"),
        "form_subheading": utils.force_list(value.get("k")),
        "numeration": value.get("b"),
        "linkage": value.get("6"),
        "dates_associated_with_a_name": value.get("d"),
        "personal_name": value.get("a"),
        "institution_to_which_field_applies": value.get("5"),
        "field_link_and_sequence_number": utils.force_list(value.get("8")),
        "authority_record_control_number_or_standard_number": utils.force_list(
            value.get("0")
        ),
        "fuller_form_of_name": value.get("q"),
        "version": value.get("s"),
        "name_of_part_section_of_a_work": utils.force_list(value.get("p")),
        "language_of_a_work": value.get("l"),
        "titles_and_other_words_associated_with_a_name": utils.force_list(
            value.get("c")
        ),
        "key_for_music": value.get("r"),
        "affiliation": value.get("u"),
        "arranged_statement_for_music": value.get("o"),
        "attribution_qualifier": utils.force_list(value.get("j")),
        "medium_of_performance_for_music": utils.force_list(value.get("m")),
        "number_of_part_section_of_a_work": utils.force_list(value.get("n")),
        "type_of_personal_name_entry_element": indicator_map1.get(key[3]),
        "type_of_added_entry": indicator_map2.get(key[4]),
    }
Ejemplo n.º 34
0
def added_entry_meeting_name(self, key, value):
    """Added Entry-Meeting Name."""
    indicator_map1 = {
        "0": "Inverted name",
        "1": "Jurisdiction name",
        "2": "Name in direct order",
    }
    indicator_map2 = {"2": "Analytical entry", "_": "No information provided"}
    field_map = {
        "t": "title_of_a_work",
        "g": "miscellaneous_information",
        "i": "relationship_information",
        "3": "materials_specified",
        "x": "international_standard_serial_number",
        "4": "relator_code",
        "e": "subordinate_unit",
        "f": "date_of_a_work",
        "h": "medium",
        "k": "form_subheading",
        "6": "linkage",
        "d": "date_of_meeting",
        "a": "meeting_name_or_jurisdiction_name_as_entry_element",
        "5": "institution_to_which_field_applies",
        "8": "field_link_and_sequence_number",
        "0": "authority_record_control_number_or_standard_number",
        "q": "name_of_meeting_following_jurisdiction_name_entry_element",
        "s": "version",
        "p": "name_of_part_section_of_a_work",
        "l": "language_of_a_work",
        "c": "location_of_meeting",
        "u": "affiliation",
        "j": "relator_term",
        "n": "number_of_part_section_meeting",
    }

    order = utils.map_order(field_map, value)

    if key[3] in indicator_map1:
        order.append("type_of_meeting_name_entry_element")

    if key[4] in indicator_map2:
        order.append("type_of_added_entry")

    return {
        "__order__": tuple(order) if len(order) else None,
        "title_of_a_work": value.get("t"),
        "miscellaneous_information": utils.force_list(value.get("g")),
        "relationship_information": utils.force_list(value.get("i")),
        "materials_specified": value.get("3"),
        "international_standard_serial_number": value.get("x"),
        "relator_code": utils.force_list(value.get("4")),
        "subordinate_unit": utils.force_list(value.get("e")),
        "date_of_a_work": value.get("f"),
        "medium": value.get("h"),
        "form_subheading": utils.force_list(value.get("k")),
        "linkage": value.get("6"),
        "date_of_meeting": value.get("d"),
        "meeting_name_or_jurisdiction_name_as_entry_element": value.get("a"),
        "institution_to_which_field_applies": value.get("5"),
        "field_link_and_sequence_number": utils.force_list(value.get("8")),
        "authority_record_control_number_or_standard_number": utils.force_list(
            value.get("0")
        ),
        "name_of_meeting_following_jurisdiction_name_entry_element": value.get("q"),
        "version": value.get("s"),
        "name_of_part_section_of_a_work": utils.force_list(value.get("p")),
        "language_of_a_work": value.get("l"),
        "location_of_meeting": utils.force_list(value.get("c")),
        "affiliation": value.get("u"),
        "relator_term": utils.force_list(value.get("j")),
        "number_of_part_section_meeting": utils.force_list(value.get("n")),
        "type_of_meeting_name_entry_element": indicator_map1.get(key[3]),
        "type_of_added_entry": indicator_map2.get(key[4]),
    }
Ejemplo n.º 35
0
def reverse_coded_cartographic_mathematical_data(self, key, value):
    """Reverse - Coded Cartographic Mathematical Data."""
    field_map = {
        'coordinates_westernmost_longitude': 'd',
        'coordinates_easternmost_longitude': 'e',
        'coordinates_northernmost_latitude': 'f',
        'coordinates_southernmost_latitude': 'g',
        'declination_northern_limit': 'j',
        'declination_southern_limit': 'k',
        'right_ascension_eastern_limit': 'm',
        'right_ascension_western_limit': 'n',
        'equinox': 'p',
        'distance_from_earth': 'r',
        'g_ring_latitude': 's',
        'g_ring_longitude': 't',
        'beginning_date': 'x',
        'ending_date': 'y',
        'name_of_extraterrestrial_body': 'z',
        'authority_record_control_number_or_standard_number': '0',
        'source': '2',
        'materials_specified': '3',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }
    order = utils.map_order(field_map, value)

    indicator_map2 = {
        'Exclusion ring': '1',
        'Not applicable': '_',
        'Outer ring': '0'
    }
    return {
        '__order__':
        tuple(order) if len(order) else None,
        'x':
        value.get('beginning_date'),
        'z':
        value.get('name_of_extraterrestrial_body'),
        'e':
        value.get('coordinates_easternmost_longitude'),
        'd':
        value.get('coordinates_westernmost_longitude'),
        'g':
        value.get('coordinates_southernmost_latitude'),
        'f':
        value.get('coordinates_northernmost_latitude'),
        'k':
        value.get('declination_southern_limit'),
        'j':
        value.get('declination_northern_limit'),
        'm':
        value.get('right_ascension_eastern_limit'),
        's':
        utils.reverse_force_list(value.get('g_ring_latitude')),
        'p':
        value.get('equinox'),
        'n':
        value.get('right_ascension_western_limit'),
        '0':
        utils.reverse_force_list(
            value.get('authority_record_control_number_or_standard_number')),
        '3':
        value.get('materials_specified'),
        '2':
        value.get('source'),
        't':
        utils.reverse_force_list(value.get('g_ring_longitude')),
        '6':
        value.get('linkage'),
        'y':
        value.get('ending_date'),
        '8':
        utils.reverse_force_list(value.get('field_link_and_sequence_number')),
        'r':
        value.get('distance_from_earth'),
        '$ind1':
        '_',
        '$ind2':
        indicator_map2.get(value.get('type_of_ring'), '_'),
    }
Ejemplo n.º 36
0
def reverse_medium_of_performance(self, key, value):
    """Reverse - Medium of Performance."""
    field_map = {
        "medium_of_performance": "a",
        "soloist": "b",
        "doubling_instrument": "d",
        "number_of_ensembles": "e",
        "number_of_performers_of_the_same_medium": "n",
        "alternative_medium_of_performance": "p",
        "total_number_of_individuals_performing_alongside_ensembles": "r",
        "total_number_of_performers": "s",
        "note": "v",
        "authority_record_control_number_or_standard_number": "0",
        "source_of_term": "2",
        "linkage": "6",
        "field_link_and_sequence_number": "8",
    }
    order = utils.map_order(field_map, value)

    indicator_map1 = {
        "Medium of performance": "0",
        "No information provided": "_",
        "Partial medium of performance": "1",
    }
    return {
        "__order__":
        tuple(order) if len(order) else None,
        "a":
        utils.reverse_force_list(value.get("medium_of_performance")),
        "b":
        utils.reverse_force_list(value.get("soloist")),
        "e":
        utils.reverse_force_list(value.get("number_of_ensembles")),
        "d":
        utils.reverse_force_list(value.get("doubling_instrument")),
        "p":
        utils.reverse_force_list(
            value.get("alternative_medium_of_performance")),
        "v":
        utils.reverse_force_list(value.get("note")),
        "n":
        utils.reverse_force_list(
            value.get("number_of_performers_of_the_same_medium")),
        "r":
        utils.reverse_force_list(
            value.get(
                "total_number_of_individuals_performing_alongside_ensembles")),
        "0":
        utils.reverse_force_list(
            value.get("authority_record_control_number_or_standard_number")),
        "s":
        value.get("total_number_of_performers"),
        "2":
        value.get("source_of_term"),
        "6":
        value.get("linkage"),
        "8":
        utils.reverse_force_list(value.get("field_link_and_sequence_number")),
        "$ind1":
        indicator_map1.get(value.get("display_constant_controller"), "_"),
        "$ind2":
        "_",
    }
Ejemplo n.º 37
0
Archivo: bd6xx.py Proyecto: tind/dojson
def reverse_index_term_genre_form(self, key, value):
    """Reverse - Index Term-Genre/Form."""
    indicator_map1 = {
        'Basic': '_',
        'Faceted': '0',
    }

    indicator_map2 = {
        'Library of Congress Subject Headings': '0',
        'LC subject headings for children\'s literature': '1',
        'Medical Subject Headings': '2',
        'National Agricultural Library subject authority file': '3',
        'Source not specified': '4',
        'Canadian Subject Headings': '5',
        'Répertoire de vedettes-matière': '6',
        'Source specified in subfield $2': '7'
    }

    field_map = {
        'genre_form_data_or_focus_term': 'a',
        'non_focus_term': 'b',
        'facet_hierarchy_designation': 'c',
        'form_subdivision': 'v',
        'general_subdivision': 'x',
        'chronological_subdivision': 'y',
        'geographic_subdivision': 'z',
        'authority_record_control_number_or_standard_number': '0',
        'source_of_term': '2',
        'materials_specified': '3',
        'institution_to_which_field_applies': '5',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    if indicator_map2.get(value.get('thesaurus'), '7') != '7':
        try:
            order.remove('2')
        except ValueError:
            pass

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': value.get('genre_form_data_or_focus_term'),
        'c': utils.reverse_force_list(
            value.get('facet_hierarchy_designation')
        ),
        'b': utils.reverse_force_list(
            value.get('non_focus_term')
        ),
        'v': utils.reverse_force_list(
            value.get('form_subdivision')
        ),
        'x': utils.reverse_force_list(
            value.get('general_subdivision')
        ),
        'y': utils.reverse_force_list(
            value.get('chronological_subdivision')
        ),
        'z': utils.reverse_force_list(
            value.get('geographic_subdivision')
        ),
        '0': utils.reverse_force_list(
            value.get('authority_record_control_number_or_standard_number')
        ),
        '2': value.get('source_of_term'),
        '3': value.get('materials_specified'),
        '5': value.get('institution_to_which_field_applies'),
        '6': value.get('linkage'),
        '8': utils.reverse_force_list(
            value.get('field_link_and_sequence_number')
        ),
        '$ind1': indicator_map1.get(value.get('type_of_heading'), '_'),
        '$ind2': indicator_map2.get(value.get('thesaurus'), '_'),
    }
Ejemplo n.º 38
0
Archivo: bd6xx.py Proyecto: tind/dojson
def reverse_subject_added_entry_uniform_title(self, key, value):
    """Reverse - Subject Added Entry-Uniform Title."""
    valid_nonfiling_characters = [x for x in range(10)]

    indicator_map2 = {
        'Library of Congress Subject Headings': '0',
        'LC subject headings for children\'s literature': '1',
        'Medical Subject Headings': '2',
        'National Agricultural Library subject authority file': '3',
        'Source not specified': '4',
        'Canadian Subject Headings': '5',
        'Répertoire de vedettes-matière': '6',
        'Source specified in subfield $2': '7'
    }

    field_map = {
        'uniform_title': 'a',
        'date_of_treaty_signing': 'd',
        'relator_term': 'e',
        'date_of_a_work': 'f',
        'miscellaneous_information': 'g',
        'medium': 'h',
        'form_subheading': 'k',
        'language_of_a_work': 'l',
        'medium_of_performance_for_music': 'm',
        'number_of_part_section_of_a_work': 'n',
        'arranged_statement_for_music': 'o',
        'name_of_part_section_of_a_work': 'p',
        'key_for_music': 'r',
        'version': 's',
        'title_of_a_work': 't',
        'form_subdivision': 'v',
        'general_subdivision': 'x',
        'chronological_subdivision': 'y',
        'geographic_subdivision': 'z',
        'authority_record_control_number_or_standard_number': '0',
        'source_of_heading_or_term': '2',
        'materials_specified': '3',
        'relator_code': '4',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    if indicator_map2.get(value.get('thesaurus'), '7') != '7':
        try:
            order.remove('2')
        except ValueError:
            pass

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': value.get('uniform_title'),
        'd': utils.reverse_force_list(
            value.get('date_of_treaty_signing')
        ),
        'e': utils.reverse_force_list(
            value.get('relator_term')
        ),
        'f': value.get('date_of_a_work'),
        'g': value.get('miscellaneous_information'),
        'h': value.get('medium'),
        'k': utils.reverse_force_list(
            value.get('form_subheading')
        ),
        'l': value.get('language_of_a_work'),
        'm': utils.reverse_force_list(
            value.get('medium_of_performance_for_music')
        ),
        'n': utils.reverse_force_list(
            value.get('number_of_part_section_of_a_work')
        ),
        'o': value.get('arranged_statement_for_music'),
        'p': utils.reverse_force_list(
            value.get('name_of_part_section_of_a_work')
        ),
        'r': value.get('key_for_music'),
        's': value.get('version'),
        't': value.get('title_of_a_work'),
        'v': utils.reverse_force_list(
            value.get('form_subdivision')
        ),
        'x': utils.reverse_force_list(
            value.get('general_subdivision')
        ),
        'y': utils.reverse_force_list(
            value.get('chronological_subdivision')
        ),
        'z': utils.reverse_force_list(
            value.get('geographic_subdivision')
        ),
        '0': utils.reverse_force_list(
            value.get('authority_record_control_number_or_standard_number')
        ),
        '2': value.get('source_of_heading_or_term'),
        '3': value.get('materials_specified'),
        '4': utils.reverse_force_list(
            value.get('relator_code')
        ),
        '6': value.get('linkage'),
        '8': utils.reverse_force_list(
            value.get('field_link_and_sequence_number')
        ),
        '$ind1': value.get('nonfiling_characters') if value.get('nonfiling_characters') in valid_nonfiling_characters else '_',
        '$ind2': indicator_map2.get(value.get('thesaurus'), '_'),
    }
Ejemplo n.º 39
0
def reverse_main_entry_uniform_title(self, key, value):
    """Reverse - Main Entry-Uniform Title."""
    indicator_map1 = {str(x): str(x) for x in range(10)}
    field_map = {
        'authority_record_control_number_or_standard_number': '0',
        'version': 's',
        'medium_of_performance_for_music': 'm',
        'form_subheading': 'k',
        'number_of_part_section_of_a_work': 'n',
        'language_of_a_work': 'l',
        'name_of_part_section_of_a_work': 'p',
        'medium': 'h',
        'title_of_a_work': 't',
        'key_for_music': 'r',
        'field_link_and_sequence_number': '8',
        'miscellaneous_information': 'g',
        'date_of_treaty_signing': 'd',
        'arranged_statement_for_music': 'o',
        'linkage': '6',
        'uniform_title': 'a',
        'date_of_a_work': 'f',
    }

    order = utils.map_order(field_map, value)

    if indicator_map1.get(value.get('nonfiling_characters'), '7') != '7':
        try:
            order.remove(field_map.get('nonfiling_characters'))
        except ValueError:
            pass

    return {
        '__order__': tuple(order) if len(order) else None,
        '0': utils.reverse_force_list(
            value.get('authority_record_control_number_or_standard_number')
        ),
        's': value.get('version'),
        'm': utils.reverse_force_list(
            value.get('medium_of_performance_for_music')
        ),
        'k': utils.reverse_force_list(
            value.get('form_subheading')
        ),
        'n': utils.reverse_force_list(
            value.get('number_of_part_section_of_a_work')
        ),
        'l': value.get('language_of_a_work'),
        'p': utils.reverse_force_list(
            value.get('name_of_part_section_of_a_work')
        ),
        'h': value.get('medium'),
        't': value.get('title_of_a_work'),
        'r': value.get('key_for_music'),
        '8': utils.reverse_force_list(
            value.get('field_link_and_sequence_number')
        ),
        'g': utils.reverse_force_list(
            value.get('miscellaneous_information')
        ),
        'd': utils.reverse_force_list(
            value.get('date_of_treaty_signing')
        ),
        'o': value.get('arranged_statement_for_music'),
        '6': value.get('linkage'),
        'a': value.get('uniform_title'),
        'f': value.get('date_of_a_work'),
        '$ind1': indicator_map1.get(value.get('nonfiling_characters'), '_'),
        '$ind2': '_',
    }
Ejemplo n.º 40
0
Archivo: bd6xx.py Proyecto: tind/dojson
def reverse_subject_added_entry_geographic_name(self, key, value):
    """Reverse - Subject Added Entry-Geographic Name."""
    indicator_map2 = {
        'Library of Congress Subject Headings': '0',
        'LC subject headings for children\'s literature': '1',
        'Medical Subject Headings': '2',
        'National Agricultural Library subject authority file': '3',
        'Source not specified': '4',
        'Canadian Subject Headings': '5',
        'Répertoire de vedettes-matière': '6',
        'Source specified in subfield $2': '7'
    }

    field_map = {
        'geographic_name': 'a',
        'relator_term': 'e',
        'miscellaneous_information': 'g',
        'relator_code': '4',
        'authority_record_control_number_or_standard_number': '0',
        'source_of_heading_or_term': '2',
        'materials_specified': '3',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
        'form_subdivision': 'v',
        'general_subdivision': 'x',
        'chronological_subdivision': 'y',
        'geographic_subdivision': 'z',
    }

    order = utils.map_order(field_map, value)

    if indicator_map2.get(value.get('thesaurus'), '7') != '7':
        try:
            order.remove('2')
        except ValueError:
            pass

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': value.get('geographic_name'),
        'e': utils.reverse_force_list(
            value.get('relator_term')
        ),
        'v': utils.reverse_force_list(
            value.get('form_subdivision')
        ),
        'x': utils.reverse_force_list(
            value.get('general_subdivision')
        ),
        'y': utils.reverse_force_list(
            value.get('chronological_subdivision')
        ),
        'z': utils.reverse_force_list(
            value.get('geographic_subdivision')
        ),
        '0': utils.reverse_force_list(
            value.get('authority_record_control_number_or_standard_number')
        ),
        '2': value.get('source_of_heading_or_term'),
        '3': value.get('materials_specified'),
        '4': utils.reverse_force_list(
            value.get('relator_code')
        ),
        '6': value.get('linkage'),
        '8': utils.reverse_force_list(
            value.get('field_link_and_sequence_number')
        ),
        '$ind1': '_',
        '$ind2': indicator_map2.get(value.get('thesaurus'), '_'),
    }
Ejemplo n.º 41
0
def reverse_main_entry_personal_name(self, key, value):
    """Reverse - Main Entry-Personal Name."""
    indicator_map1 = {"Family name": "3", "Forename": "0", "Surname": "1"}
    field_map = {
        'fuller_form_of_name': 'q',
        'affiliation': 'u',
        'authority_record_control_number_or_standard_number': '0',
        'dates_associated_with_a_name': 'd',
        'number_of_part_section_of_a_work': 'n',
        'language_of_a_work': 'l',
        'linkage': '6',
        'titles_and_words_associated_with_a_name': 'c',
        'relator_code': '4',
        'field_link_and_sequence_number': '8',
        'miscellaneous_information': 'g',
        'relator_term': 'e',
        'attribution_qualifier': 'j',
        'numeration': 'b',
        'name_of_part_section_of_a_work': 'p',
        'title_of_a_work': 't',
        'personal_name': 'a',
        'form_subheading': 'k',
        'date_of_a_work': 'f',
    }

    order = utils.map_order(field_map, value)

    if indicator_map1.get(
            value.get('type_of_personal_name_entry_element'), '7') != '7':
        try:
            order.remove(field_map.get('type_of_personal_name_entry_element'))
        except ValueError:
            pass

    return {
        '__order__': tuple(order) if len(order) else None,
        'q': value.get('fuller_form_of_name'),
        'u': value.get('affiliation'),
        '0': utils.reverse_force_list(
            value.get('authority_record_control_number_or_standard_number')
        ),
        'd': value.get('dates_associated_with_a_name'),
        'n': utils.reverse_force_list(
            value.get('number_of_part_section_of_a_work')
        ),
        'l': value.get('language_of_a_work'),
        '6': value.get('linkage'),
        'c': utils.reverse_force_list(
            value.get('titles_and_words_associated_with_a_name')
        ),
        '4': utils.reverse_force_list(
            value.get('relator_code')
        ),
        '8': utils.reverse_force_list(
            value.get('field_link_and_sequence_number')
        ),
        'g': utils.reverse_force_list(
            value.get('miscellaneous_information')
        ),
        'e': utils.reverse_force_list(
            value.get('relator_term')
        ),
        'j': utils.reverse_force_list(
            value.get('attribution_qualifier')
        ),
        'b': value.get('numeration'),
        'p': utils.reverse_force_list(
            value.get('name_of_part_section_of_a_work')
        ),
        't': value.get('title_of_a_work'),
        'a': value.get('personal_name'),
        'k': utils.reverse_force_list(
            value.get('form_subheading')
        ),
        'f': value.get('date_of_a_work'),
        '$ind1': indicator_map1.get(value.get('type_of_personal_name_entry_element'), '_'),
        '$ind2': '_',
    }
Ejemplo n.º 42
0
Archivo: bd6xx.py Proyecto: tind/dojson
def reverse_subject_added_entry_meeting_name(self, key, value):
    """Reverse - Subject Added Entry-Meeting Name."""
    indicator_map1 = {
        'Inverted name': '0',
        'Jurisdiction name': '1',
        'Name in direct order': '2',
    }
    indicator_map2 = {
        'Library of Congress Subject Headings': '0',
        'LC subject headings for children\'s literature': '1',
        'Medical Subject Headings': '2',
        'National Agricultural Library subject authority file': '3',
        'Source not specified': '4',
        'Canadian Subject Headings': '5',
        'Répertoire de vedettes-matière': '6',
        'Source specified in subfield $2': '7',
    }

    field_map = {
        'meeting_name_or_jurisdiction_name_as_entry_element': 'a',
        'location_of_meeting': 'c',
        'date_of_meeting': 'd',
        'subordinate_unit': 'e',
        'date_of_a_work': 'f',
        'miscellaneous_information': 'g',
        'medium': 'h',
        'relator_term': 'j',
        'form_subheading': 'k',
        'language_of_a_work': 'l',
        'number_of_part_section_meeting': 'n',
        'name_of_part_section_of_a_work': 'p',
        'name_of_meeting_following_jurisdiction_name_entry_element': 'q',
        'version': 's',
        'title_of_a_work': 't',
        'affiliation': 'u',
        'form_subdivision': 'v',
        'general_subdivision': 'x',
        'chronological_subdivision': 'y',
        'geographic_subdivision': 'z',
        'authority_record_control_number_or_standard_number': '0',
        'source_of_heading_or_term': '2',
        'materials_specified': '3',
        'relator_code': '4',
        'linkage': '6',
        'field_link_and_sequence_number': '8',
    }

    order = utils.map_order(field_map, value)

    if indicator_map2.get(value.get('thesaurus'), '7') != '7':
        try:
            order.remove('2')
        except ValueError:
            pass

    return {
        '__order__': tuple(order) if len(order) else None,
        'a': value.get('meeting_name_or_jurisdiction_name_as_entry_element'),
        'c': value.get('location_of_meeting'),
        'd': value.get('date_of_meeting'),
        'e': utils.reverse_force_list(
            value.get('subordinate_unit')
        ),
        'f': value.get('date_of_a_work'),
        'g': value.get('miscellaneous_information'),
        'h': value.get('medium'),
        'j': utils.reverse_force_list(
            value.get('relator_term')
        ),
        'k': utils.reverse_force_list(
            value.get('form_subheading')
        ),
        'l': value.get('language_of_a_work'),
        'n': utils.reverse_force_list(
            value.get('number_of_part_section_meeting')
        ),
        'p': utils.reverse_force_list(
            value.get('name_of_part_section_of_a_work')
        ),
        'q': value.get('name_of_meeting_following_jurisdiction_name_entry_element'),
        's': value.get('version'),
        't': value.get('title_of_a_work'),
        'u': value.get('affiliation'),
        'v': utils.reverse_force_list(
            value.get('form_subdivision')
        ),
        'x': utils.reverse_force_list(
            value.get('general_subdivision')
        ),
        'y': utils.reverse_force_list(
            value.get('chronological_subdivision')
        ),
        'z': utils.reverse_force_list(
            value.get('geographic_subdivision')
        ),
        '0': utils.reverse_force_list(
            value.get('authority_record_control_number_or_standard_number')
        ),
        '2': value.get('source_of_heading_or_term'),
        '3': value.get('materials_specified'),
        '4': utils.reverse_force_list(
            value.get('relator_code')
        ),
        '6': value.get('linkage'),
        '8': utils.reverse_force_list(
            value.get('field_link_and_sequence_number')
        ),
        '$ind1': indicator_map1.get(value.get('type_of_meeting_name_entry_element'), '_'),
        '$ind2': indicator_map2.get(value.get('thesaurus'), '_'),
    }
Ejemplo n.º 43
0
def main_entry_uniform_title(self, key, value):
    """Main Entry-Uniform Title."""
    indicator_map1 = {str(x): str(x) for x in range(10)}
    field_map = {
        'k': 'form_subheading',
        'f': 'date_of_a_work',
        's': 'version',
        '6': 'linkage',
        't': 'title_of_a_work',
        'p': 'name_of_part_section_of_a_work',
        'n': 'number_of_part_section_of_a_work',
        'o': 'arranged_statement_for_music',
        'g': 'miscellaneous_information',
        '8': 'field_link_and_sequence_number',
        'h': 'medium',
        'a': 'uniform_title',
        'm': 'medium_of_performance_for_music',
        'l': 'language_of_a_work',
        '0': 'authority_record_control_number_or_standard_number',
        'd': 'date_of_treaty_signing',
        'r': 'key_for_music',
    }

    order = utils.map_order(field_map, value)

    if key[3] in indicator_map1:
        order.append('nonfiling_characters')

    return {
        '__order__':
        tuple(order) if len(order) else None,
        'form_subheading':
        utils.force_list(value.get('k')),
        'date_of_a_work':
        value.get('f'),
        'version':
        value.get('s'),
        'linkage':
        value.get('6'),
        'title_of_a_work':
        value.get('t'),
        'name_of_part_section_of_a_work':
        utils.force_list(value.get('p')),
        'number_of_part_section_of_a_work':
        utils.force_list(value.get('n')),
        'arranged_statement_for_music':
        value.get('o'),
        'miscellaneous_information':
        utils.force_list(value.get('g')),
        'field_link_and_sequence_number':
        utils.force_list(value.get('8')),
        'medium':
        value.get('h'),
        'uniform_title':
        value.get('a'),
        'medium_of_performance_for_music':
        utils.force_list(value.get('m')),
        'language_of_a_work':
        value.get('l'),
        'authority_record_control_number_or_standard_number':
        utils.force_list(value.get('0')),
        'date_of_treaty_signing':
        utils.force_list(value.get('d')),
        'key_for_music':
        value.get('r'),
        'nonfiling_characters':
        indicator_map1.get(key[3]),
    }
Ejemplo n.º 44
0
def reverse_main_entry_meeting_name(self, key, value):
    """Reverse - Main Entry-Meeting Name."""
    indicator_map1 = {
        "Inverted name": "0",
        "Jurisdiction name": "1",
        "Name in direct order": "2"}
    field_map = {
        'name_of_meeting_following_jurisdiction_name_entry_element': 'q',
        'affiliation': 'u',
        'authority_record_control_number_or_standard_number': '0',
        'date_of_meeting': 'd',
        'number_of_part_section_meeting': 'n',
        'language_of_a_work': 'l',
        'linkage': '6',
        'location_of_meeting': 'c',
        'relator_code': '4',
        'field_link_and_sequence_number': '8',
        'miscellaneous_information': 'g',
        'subordinate_unit': 'e',
        'relator_term': 'j',
        'name_of_part_section_of_a_work': 'p',
        'title_of_a_work': 't',
        'meeting_name_or_jurisdiction_name_as_entry_element': 'a',
        'form_subheading': 'k',
        'date_of_a_work': 'f',
    }

    order = utils.map_order(field_map, value)

    if indicator_map1.get(
            value.get('type_of_meeting_name_entry_element'), '7') != '7':
        try:
            order.remove(field_map.get('type_of_meeting_name_entry_element'))
        except ValueError:
            pass

    return {
        '__order__': tuple(order) if len(order) else None,
        'q': value.get('name_of_meeting_following_jurisdiction_name_entry_element'),
        'u': value.get('affiliation'),
        '0': utils.reverse_force_list(
            value.get('authority_record_control_number_or_standard_number')
        ),
        'd': value.get('date_of_meeting'),
        'n': utils.reverse_force_list(
            value.get('number_of_part_section_meeting')
        ),
        'l': value.get('language_of_a_work'),
        '6': value.get('linkage'),
        'c': utils.reverse_force_list(
            value.get('location_of_meeting')
        ),
        '4': utils.reverse_force_list(
            value.get('relator_code')
        ),
        '8': utils.reverse_force_list(
            value.get('field_link_and_sequence_number')
        ),
        'g': utils.reverse_force_list(
            value.get('miscellaneous_information')
        ),
        'e': utils.reverse_force_list(
            value.get('subordinate_unit')
        ),
        'j': utils.reverse_force_list(
            value.get('relator_term')
        ),
        'p': utils.reverse_force_list(
            value.get('name_of_part_section_of_a_work')
        ),
        't': value.get('title_of_a_work'),
        'a': value.get('meeting_name_or_jurisdiction_name_as_entry_element'),
        'k': utils.reverse_force_list(
            value.get('form_subheading')
        ),
        'f': value.get('date_of_a_work'),
        '$ind1': indicator_map1.get(value.get('type_of_meeting_name_entry_element'), '_'),
        '$ind2': '_',
    }
Ejemplo n.º 45
0
Archivo: bd3xx.py Proyecto: tind/dojson
def normalized_date_and_sequential_designation(self, key, value):
    """Normalized Date and Sequential Designation."""
    indicator_map1 = {
        '_': 'No information provided',
        '0': 'Starting information',
        '1': 'Ending information',
    }
    indicator_map2 = {
        '_': 'Not specified',
        '0': 'Closed',
        '1': 'Open',
    }

    field_map = {
        'a': 'first_level_of_enumeration',
        'b': 'second_level_of_enumeration',
        'c': 'third_level_of_enumeration',
        'd': 'fourth_level_of_enumeration',
        'e': 'fifth_level_of_enumeration',
        'f': 'sixth_level_of_enumeration',
        'g': 'alternative_numbering_scheme_first_level_of',
        'h': 'alternative_numbering_scheme_second_level_of',
        'i': 'first_level_of_chronology',
        'j': 'second_level_of_chronology',
        'k': 'third_level_of_chronology',
        'l': 'fourth_level_of_chronology',
        'm': 'alternative_numbering_scheme_chronology',
        'u': 'first_level_textual_designation',
        'v': 'first_level_of_chronology_issuance',
        'x': 'nonpublic_note',
        'z': 'public_note',
        '6': 'linkage',
        '8': 'field_link_and_sequence_number',
    }

    order = utils.map_order(field_map, value)

    if key[3] in indicator_map1:
        order.append('start_end_designator')
    if key[4] in indicator_map2:
        order.append('state_of_issuance')

    return {
        '__order__': tuple(order) if len(order) else None,
        'first_level_of_enumeration': value.get('a'),
        'second_level_of_enumeration': value.get('b'),
        'third_level_of_enumeration': value.get('c'),
        'fourth_level_of_enumeration': value.get('d'),
        'fifth_level_of_enumeration': value.get('e'),
        'sixth_level_of_enumeration': value.get('f'),
        'alternative_numbering_scheme_first_level_of_enumeration':
        value.get('g'),
        'alternative_numbering_scheme_second_level_of_enumeration':
        value.get('h'),
        'first_level_of_chronology': value.get('i'),
        'second_level_of_chronology': value.get('j'),
        'third_level_of_chronology': value.get('k'),
        'fourth_level_of_chronology': value.get('l'),
        'alternative_numbering_scheme_chronology': value.get('m'),
        'first_level_textual_designation': value.get('u'),
        'first_level_of_chronology_issuance': value.get('v'),
        'nonpublic_note': utils.force_list(value.get('x')),
        'public_note': utils.force_list(value.get('z')),
        'linkage': value.get('6'),
        'field_link_and_sequence_number': value.get('8'),
        'start_end_designator': indicator_map1.get(key[3]),
        'state_of_issuance': indicator_map2.get(key[4]),
    }
Ejemplo n.º 46
0
def main_entry_corporate_name(self, key, value):
    """Main Entry-Corporate Name."""
    indicator_map1 = {
        "0": "Inverted name",
        "1": "Jurisdiction name",
        "2": "Name in direct order",
    }
    field_map = {
        'k': 'form_subheading',
        'u': 'affiliation',
        'f': 'date_of_a_work',
        'c': 'location_of_meeting',
        'e': 'relator_term',
        '6': 'linkage',
        't': 'title_of_a_work',
        'p': 'name_of_part_section_of_a_work',
        'n': 'number_of_part_section_meeting',
        '4': 'relator_code',
        'g': 'miscellaneous_information',
        '8': 'field_link_and_sequence_number',
        'a': 'corporate_name_or_jurisdiction_name_as_entry_element',
        'l': 'language_of_a_work',
        '0': 'authority_record_control_number_or_standard_number',
        'd': 'date_of_meeting_or_treaty_signing',
        'b': 'subordinate_unit',
    }

    order = utils.map_order(field_map, value)

    if key[3] in indicator_map1:
        order.append('type_of_corporate_name_entry_element')

    return {
        '__order__':
        tuple(order) if len(order) else None,
        'form_subheading':
        utils.force_list(value.get('k')),
        'affiliation':
        value.get('u'),
        'date_of_a_work':
        value.get('f'),
        'location_of_meeting':
        utils.force_list(value.get('c')),
        'relator_term':
        utils.force_list(value.get('e')),
        'linkage':
        value.get('6'),
        'title_of_a_work':
        value.get('t'),
        'name_of_part_section_of_a_work':
        utils.force_list(value.get('p')),
        'number_of_part_section_meeting':
        utils.force_list(value.get('n')),
        'relator_code':
        utils.force_list(value.get('4')),
        'miscellaneous_information':
        utils.force_list(value.get('g')),
        'field_link_and_sequence_number':
        utils.force_list(value.get('8')),
        'corporate_name_or_jurisdiction_name_as_entry_element':
        value.get('a'),
        'language_of_a_work':
        value.get('l'),
        'authority_record_control_number_or_standard_number':
        utils.force_list(value.get('0')),
        'date_of_meeting_or_treaty_signing':
        utils.force_list(value.get('d')),
        'subordinate_unit':
        utils.force_list(value.get('b')),
        'type_of_corporate_name_entry_element':
        indicator_map1.get(key[3]),
    }
Ejemplo n.º 47
0
Archivo: bd3xx.py Proyecto: tind/dojson
def physical_medium(self, key, value):
    """Physical Medium."""
    field_map = {
        'a': 'material_base_and_configuration',
        'b': 'dimensions',
        'c': 'materials_applied_to_surface',
        'd': 'information_recording_technique',
        'e': 'support',
        'f': 'production_rate_ratio',
        'h': 'location_within_medium',
        'i': 'technical_specifications_of_medium',
        'j': 'generation',
        'k': 'layout',
        'm': 'book_format',
        'n': 'font_size',
        'o': 'polarity',
        '0': 'authority_record_control_number_or_standard_number',
        '2': 'source',
        '3': 'materials_specified',
        '6': 'linkage',
        '8': 'field_link_and_sequence_number',
    }

    order = utils.map_order(field_map, value)

    return {
        '__order__':
        tuple(order) if len(order) else None,
        'material_base_and_configuration':
        utils.force_list(value.get('a')),
        'dimensions':
        utils.force_list(value.get('b'), ),
        'materials_applied_to_surface':
        utils.force_list(value.get('c')),
        'information_recording_technique':
        utils.force_list(value.get('d')),
        'support':
        utils.force_list(value.get('e')),
        'production_rate_ratio':
        utils.force_list(value.get('f')),
        'location_within_medium':
        utils.force_list(value.get('h')),
        'technical_specifications_of_medium':
        utils.force_list(value.get('i')),
        'generation':
        utils.force_list(value.get('j')),
        'layout':
        utils.force_list(value.get('k')),
        'book_format':
        utils.force_list(value.get('m')),
        'font_size':
        utils.force_list(value.get('n')),
        'polarity':
        utils.force_list(value.get('o')),
        'authority_record_control_number_or_standard_number':
        utils.force_list(value.get('0')),
        'source':
        value.get('2'),
        'materials_specified':
        value.get('3'),
        'linkage':
        value.get('6'),
        'field_link_and_sequence_number':
        utils.force_list(value.get('8')),
    }
Ejemplo n.º 48
0
def main_entry_personal_name(self, key, value):
    """Main Entry-Personal Name."""
    indicator_map1 = {"0": "Forename", "1": "Surname", "3": "Family name"}
    field_map = {
        'k': 'form_subheading',
        'u': 'affiliation',
        'f': 'date_of_a_work',
        'n': 'number_of_part_section_of_a_work',
        'c': 'titles_and_words_associated_with_a_name',
        'e': 'relator_term',
        '6': 'linkage',
        't': 'title_of_a_work',
        'p': 'name_of_part_section_of_a_work',
        'j': 'attribution_qualifier',
        '4': 'relator_code',
        'g': 'miscellaneous_information',
        '8': 'field_link_and_sequence_number',
        'a': 'personal_name',
        'l': 'language_of_a_work',
        '0': 'authority_record_control_number_or_standard_number',
        'd': 'dates_associated_with_a_name',
        'b': 'numeration',
        'q': 'fuller_form_of_name',
    }

    order = utils.map_order(field_map, value)

    if key[3] in indicator_map1:
        order.append('type_of_personal_name_entry_element')

    return {
        '__order__':
        tuple(order) if len(order) else None,
        'form_subheading':
        utils.force_list(value.get('k')),
        'affiliation':
        value.get('u'),
        'date_of_a_work':
        value.get('f'),
        'number_of_part_section_of_a_work':
        utils.force_list(value.get('n')),
        'titles_and_words_associated_with_a_name':
        utils.force_list(value.get('c')),
        'relator_term':
        utils.force_list(value.get('e')),
        'linkage':
        value.get('6'),
        'title_of_a_work':
        value.get('t'),
        'name_of_part_section_of_a_work':
        utils.force_list(value.get('p')),
        'attribution_qualifier':
        utils.force_list(value.get('j')),
        'relator_code':
        utils.force_list(value.get('4')),
        'miscellaneous_information':
        utils.force_list(value.get('g')),
        'field_link_and_sequence_number':
        utils.force_list(value.get('8')),
        'personal_name':
        value.get('a'),
        'language_of_a_work':
        value.get('l'),
        'authority_record_control_number_or_standard_number':
        utils.force_list(value.get('0')),
        'dates_associated_with_a_name':
        value.get('d'),
        'numeration':
        value.get('b'),
        'fuller_form_of_name':
        value.get('q'),
        'type_of_personal_name_entry_element':
        indicator_map1.get(key[3]),
    }
Ejemplo n.º 49
0
def series_statement_added_entry_corporate_name(self, key, value):
    """Series Statement/Added Entry-Corporate Name."""
    indicator_map1 = {
        "0": "Inverted name",
        "1": "Jurisdiction name",
        "2": "Name in direct order",
    }
    indicator_map2 = {
        "0": "Main entry not represented by pronoun",
        "1": "Main entry represented by pronoun",
    }
    field_map = {
        "p": "name_of_part_section_of_a_work",
        "6": "linkage",
        "u": "affiliation",
        "b": "subordinate_unit",
        "4": "relator_code",
        "x": "international_standard_serial_number",
        "n": "number_of_part_section_meeting",
        "a": "corporate_name_or_jurisdiction_name_as_entry_element",
        "8": "field_link_and_sequence_number",
        "k": "form_subheading",
        "t": "title_of_a_work",
        "e": "relator_term",
        "l": "language_of_a_work",
        "c": "location_of_meeting",
        "g": "miscellaneous_information",
        "f": "date_of_a_work",
        "d": "date_of_meeting_or_treaty_signing",
        "v": "volume_sequential_designation",
    }

    order = utils.map_order(field_map, value)

    if key[3] in indicator_map1:
        order.append("type_of_corporate_name_entry_element")

    if key[4] in indicator_map2:
        order.append("pronoun_represents_main_entry")

    return {
        "__order__": tuple(order) if len(order) else None,
        "name_of_part_section_of_a_work": utils.force_list(value.get("p")),
        "linkage": value.get("6"),
        "affiliation": value.get("u"),
        "subordinate_unit": utils.force_list(value.get("b")),
        "relator_code": utils.force_list(value.get("4")),
        "international_standard_serial_number": value.get("x"),
        "number_of_part_section_meeting": utils.force_list(value.get("n")),
        "corporate_name_or_jurisdiction_name_as_entry_element": value.get("a"),
        "field_link_and_sequence_number": utils.force_list(value.get("8")),
        "form_subheading": utils.force_list(value.get("k")),
        "title_of_a_work": value.get("t"),
        "relator_term": utils.force_list(value.get("e")),
        "language_of_a_work": value.get("l"),
        "location_of_meeting": value.get("c"),
        "miscellaneous_information": value.get("g"),
        "date_of_a_work": value.get("f"),
        "date_of_meeting_or_treaty_signing": utils.force_list(value.get("d")),
        "volume_sequential_designation": value.get("v"),
        "type_of_corporate_name_entry_element": indicator_map1.get(key[3]),
        "pronoun_represents_main_entry": indicator_map2.get(key[4]),
    }
Ejemplo n.º 50
0
Archivo: bd3xx.py Proyecto: tind/dojson
def geospatial_reference_data(self, key, value):
    """Geospatial Reference Data."""
    indicator_map1 = {
        '0': 'Horizontal coordinate system',
        '1': 'Vertical coordinate system',
    }

    indicator_map2 = {
        '0': 'Geographic',
        '1': 'Map projection',
        '2': 'Grid coordinate system',
        '3': 'Local planar',
        '4': 'Local',
        '5': 'Geodetic model',
        '6': 'Altitude',
        '7': 'Method specified in $2',
        '8': 'Depth',
    }

    field_map = {
        'a': 'name',
        'b': 'coordinate_units_or_distance_units',
        'c': 'latitude_resolution',
        'd': 'longitude_resolution',
        'e': 'standard_parallel_or_oblique_line_latitude',
        'f': 'oblique_line_longitude',
        'g': 'longitude_of_central_meridian_or_projection_center',
        'h': 'latitude_of_projection_center_or_projection_origin',
        'i': 'false_easting',
        'j': 'false_northing',
        'k': 'scale_factor',
        'l': 'height_of_perspective_point_above_surface',
        'm': 'azimuthal_angle',
        'n':
        'azimuth_measure_point_longitude_or_straight_vertical_longitude_from_pole',
        'o': 'landsat_number_and_path_number',
        'p': 'zone_identifier',
        'q': 'ellipsoid_name',
        'r': 'semi_major_axis',
        's': 'denominator_of_flattening_ratio',
        't': 'vertical_resolution',
        'u': 'vertical_encoding_method',
        'v': 'local_planar_local_or_other_projection_or_grid_description',
        'w': 'local_planar_or_local_georeference_information',
        '2': 'reference_method_used',
        '6': 'linkage',
        '8': 'field_link_and_sequence_number',
    }

    order = utils.map_order(field_map, value)

    if key[3] in indicator_map1:
        order.append('geospatial_reference_dimension')
    if key[4] in indicator_map2:
        order.append('geospatial_reference_method')

    return {
        '__order__':
        tuple(order) if len(order) else None,
        'name':
        value.get('a'),
        'coordinate_units_or_distance_units':
        value.get('b'),
        'latitude_resolution':
        value.get('c'),
        'longitude_resolution':
        value.get('d'),
        'standard_parallel_or_oblique_line_latitude':
        utils.force_list(value.get('e')),
        'oblique_line_longitude':
        utils.force_list(value.get('f')),
        'longitude_of_central_meridian_or_projection_center':
        value.get('g'),
        'latitude_of_projection_center_or_projection_origin':
        value.get('h'),
        'false_easting':
        value.get('i'),
        'false_northing':
        value.get('j'),
        'scale_factor':
        value.get('k'),
        'height_of_perspective_point_above_surface':
        value.get('l'),
        'azimuthal_angle':
        value.get('m'),
        'azimuth_measure_point_longitude_or_straight_vertical_longitude_from_pole':
        value.get('n'),
        'landsat_number_and_path_number':
        value.get('o'),
        'zone_identifier':
        value.get('p'),
        'ellipsoid_name':
        value.get('q'),
        'semi_major_axis':
        value.get('r'),
        'denominator_of_flattening_ratio':
        value.get('s'),
        'vertical_resolution':
        value.get('t'),
        'vertical_encoding_method':
        value.get('u'),
        'local_planar_local_or_other_projection_or_grid_description':
        value.get('v'),
        'local_planar_or_local_georeference_information':
        value.get('w'),
        'reference_method_used':
        value.get('2'),
        'linkage':
        value.get('6'),
        'field_link_and_sequence_number':
        utils.force_list(value.get('8')),
        'geospatial_reference_dimension':
        indicator_map1.get(key[3]),
        'geospatial_reference_method':
        indicator_map2.get(key[4]),
    }
Ejemplo n.º 51
0
def data_source_entry(self, key, value):
    """Data Source Entry."""
    indicator_map1 = {"0": "Display note", "1": "Do not display note"}
    indicator_map2 = {"8": "No display constant generated", "_": "Data source"}
    field_map = {
        'y': 'coden_designation',
        't': 'title',
        'm': 'material_specific_details',
        'n': 'note',
        'o': 'other_item_identifier',
        'x': 'international_standard_serial_number',
        '7': 'control_subfield',
        'h': 'physical_description',
        'j': 'period_of_content',
        'i': 'relationship_information',
        'z': 'international_standard_book_number',
        'v': 'source_contribution',
        'b': 'edition',
        'g': 'related_parts',
        'w': 'record_control_number',
        'r': 'report_number',
        'k': 'series_data_for_related_item',
        's': 'uniform_title',
        'p': 'abbreviated_title',
        'c': 'qualifying_information',
        'a': 'main_entry_heading',
        '4': 'relationship_code',
        '8': 'field_link_and_sequence_number',
        'd': 'place_publisher_and_date_of_publication',
        'u': 'standard_technical_report_number',
        '6': 'linkage',
    }

    order = utils.map_order(field_map, value)

    if key[3] in indicator_map1:
        order.append('note_controller')

    if key[4] in indicator_map2:
        order.append('display_constant_controller')

    return {
        '__order__': tuple(order) if len(order) else None,
        'coden_designation': value.get('y'),
        'title': value.get('t'),
        'material_specific_details': value.get('m'),
        'note': utils.force_list(value.get('n')),
        'other_item_identifier': utils.force_list(value.get('o')),
        'international_standard_serial_number': value.get('x'),
        'control_subfield': value.get('7'),
        'physical_description': value.get('h'),
        'period_of_content': value.get('j'),
        'relationship_information': utils.force_list(value.get('i')),
        'international_standard_book_number': utils.force_list(value.get('z')),
        'source_contribution': value.get('v'),
        'edition': value.get('b'),
        'related_parts': utils.force_list(value.get('g')),
        'record_control_number': utils.force_list(value.get('w')),
        'report_number': utils.force_list(value.get('r')),
        'series_data_for_related_item': utils.force_list(value.get('k')),
        'uniform_title': value.get('s'),
        'abbreviated_title': value.get('p'),
        'qualifying_information': value.get('c'),
        'main_entry_heading': value.get('a'),
        'relationship_code': utils.force_list(value.get('4')),
        'field_link_and_sequence_number': utils.force_list(value.get('8')),
        'place_publisher_and_date_of_publication': value.get('d'),
        'standard_technical_report_number': value.get('u'),
        'linkage': value.get('6'),
        'note_controller': indicator_map1.get(key[3]),
        'display_constant_controller': indicator_map2.get(key[4]),
    }
Ejemplo n.º 52
0
Archivo: bd3xx.py Proyecto: tind/dojson
def medium_of_performance(self, key, value):
    """Medium of Performance."""
    indicator_map1 = {
        '_': 'No information provided',
        '0': 'Medium of performance',
        '1': 'Partial medium of performance',
    }

    indicator_map2 = {
        '_': 'No information provided',
        '0': 'Not intended for access',
        '1': 'Intended for access',
    }

    field_map = {
        'a': 'medium_of_performance',
        'b': 'soloist',
        'd': 'doubling_instrument',
        'e': 'number_of_ensembles',
        'n': 'number_of_performers_of_the_same_medium',
        'p': 'alternative_medium_of_performance',
        's': 'total_number_of_performers',
        'v': 'note',
        '0': 'authority_record_control_number_or_standard_number',
        '2': 'source_of_term',
        '6': 'linkage',
        '8': 'field_link_and_sequence_number',
    }

    order = utils.map_order(field_map, value)

    if key[3] in indicator_map1:
        order.append('display_constant_controller')
    if key[4] in indicator_map2:
        order.append('access_control')

    return {
        '__order__':
        tuple(order) if len(order) else None,
        'medium_of_performance':
        utils.force_list(value.get('a')),
        'soloist':
        utils.force_list(value.get('b')),
        'doubling_instrument':
        utils.force_list(value.get('d')),
        'number_of_ensembles':
        utils.force_list(value.get('e')),
        'number_of_performers_of_the_same_medium':
        utils.force_list(value.get('n')),
        'alternative_medium_of_performance':
        utils.force_list(value.get('p')),
        'total_number_of_performers':
        utils.force_list(value.get('s')),
        'note':
        utils.force_list(value.get('v')),
        'authority_record_control_number_or_standard_number':
        utils.force_list(value.get('0')),
        'source_of_term':
        value.get('2'),
        'linkage':
        value.get('6'),
        'field_link_and_sequence_number':
        utils.force_list(value.get('8')),
        'display_constant_controller':
        indicator_map1.get(key[3]),
        'access_control':
        indicator_map2.get(key[4]),
    }
Ejemplo n.º 53
0
def see_also_from_tracing_uniform_title(self, key, value):
    """See Also From Tracing-Uniform Title."""
    field_map = {
        "a": "uniform_title",
        "d": "date_of_treaty_signing",
        "f": "date_of_a_work",
        "g": "miscellaneous_information",
        "h": "medium",
        "i": "relationship_information",
        "k": "form_subheading",
        "l": "language_of_a_work",
        "m": "medium_of_performance_for_music",
        "n": "number_of_part_section_of_a_work",
        "o": "arranged_statement_for_music",
        "p": "name_of_part_section_of_a_work",
        "r": "key_for_music",
        "s": "version",
        "t": "title_of_a_work",
        "v": "form_subdivision",
        "w": "control_subfield",
        "x": "general_subdivision",
        "y": "chronological_subdivision",
        "z": "geographic_subdivision",
        "0": "authority_record_control_number_or_standard_number",
        "4": "relationship_code",
        "5": "institution_to_which_field_applies",
        "6": "linkage",
        "8": "field_link_and_sequence_number",
    }
    order = utils.map_order(field_map, value)

    indicator_map2 = {
        "0": "0",
        "1": "1",
        "2": "2",
        "3": "3",
        "4": "4",
        "5": "5",
        "6": "6",
        "7": "7",
        "8": "8",
        "9": "9",
    }

    if key[4] in indicator_map2:
        order.append("nonfiling_characters")

    return {
        "__order__":
        tuple(order) if len(order) else None,
        "authority_record_control_number_or_standard_number":
        utils.force_list(value.get("0")),
        "institution_to_which_field_applies":
        utils.force_list(value.get("5")),
        "relationship_code":
        utils.force_list(value.get("4")),
        "linkage":
        value.get("6"),
        "field_link_and_sequence_number":
        utils.force_list(value.get("8")),
        "uniform_title":
        value.get("a"),
        "date_of_treaty_signing":
        utils.force_list(value.get("d")),
        "miscellaneous_information":
        utils.force_list(value.get("g")),
        "date_of_a_work":
        value.get("f"),
        "relationship_information":
        utils.force_list(value.get("i")),
        "medium":
        value.get("h"),
        "form_subheading":
        utils.force_list(value.get("k")),
        "medium_of_performance_for_music":
        utils.force_list(value.get("m")),
        "language_of_a_work":
        value.get("l"),
        "arranged_statement_for_music":
        value.get("o"),
        "number_of_part_section_of_a_work":
        utils.force_list(value.get("n")),
        "name_of_part_section_of_a_work":
        utils.force_list(value.get("p")),
        "version":
        value.get("s"),
        "key_for_music":
        value.get("r"),
        "title_of_a_work":
        value.get("t"),
        "control_subfield":
        value.get("w"),
        "form_subdivision":
        utils.force_list(value.get("v")),
        "chronological_subdivision":
        utils.force_list(value.get("y")),
        "general_subdivision":
        utils.force_list(value.get("x")),
        "geographic_subdivision":
        utils.force_list(value.get("z")),
        "nonfiling_characters":
        indicator_map2.get(key[4]),
    }
Ejemplo n.º 54
0
def series_statement_added_entry_personal_name(self, key, value):
    """Series Statement/Added Entry-Personal Name."""
    indicator_map1 = {"0": "Forename", "1": "Surname", "3": "Family name"}
    indicator_map2 = {
        "0": "Main entry not represented by pronoun",
        "1": "Main entry represented by pronoun",
    }
    field_map = {
        "p": "name_of_part_section_of_a_work",
        "6": "linkage",
        "u": "affiliation",
        "b": "numeration",
        "4": "relator_code",
        "x": "international_standard_serial_number",
        "n": "number_of_part_section_of_a_work",
        "a": "personal_name",
        "8": "field_link_and_sequence_number",
        "k": "form_subheading",
        "t": "title_of_a_work",
        "e": "relator_term",
        "l": "language_of_a_work",
        "c": "titles_and_other_words_associated_with_a_name",
        "g": "miscellaneous_information",
        "f": "date_of_a_work",
        "d": "dates_associated_with_a_name",
        "v": "volume_sequential_designation",
    }

    order = utils.map_order(field_map, value)

    if key[3] in indicator_map1:
        order.append("type_of_personal_name_entry_element")

    if key[4] in indicator_map2:
        order.append("pronoun_represents_main_entry")

    return {
        "__order__": tuple(order) if len(order) else None,
        "name_of_part_section_of_a_work": utils.force_list(value.get("p")),
        "linkage": value.get("6"),
        "affiliation": value.get("u"),
        "numeration": value.get("b"),
        "relator_code": utils.force_list(value.get("4")),
        "international_standard_serial_number": value.get("x"),
        "number_of_part_section_of_a_work": utils.force_list(value.get("n")),
        "personal_name": value.get("a"),
        "field_link_and_sequence_number": utils.force_list(value.get("8")),
        "form_subheading": utils.force_list(value.get("k")),
        "title_of_a_work": value.get("t"),
        "relator_term": utils.force_list(value.get("e")),
        "language_of_a_work": value.get("l"),
        "titles_and_other_words_associated_with_a_name": utils.force_list(
            value.get("c")
        ),
        "miscellaneous_information": value.get("g"),
        "date_of_a_work": value.get("f"),
        "dates_associated_with_a_name": value.get("d"),
        "volume_sequential_designation": value.get("v"),
        "type_of_personal_name_entry_element": indicator_map1.get(key[3]),
        "pronoun_represents_main_entry": indicator_map2.get(key[4]),
    }
Ejemplo n.º 55
0
def see_also_from_tracing_personal_name(self, key, value):
    """See Also From Tracing-Personal Name."""
    field_map = {
        "a": "personal_name",
        "b": "numeration",
        "c": "titles_and_other_words_associated_with_a_name",
        "d": "dates_associated_with_a_name",
        "e": "relator_term",
        "f": "date_of_a_work",
        "g": "miscellaneous_information",
        "h": "medium",
        "i": "relationship_information",
        "j": "attribution_qualifier",
        "k": "form_subheading",
        "l": "language_of_a_work",
        "m": "medium_of_performance_for_music",
        "n": "number_of_part_section_of_a_work",
        "o": "arranged_statement_for_music",
        "p": "name_of_part_section_of_a_work",
        "q": "fuller_form_of_name",
        "r": "key_for_music",
        "s": "version",
        "t": "title_of_a_work",
        "v": "form_subdivision",
        "w": "control_subfield",
        "x": "general_subdivision",
        "y": "chronological_subdivision",
        "z": "geographic_subdivision",
        "0": "authority_record_control_number_or_standard_number",
        "4": "relationship_code",
        "5": "institution_to_which_field_applies",
        "6": "linkage",
        "8": "field_link_and_sequence_number",
    }
    order = utils.map_order(field_map, value)

    indicator_map1 = {"0": "Forename", "1": "Surname", "3": "Family name"}

    if key[3] in indicator_map1:
        order.append("type_of_personal_name_entry_element")

    return {
        "__order__":
        tuple(order) if len(order) else None,
        "authority_record_control_number_or_standard_number":
        utils.force_list(value.get("0")),
        "institution_to_which_field_applies":
        utils.force_list(value.get("5")),
        "relationship_code":
        utils.force_list(value.get("4")),
        "linkage":
        value.get("6"),
        "field_link_and_sequence_number":
        utils.force_list(value.get("8")),
        "personal_name":
        value.get("a"),
        "titles_and_other_words_associated_with_a_name":
        utils.force_list(value.get("c")),
        "numeration":
        value.get("b"),
        "relator_term":
        utils.force_list(value.get("e")),
        "dates_associated_with_a_name":
        value.get("d"),
        "miscellaneous_information":
        utils.force_list(value.get("g")),
        "date_of_a_work":
        value.get("f"),
        "relationship_information":
        utils.force_list(value.get("i")),
        "medium":
        value.get("h"),
        "form_subheading":
        utils.force_list(value.get("k")),
        "attribution_qualifier":
        utils.force_list(value.get("j")),
        "medium_of_performance_for_music":
        utils.force_list(value.get("m")),
        "language_of_a_work":
        value.get("l"),
        "arranged_statement_for_music":
        value.get("o"),
        "number_of_part_section_of_a_work":
        utils.force_list(value.get("n")),
        "fuller_form_of_name":
        value.get("q"),
        "name_of_part_section_of_a_work":
        utils.force_list(value.get("p")),
        "version":
        value.get("s"),
        "key_for_music":
        value.get("r"),
        "title_of_a_work":
        value.get("t"),
        "control_subfield":
        value.get("w"),
        "form_subdivision":
        utils.force_list(value.get("v")),
        "chronological_subdivision":
        utils.force_list(value.get("y")),
        "general_subdivision":
        utils.force_list(value.get("x")),
        "geographic_subdivision":
        utils.force_list(value.get("z")),
        "type_of_personal_name_entry_element":
        indicator_map1.get(key[3]),
    }
Ejemplo n.º 56
0
def succeeding_entry(self, key, value):
    """Succeeding Entry."""
    indicator_map1 = {"0": "Display note", "1": "Do not display note"}
    indicator_map2 = {
        "0": "Continued by",
        "1": "Continued in part by",
        "2": "Superseded by",
        "3": "Superseded in part by",
        "4": "Absorbed by",
        "5": "Absorbed in part by",
        "6": "Split into ... and ...",
        "7": "Merged with ... to form ...",
        "8": "Changed back to"
    }
    field_map = {
        'y': 'coden_designation',
        't': 'title',
        'm': 'material_specific_details',
        'n': 'note',
        'o': 'other_item_identifier',
        'x': 'international_standard_serial_number',
        '7': 'control_subfield',
        'h': 'physical_description',
        'i': 'relationship_information',
        'z': 'international_standard_book_number',
        'b': 'edition',
        'g': 'related_parts',
        'w': 'record_control_number',
        'r': 'report_number',
        'k': 'series_data_for_related_item',
        's': 'uniform_title',
        'c': 'qualifying_information',
        'a': 'main_entry_heading',
        '4': 'relationship_code',
        '8': 'field_link_and_sequence_number',
        'd': 'place_publisher_and_date_of_publication',
        'u': 'standard_technical_report_number',
        '6': 'linkage',
    }

    order = utils.map_order(field_map, value)

    if key[3] in indicator_map1:
        order.append('note_controller')

    if key[4] in indicator_map2:
        order.append('type_of_relationship')

    return {
        '__order__': tuple(order) if len(order) else None,
        'coden_designation': value.get('y'),
        'title': value.get('t'),
        'material_specific_details': value.get('m'),
        'note': utils.force_list(value.get('n')),
        'other_item_identifier': utils.force_list(value.get('o')),
        'international_standard_serial_number': value.get('x'),
        'control_subfield': value.get('7'),
        'physical_description': value.get('h'),
        'relationship_information': utils.force_list(value.get('i')),
        'international_standard_book_number': utils.force_list(value.get('z')),
        'edition': value.get('b'),
        'related_parts': utils.force_list(value.get('g')),
        'record_control_number': utils.force_list(value.get('w')),
        'report_number': utils.force_list(value.get('r')),
        'series_data_for_related_item': utils.force_list(value.get('k')),
        'uniform_title': value.get('s'),
        'qualifying_information': value.get('c'),
        'main_entry_heading': value.get('a'),
        'relationship_code': utils.force_list(value.get('4')),
        'field_link_and_sequence_number': utils.force_list(value.get('8')),
        'place_publisher_and_date_of_publication': value.get('d'),
        'standard_technical_report_number': value.get('u'),
        'linkage': value.get('6'),
        'note_controller': indicator_map1.get(key[3]),
        'type_of_relationship': indicator_map2.get(key[4]),
    }
Ejemplo n.º 57
0
def heading_uniform_title(self, key, value):
    """Heading-Uniform Title."""
    field_map = {
        'a': 'uniform_title',
        'd': 'date_of_treaty_signing',
        'f': 'date_of_a_work',
        'g': 'miscellaneous_information',
        'h': 'medium',
        'k': 'form_subheading',
        'l': 'language_of_a_work',
        'm': 'medium_of_performance_for_music',
        'n': 'number_of_part_section_of_a_work',
        'o': 'arranged_statement_for_music',
        'p': 'name_of_part_section_of_a_work',
        'r': 'key_for_music',
        's': 'version',
        't': 'title_of_a_work',
        'v': 'form_subdivision',
        'x': 'general_subdivision',
        'y': 'chronological_subdivision',
        'z': 'geographic_subdivision',
        '6': 'linkage',
        '8': 'field_link_and_sequence_number',
    }
    order = utils.map_order(field_map, value)

    indicator_map2 = {
        '0': '0',
        '1': '1',
        '2': '2',
        '3': '3',
        '4': '4',
        '5': '5',
        '6': '6',
        '7': '7',
        '8': '8',
        '9': '9'
    }

    if key[4] in indicator_map2:
        order.append('nonfiling_characters')

    return {
        '__order__': tuple(order) if len(order) else None,
        'uniform_title': value.get('a'),
        'general_subdivision': utils.force_list(value.get('x')),
        'date_of_treaty_signing': utils.force_list(value.get('d')),
        'miscellaneous_information': utils.force_list(value.get('g')),
        'date_of_a_work': value.get('f'),
        'medium': value.get('h'),
        'form_subheading': utils.force_list(value.get('k')),
        'form_subdivision': utils.force_list(value.get('v')),
        'medium_of_performance_for_music': utils.force_list(value.get('m')),
        'language_of_a_work': value.get('l'),
        'arranged_statement_for_music': value.get('o'),
        'number_of_part_section_of_a_work': utils.force_list(value.get('n')),
        'name_of_part_section_of_a_work': utils.force_list(value.get('p')),
        'version': value.get('s'),
        'key_for_music': value.get('r'),
        'title_of_a_work': value.get('t'),
        'linkage': value.get('6'),
        'chronological_subdivision': utils.force_list(value.get('y')),
        'field_link_and_sequence_number': utils.force_list(value.get('8')),
        'geographic_subdivision': utils.force_list(value.get('z')),
        'nonfiling_characters': indicator_map2.get(key[4]),
    }
Ejemplo n.º 58
0
def see_also_from_tracing_meeting_name(self, key, value):
    """See Also From Tracing-Meeting Name."""
    field_map = {
        "a": "meeting_name_or_jurisdiction_name_as_entry_element",
        "c": "location_of_meeting",
        "d": "date_of_meeting",
        "e": "subordinate_unit",
        "f": "date_of_a_work",
        "g": "miscellaneous_information",
        "h": "medium",
        "i": "relationship_information",
        "j": "relator_term",
        "k": "form_subheading",
        "l": "language_of_a_work",
        "n": "number_of_part_section_meeting",
        "p": "name_of_part_section_of_a_work",
        "q": "name_of_meeting_following_jurisdiction_name_entry_element",
        "s": "version",
        "t": "title_of_a_work",
        "v": "form_subdivision",
        "w": "control_subfield",
        "x": "general_subdivision",
        "y": "chronological_subdivision",
        "z": "geographic_subdivision",
        "0": "authority_record_control_number_or_standard_number",
        "4": "relationship_code",
        "5": "institution_to_which_field_applies",
        "6": "linkage",
        "8": "field_link_and_sequence_number",
    }
    order = utils.map_order(field_map, value)

    indicator_map1 = {
        "0": "Inverted name",
        "1": "Jurisdiction name",
        "2": "Name in direct order",
    }

    if key[3] in indicator_map1:
        order.append("type_of_meeting_name_entry_element")

    return {
        "__order__":
        tuple(order) if len(order) else None,
        "authority_record_control_number_or_standard_number":
        utils.force_list(value.get("0")),
        "institution_to_which_field_applies":
        utils.force_list(value.get("5")),
        "relationship_code":
        utils.force_list(value.get("4")),
        "linkage":
        value.get("6"),
        "field_link_and_sequence_number":
        utils.force_list(value.get("8")),
        "meeting_name_or_jurisdiction_name_as_entry_element":
        value.get("a"),
        "location_of_meeting":
        utils.force_list(value.get("c")),
        "subordinate_unit":
        utils.force_list(value.get("e")),
        "date_of_meeting":
        value.get("d"),
        "miscellaneous_information":
        utils.force_list(value.get("g")),
        "date_of_a_work":
        value.get("f"),
        "relationship_information":
        utils.force_list(value.get("i")),
        "medium":
        value.get("h"),
        "form_subheading":
        utils.force_list(value.get("k")),
        "relator_term":
        utils.force_list(value.get("j")),
        "language_of_a_work":
        value.get("l"),
        "number_of_part_section_meeting":
        utils.force_list(value.get("n")),
        "name_of_meeting_following_jurisdiction_name_entry_element":
        value.get("q"),
        "name_of_part_section_of_a_work":
        utils.force_list(value.get("p")),
        "version":
        value.get("s"),
        "title_of_a_work":
        value.get("t"),
        "control_subfield":
        value.get("w"),
        "form_subdivision":
        utils.force_list(value.get("v")),
        "chronological_subdivision":
        utils.force_list(value.get("y")),
        "general_subdivision":
        utils.force_list(value.get("x")),
        "geographic_subdivision":
        utils.force_list(value.get("z")),
        "type_of_meeting_name_entry_element":
        indicator_map1.get(key[3]),
    }
Ejemplo n.º 59
0
def heading_meeting_name(self, key, value):
    """Heading-Meeting Name."""
    field_map = {
        'a': 'meeting_name_or_jurisdiction_name_as_entry_element',
        'c': 'location_of_meeting',
        'd': 'date_of_meeting',
        'e': 'subordinate_unit',
        'f': 'date_of_a_work',
        'g': 'miscellaneous_information',
        'h': 'medium',
        'j': 'relator_term',
        'k': 'form_subheading',
        'l': 'language_of_a_work',
        'n': 'number_of_part_section_meeting',
        'p': 'name_of_part_section_of_a_work',
        'q': 'name_of_meeting_following_jurisdiction_name_entry_element',
        's': 'version',
        't': 'title_of_a_work',
        'v': 'form_subdivision',
        'x': 'general_subdivision',
        'y': 'chronological_subdivision',
        'z': 'geographic_subdivision',
        '6': 'linkage',
        '8': 'field_link_and_sequence_number',
    }
    order = utils.map_order(field_map, value)

    indicator_map1 = {
        '0': 'Inverted name',
        '1': 'Jurisdiction name',
        '2': 'Name in direct order'
    }

    if key[3] in indicator_map1:
        order.append('type_of_meeting_name_entry_element')

    return {
        '__order__': tuple(order) if len(order) else None,
        'meeting_name_or_jurisdiction_name_as_entry_element': value.get('a'),
        'general_subdivision': utils.force_list(value.get('x')),
        'location_of_meeting': utils.force_list(value.get('c')),
        'form_subdivision': utils.force_list(value.get('v')),
        'subordinate_unit': utils.force_list(value.get('e')),
        'date_of_meeting': value.get('d'),
        'miscellaneous_information': utils.force_list(value.get('g')),
        'date_of_a_work': value.get('f'),
        'medium': value.get('h'),
        'form_subheading': utils.force_list(value.get('k')),
        'relator_term': utils.force_list(value.get('j')),
        'language_of_a_work': value.get('l'),
        'number_of_part_section_meeting': utils.force_list(value.get('n')),
        'name_of_meeting_following_jurisdiction_name_entry_element':
        value.get('q'),
        'name_of_part_section_of_a_work': utils.force_list(value.get('p')),
        'version': value.get('s'),
        'title_of_a_work': value.get('t'),
        'linkage': value.get('6'),
        'chronological_subdivision': utils.force_list(value.get('y')),
        'field_link_and_sequence_number': utils.force_list(value.get('8')),
        'geographic_subdivision': utils.force_list(value.get('z')),
        'type_of_meeting_name_entry_element': indicator_map1.get(key[3]),
    }
Ejemplo n.º 60
0
def added_entry_personal_name(self, key, value):
    """Added Entry-Personal Name."""
    indicator_map1 = {"0": "Forename", "1": "Surname", "3": "Family name"}
    indicator_map2 = {"#": "No information provided", "2": "Analytical entry"}
    field_map = {
        '0': 'authority_record_control_number',
        '3': 'materials_specified',
        '4': 'relator_code',
        '5': 'institution_to_which_field_applies',
        '6': 'linkage',
        '8': 'field_link_and_sequence_number',
        'a': 'personal_name',
        'b': 'numeration',
        'c': 'titles_and_other_words_associated_with_a_name',
        'd': 'dates_associated_with_a_name',
        'e': 'relator_term',
        'f': 'date_of_a_work',
        'h': 'medium',
        'i': 'relationship_information',
        'j': 'attribution_qualifier',
        'k': 'form_subheading',
        'l': 'language_or_a_work',
        'm': 'medium_of_performance_for_music',
        'n': 'number_of_part_section_of_a_work',
        'o': 'arranged_statement_for_music',
        'p': 'name_of_part_section_of_a_work',
        's': 'version',
        'r': 'key_for_music',
        'u': 'affiliation',
        't': 'title_of_a_work',
        'x': 'international_standard_serial_number',
    }

    order = utils.map_order(field_map, value)
    if key[3] in indicator_map1:
        order.append('type_of_personal_name_entry_element')
    if key[4] in indicator_map2:
        order.append('type_of_added_entry')

    return {
        'authority_record_control_number': utils.force_list(
            value.get('0')
        ),
        'materials_specified': value.get('3'),
        'institution_to_which_field_applies': value.get('5'),
        'relator_code': utils.force_list(
            value.get('4')
        ),
        'linkage': value.get('6'),
        'field_link_and_sequence_number': utils.force_list(
            value.get('8')
        ),
        'personal_name': value.get('a'),
        'titles_and_other_words_associated_with_a_name': utils.force_list(
            value.get('c')
        ),
        'numeration': value.get('b'),
        'relator_term': utils.force_list(
            value.get('e')
        ),
        'dates_associated_with_a_name': value.get('d'),
        'miscellaneous_information': value.get('g'),
        'date_of_a_work': value.get('f'),
        'relationship_information': utils.force_list(
            value.get('i')
        ),
        'medium': value.get('h'),
        'form_subheading': utils.force_list(
            value.get('k')
        ),
        'attribution_qualifier': utils.force_list(
            value.get('j')
        ),
        'medium_of_performance_for_music': utils.force_list(
            value.get('m')
        ),
        'language_of_a_work': value.get('l'),
        'arranged_statement_for_music': value.get('o'),
        'number_of_part_section_of_a_work': utils.force_list(
            value.get('n')
        ),
        'fuller_form_of_name': value.get('q'),
        'name_of_part_section_of_a_work': utils.force_list(
            value.get('p')
        ),
        'version': value.get('s'),
        'key_for_music': value.get('r'),
        'affiliation': value.get('u'),
        'title_of_a_work': value.get('t'),
        'international_standard_serial_number': value.get('x'),
        'type_of_personal_name_entry_element': indicator_map1.get(key[3]),
        'type_of_added_entry': indicator_map2.get(key[4]),
        '__order__': tuple(order) if len(order) else None
    }