-
Notifications
You must be signed in to change notification settings - Fork 7
/
alma.fix
117 lines (110 loc) · 2.72 KB
/
alma.fix
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
# 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","")
set_array("type[]")
set_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
set_array("alternateGraphicRepresentation[]")
include ("./fix/identifiers.fix")
include ("./fix/titleRelatedFields.fix")
include ("./fix/describedBy.fix")
# identifiers.fix and titleRelatedFields.fix are needed ahead of relatedRessourcesAndLinks.fix because of dependencies
include ("./fix/relatedRessourcesAndLinks.fix")
include ("./fix/otherFields.fix")
include ("./fix/subjects.fix")
include ("./fix/item.fix")
include ("./fix/mediumAndType.fix")
# mediumAndType.fix is needed ahead of contribution.fix because of dependencies
include ("./fix/contribution.fix")
vacuum()
retain(
"@context",
"abstract[]",
"almaMmsId",
"alternateGraphicRepresentation[]",
"alternativeTitle[]",
"bibliographicCitation",
"bibliographicLevel",
"describedBy",
"description[]",
"containedIn[]",
"containsExampleOfWork[]",
"contribution[]",
"deprecatedUri",
"dnbId",
"doi[]",
"extent",
"edition[]",
"exampleOfWork",
"fulltextOnline[]",
"hasItem[]",
"secondaryForm[]",
"hbzId",
"id",
"inCollection[]",
"isbn[]",
"issn[]",
"ismn[]",
"isPartOf[]",
"language[]",
"langNote[]",
"license[]",
"manufacture[]",
"medium[]",
"natureOfContent[]",
"note[]",
"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[]"
)