<commit_before>'''
Declarations used to elucidate MARC model
'''
#Just set up some flags
#BOUND_TO_WORK = object()
#BOUND_TO_INSTANCE = object()

#Full MARC field list: http://www.loc.gov/marc/bibliographic/ecbdlist.html

#This line must be included
from bibframe.reader.util import *

MATERIALIZE = {
'100': ('creator', {'marcrType': 'Person'}),
'110': ('creator', {'marcrType': 'Organization'}),
'111': ('creator', {'marcrType': 'Meeting'}),

'130': ('uniformMemberOf', {'marcrType': 'Collection'}),
'240a': ('uniformMemberOf', {'marcrType': 'Collection'}),
'243a': ('uniformMemberOf', {'marcrType': 'Collection'}),
'730': ('uniformMemberOf', {'marcrType': 'Collection'}),
'830': ('uniformMemberOf', {'marcrType': 'Collection'}),

'260': ('publication', {'marcrType': 'ProviderEvent'}),
'264': ('publication', {'marcrType': 'ProviderEvent'}),

'264-x3': ('manufacture', {'marcrType': 'ProviderEvent'}),
'264-x2': ('distribution', {'marcrType': 'ProviderEvent'}),
'264-x1': ('publication', {'marcrType': 'ProviderEvent'}),
'264-x0': ('production', {'marcrType': 'ProviderEvent'}),

'260a': ('providerAgent', {'marcrType': 'Place'}),
'260b': ('providerAgent', {'marcrType': 'Agent'}),
'260e': ('providerAgent', {'marcrType': 'Place'}),
'260f': ('providerAgent', {'marcrType': 'Agent'}),
'264a': ('providerAgent', {'marcrType': 'Place'}),
'264b': ('providerAgent', {'marcrType': 'Agent'}),

#'300': ('physicalDescription', {'marcrType': 'Measurement'}),

'600': ('subject', {'marcrType': 'Person'}),
'610': ('subject', {'marcrType': 'Organization'}),
'611': ('subject', {'marcrType': 'Meeting'}),

'630': ('uniformTitle', {'marcrType': 'Title'}),
'650': ('subject', {'marcrType': 'Topic'}),
'651': ('subject', {'marcrType': 'Geographic'}),
'655': ('genre', {'marcrType': 'Genre'}),

'700': ('contributor', {'marcrType': 'Person'}),
'710': ('contributor', {'marcrType': 'Organization'}),
'711': ('contributor', {'marcrType': 'Meeting'}),

'740': ('contributor', {'marcrType': 'Person'}),
}

MATERIALIZE_VIA_ANNOTATION = {
'852': ('institution', 'HeldItem', {'holderType': 'Library'},),
}

#A refinement is a relationship from one mapping to another in order to refine
#
#REFINEMENTS = {
#'700a': ('700e', normalizeparse, action.replace)
#}


FIELD_RENAMINGS = {
# where do we put LDR info, e.g. LDR 07 / 19 positions = mode of issuance
'010a': 'lccn',
#Don't do a simple field renaming of ISBN because
'017a': 'legalDeposit',
'019a': 'localControlNumber',
#'020a': 'isbn',
'022a': 'issn',
'024a': 'otherControlNumber',
'025a': 'lcOverseasAcq',
'034a': 'cartographicMathematicalDataScaleStatement', #Rebecca & Sally suggested this should effectively be a merge with 034a
'034b': 'cartographicMathematicalDataProjectionStatement',
'034c': 'cartographicMathematicalDataCoordinateStatement',
'035a': 'systemControlNumber',
'037a': 'stockNumber',
'040a': 'catalogingSource',
'050a': 'lcCallNumber',
'050b': 'lcItemNumber',
'0503': 'material',
'060a': 'nlmCallNumber',
'060b': 'nlmItemNumber',
'061a': 'nlmCopyStatement',
'070a': 'nalCallNumber',
'070b': 'nalItemNumber', 
'071a': 'nalCopyStatement',
'082a': 'deweyNumber',
'100a': 'label',
'100b': 'numeration',
'100c': 'titles',
'100d': 'date',  #Note: there has been discussion about removing this, but we are not sure we get reliable ID.LOC lookups without it.  If it is removed, update augment.py 
'110a': 'label',
'110d': 'date',
'111a': 'label',
'111d': 'date',
'130a': 'label',
'130a': 'title',
'130n': 'workSection', 
'240a': 'title',
'730a': 'label',
'830a': 'title',
'130l': 'language',
'041a': 'language',
'210a': 'abbreviatedTitle',
'222a': 'keyTitle',
'240d': 'legalDate',
'240h': 'medium',
'240m': 'musicMedium',  	
'240r': 'musicKey',
'245a': 'title',
'245b': 'subtitle',
'245c': 'statement',
'245f': 'inclusiveDates',
'245h': 'medium',
'245k': 'formDesignation',
'246a': 'titleVariation',
'246f': 'titleVariationDate',
'247a': 'formerTitle',
'250a': 'edition',
'250b': 'edition',
'254a': 'musicalPresentation',
'255a': 'cartographicMathematicalDataScaleStatement',
'255b': 'cartographicMathematicalDataProjectionStatement',
'255c': 'cartographicMathematicalDataCoordinateStatement',<commit_msg>correcting 740<commit_after>'''
Declarations used to elucidate MARC model
'''
#Just set up some flags
#BOUND_TO_WORK = object()
#BOUND_TO_INSTANCE = object()

#Full MARC field list: http://www.loc.gov/marc/bibliographic/ecbdlist.html

#This line must be included
from bibframe.reader.util import *

MATERIALIZE = {
'100': ('creator', {'marcrType': 'Person'}),
'110': ('creator', {'marcrType': 'Organization'}),
'111': ('creator', {'marcrType': 'Meeting'}),

'130': ('uniformMemberOf', {'marcrType': 'Collection'}),
'240a': ('uniformMemberOf', {'marcrType': 'Collection'}),
'243a': ('uniformMemberOf', {'marcrType': 'Collection'}),
'730': ('uniformMemberOf', {'marcrType': 'Collection'}),
'830': ('uniformMemberOf', {'marcrType': 'Collection'}),

'260': ('publication', {'marcrType': 'ProviderEvent'}),
'264': ('publication', {'marcrType': 'ProviderEvent'}),

'264-x3': ('manufacture', {'marcrType': 'ProviderEvent'}),
'264-x2': ('distribution', {'marcrType': 'ProviderEvent'}),
'264-x1': ('publication', {'marcrType': 'ProviderEvent'}),
'264-x0': ('production', {'marcrType': 'ProviderEvent'}),

'260a': ('providerAgent', {'marcrType': 'Place'}),
'260b': ('providerAgent', {'marcrType': 'Agent'}),
'260e': ('providerAgent', {'marcrType': 'Place'}),
'260f': ('providerAgent', {'marcrType': 'Agent'}),
'264a': ('providerAgent', {'marcrType': 'Place'}),
'264b': ('providerAgent', {'marcrType': 'Agent'}),

#'300': ('physicalDescription', {'marcrType': 'Measurement'}),

'600': ('subject', {'marcrType': 'Person'}),
'610': ('subject', {'marcrType': 'Organization'}),
'611': ('subject', {'marcrType': 'Meeting'}),

'630': ('uniformTitle', {'marcrType': 'Title'}),
'650': ('subject', {'marcrType': 'Topic'}),
'651': ('subject', {'marcrType': 'Geographic'}),
'655': ('genre', {'marcrType': 'Genre'}),

'700': ('contributor', {'marcrType': 'Person'}),
'710': ('contributor', {'marcrType': 'Organization'}),
'711': ('contributor', {'marcrType': 'Meeting'}),
}

MATERIALIZE_VIA_ANNOTATION = {
'852': ('institution', 'HeldItem', {'holderType': 'Library'},),
}

#A refinement is a relationship from one mapping to another in order to refine
#
#REFINEMENTS = {
#'700a': ('700e', normalizeparse, action.replace)
#}


FIELD_RENAMINGS = {
# where do we put LDR info, e.g. LDR 07 / 19 positions = mode of issuance
'010a': 'lccn',
#Don't do a simple field renaming of ISBN because
'017a': 'legalDeposit',
'019a': 'localControlNumber',
'020a': 'isbn',
'022a': 'issn',
'024a': 'otherControlNumber',
'025a': 'lcOverseasAcq',
'034a': 'cartographicMathematicalDataScaleStatement', #Rebecca & Sally suggested this should effectively be a merge with 034a
'034b': 'cartographicMathematicalDataProjectionStatement',
'034c': 'cartographicMathematicalDataCoordinateStatement',
'035a': 'systemControlNumber',
'037a': 'stockNumber',
'040a': 'catalogingSource',
'050a': 'lcCallNumber',
'050b': 'lcItemNumber',
'0503': 'material',
'060a': 'nlmCallNumber',
'060b': 'nlmItemNumber',
'061a': 'nlmCopyStatement',
'070a': 'nalCallNumber',
'070b': 'nalItemNumber', 
'071a': 'nalCopyStatement',
'082a': 'deweyNumber',
'100a': 'label',
'100b': 'numeration',
'100c': 'titles',
'100d': 'date',  #Note: there has been discussion about removing this, but we are not sure we get reliable ID.LOC lookups without it.  If it is removed, update augment.py 
'110a': 'label',
'110d': 'date',
'111a': 'label',
'111d': 'date',
'130a': 'label',
'130a': 'title',
'130n': 'workSection', 
'240a': 'title',
'240a': 'label',
'730a': 'label',
'830a': 'title',
'130l': 'language',
'041a': 'language',
'210a': 'abbreviatedTitle',
'222a': 'keyTitle',
'240d': 'legalDate',
'240h': 'medium',
'240m': 'musicMedium',  	
'240r': 'musicKey',
'245a': 'title',
'245b': 'subtitle',
'245c': 'statement',
'245f': 'inclusiveDates',
'245h': 'medium',
'245k': 'formDesignation',
'246a': 'titleVariation',
'246f': 'titleVariationDate',
'247a': 'formerTitle',
'250a': 'edition',
'250b': 'edition',
'254a': 'musicalPresentation',
'255a': 'cartographicMathematicalDataScaleStatement',
'255b': 'cartographicMathematicalDataProjectionStatement',
'255c': 'cartographicMathematicalDataCoordinateStatement',
{'fraction_non_alphanumeric': 0.2341351384020307, 'fraction_numerical': 0.07216245618276321, 'mean_word_length': 8.677192982456141, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '90169', 'n_tokens_mistral': 3404, 'n_tokens_neox': 3018, 'n_words': 726}