-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathalma.fix
More file actions
158 lines (148 loc) · 4.38 KB
/
Copy pathalma.fix
File metadata and controls
158 lines (148 loc) · 4.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# Setup adds maps, macros and vars once
do once("setup")
include ("./fix/maps.fix")
include ("./fix/macros.fix")
put_var("member", "-")
end
# Skip all deleted records
if any_equal("DEL??.a", "Y")
reject()
end
# Helper element that states if a record is part of the hbz NZ
if any_equal("MBD .M", "49HBZ_NETWORK")
if any_match("POR .A", ".*")
add_field("@inNZ", "true")
else
unless any_match("035 .a", "^\\(EXLCZ\\).*")
add_field("@inNZ", "true")
end
end
end
add_field("@context","http://lobid.org/resources/context.jsonld")
# Set empty elements to manipulate the order winthin the record.
add_field("id","")
add_array("type[]")
add_array("medium[]")
add_field("title","")
do list(path:"880??","var":"$i")
copy_field("$i.6","$i.linkageTest")
replace_all("$i.linkageTest","\\d{3}(-\\d{2}).*","880$1")
copy_field("$i.6","$i.@script.id")
copy_field("$i.6","$i.@script.label")
replace_all("$i.@script.id","(\\d{3}-\\d{2})/(.*)","https://unicode.org/iso15924/iso15924.txt#$2")
replace_all("$i.@script.label","(\\d{3}-\\d{2})/(.*)","$2")
lookup("$i.@script.label","ISO15924-to-script")
end
add_array("alternateGraphicRepresentation[]")
if any_match("leader",".{6}(a[bis]|m[bis]).*")
add_field("@ContinuingResources","true")
elsif any_match("006", "^[s]")
add_field("@ContinuingResources","true")
end
include ("./fix/identifiers.fix")
include ("./fix/titleRelatedFields.fix")
include ("./fix/describedBy.fix")
include ("./fix/subjects.fix")
include ("./fix/item.fix")
# identifiers.fix, items.fix, subjects.fix and titleRelatedFields.fix are needed ahead of relatedRessourcesAndLinks.fix because of dependencies
include ("./fix/relatedRessourcesAndLinks.fix")
include ("./fix/otherFields.fix")
include ("./fix/mediumAndType.fix")
# mediumAndType.fix is needed ahead of contribution.fix because of dependencies
include ("./fix/contribution.fix")
do list(path:"alternateGraphicRepresentation[]","var":"$i")
unless any_match("$i.script.id","https://unicode.org/iso15924/iso15924.txt#.+")
add_field("$i.script.id","https://unicode.org/iso15924/iso15924.txt#Zzzz")
add_field("$i.script.label","Kein Schriftcode vergeben")
end
end
# Add inCollection for
# This tests for various fields from different outsourced fixes so that i cannot be placed in
if exists("@inNZ") # only NZ resources no local IZ resources
if any_match("@numberOfHolders[]","[123]") # check if 1-3 publications exists in the Verbund over different libraries
if less_than("@standardPubDate","$[todaysYearMinus9]") # check if resource is 10 years or older
if greater_than("@standardPubDate","1851") # check if resource is newer than 1851
if any_match("type[]","Book|Map|PublishedScore") # check if resource is of type Book, Map or Published Score
if any_match("bibliographicLevel.label","Serial component part|Monograph/Item") # Check for serials component parts or Monographs or Multivolum Book items
add_field("inCollection[].$append.id", "https://lobid.org/collections#nrwLastCopies")
add_field("inCollection[].$last.label", "nrwLastCopies")
add_array("inCollection[].$last.type[]", "Collection")
end
end
end
end
end
end
vacuum()
retain(
"@context",
"abstract[]",
"accessRights",
"almaMmsId",
"alternateGraphicRepresentation[]",
"alternativeTitle[]",
"bibliographicCitation",
"bibliographicLevel",
"bszId",
"bvbId",
"describedBy",
"description[]",
"disambiguatingDescription[]",
"conditionsOfAccess",
"containedIn[]",
"containsExampleOfWork[]",
"contribution[]",
"deprecatedUri",
"dnbId",
"doi[]",
"extent",
"edition[]",
"exampleOfWork",
"fulltextOnline[]",
"gbvId",
"hasItem[]",
"secondaryForm[]",
"hebisId",
"hbzId",
"id",
"inCollection[]",
"isbn[]",
"issn[]",
"ismn[]",
"isPartOf[]",
"k10PlusId",
"kobvId",
"language[]",
"langNote[]",
"license[]",
"manufacture[]",
"medium[]",
"natureOfContent[]",
"note[]",
"obvId",
"oclcNumber[]",
"otherTitleInformation[]",
"publication[]",
"predecessor[]",
"primaryForm[]",
"related[]",
"responsibilityStatement[]",
"rpbId",
"sameAs[]",
"seeAlso[]",
"shortTitle[]",
"spatial[]",
"stockNumber[]",
"subject[]",
"successor[]",
"supplement[]",
"tableOfContents[]",
"thesisInformation[]",
"title",
"titleKeyword[]",
"type[]",
"urn[]",
"webPageArchived[]",
"zdbId",
"subjectslabels[]"
)