|
| 1 | +do put_macro("gndPersonCombinedLabel") # in contrast to morph this is not normalizing utf 8 |
| 2 | + paste("$[field].@combinedLabel","$[field].P", "$[field].a", "~, ", "$[field].d", join_char:"") |
| 3 | + replace_all("$[field].@combinedLabel",", $","") |
| 4 | + if exists("$[field].c") |
| 5 | + paste("$[field].@combinedLabel", "$[field].@combinedLabel", "$[field].c") |
| 6 | + end |
| 7 | + copy_field("$[field].n","$[field].add.$append") |
| 8 | + copy_field("$[field].l","$[field].add.$append") |
| 9 | + copy_field("$[field].g","$[field].add.$append") |
| 10 | + join_field("$[field].add",", ") |
| 11 | + replace_all("$[field].add","^(.*)$"," <$1>") |
| 12 | + if exists("$[field].add") |
| 13 | + paste("$[field].@combinedLabel", "$[field].@combinedLabel", "$[field].add", join_char:"") |
| 14 | + end |
| 15 | + copy_field("$[field].@combinedLabel", "$[out]") |
| 16 | +end |
| 17 | + |
| 18 | +do put_macro("gndCorporationCombinedLabel") # in contrast to morph this is not normalizing utf 8 |
| 19 | + if any_equal("@type","b") |
| 20 | + copy_field("$[field].n","$[field].add.$append") |
| 21 | + copy_field("$[field].l","$[field].add.$append") |
| 22 | + copy_field("$[field].g","$[field].add.$append") |
| 23 | + join_field("$[field].add",", ") |
| 24 | + replace_all("$[field].add","^(.*)$"," <$1>") |
| 25 | + copy_field("$[field].a","$[field].@combinedLabel") |
| 26 | + if exists("$[field].add") |
| 27 | + paste("$[field].@combinedLabel", "$[field].@combinedLabel", "$[field].add", join_char:"") |
| 28 | + end |
| 29 | + if exists("$[field].b") |
| 30 | + paste("$[field].@combinedLabel", "$[field].@combinedLabel", "~ / ", "$[field].b", join_char:"") |
| 31 | + end |
| 32 | + copy_field("$[field].@combinedLabel", "$[out]") |
| 33 | + end |
| 34 | +end |
| 35 | + |
| 36 | +do put_macro("gndConferenceCombinedLabel") # in contrast to morph this is not normalizing utf 8 |
| 37 | + if any_equal("@type","f") |
| 38 | + copy_field("$[field].g","$[field].add.$append") |
| 39 | + copy_field("$[field].n","$[field].add.$append") |
| 40 | + copy_field("$[field].d","$[field].add.$append") |
| 41 | + copy_field("$[field].c","$[field].add.$append") |
| 42 | + join_field("$[field].add",", ") |
| 43 | + replace_all("$[field].add","^(.*)$"," <$1>") |
| 44 | + if exists("$[field].b") |
| 45 | + paste("$[field].@combinedLabel", "$[field].a", "~ / ", "$[field].b", join_char:"") |
| 46 | + else |
| 47 | + copy_field("$[field].a","$[field].@combinedLabel") |
| 48 | + end |
| 49 | + if exists("$[field].add") |
| 50 | + paste("$[field].@combinedLabel", "$[field].@combinedLabel", "$[field].add", join_char:"") |
| 51 | + end |
| 52 | + copy_field("$[field].@combinedLabel", "$[out]") |
| 53 | + end |
| 54 | +end |
| 55 | + |
| 56 | + |
| 57 | +do put_macro("gndGeolocationCombinedLabel") # in contrast to morph this is not normalizing utf 8 |
| 58 | + if any_equal("@type","g") |
| 59 | + copy_field("$[field].z","$[field].add.$append") |
| 60 | + copy_field("$[field].g","$[field].add.$append") |
| 61 | + join_field("$[field].add",", ") |
| 62 | + replace_all("$[field].add","^(.*)$"," <$1>") |
| 63 | + if exists("$[field].b") |
| 64 | + paste("$[field].@combinedLabel", "$[field].a", "~ / ", "$[field].x", join_char:"") |
| 65 | + else |
| 66 | + copy_field("$[field].a","$[field].@combinedLabel") |
| 67 | + end |
| 68 | + if exists("$[field].add") |
| 69 | + paste("$[field].@combinedLabel", "$[field].@combinedLabel", "$[field].add", join_char:"") |
| 70 | + end |
| 71 | + copy_field("$[field].@combinedLabel", "$[out]") |
| 72 | + end |
| 73 | +end |
| 74 | + |
| 75 | +do put_macro("gndSubjectCombinedLabel") # in contrast to morph this is not normalizing utf 8 |
| 76 | + if any_equal("@type","s") |
| 77 | + copy_field("$[field].g","$[field].add.$append") |
| 78 | + join_field("$[field].add",", ") |
| 79 | + replace_all("$[field].add","^(.*)$"," <$1>") |
| 80 | + copy_field("$[field].a","$[field].@combinedLabel") |
| 81 | + if exists("$[field].add") |
| 82 | + paste("$[field].@combinedLabel", "$[field].@combinedLabel", "$[field].add", join_char:"") |
| 83 | + end |
| 84 | + copy_field("$[field].@combinedLabel", "$[out]") |
| 85 | + end |
| 86 | +end |
| 87 | + |
| 88 | +do put_macro("gndWorkCombinedLabel") # in contrast to morph this is not normalizing utf 8 |
| 89 | + if any_equal("@type","u") |
| 90 | + copy_field("$[field].f","$[field].add.$append") |
| 91 | + copy_field("$[field].g","$[field].add.$append") |
| 92 | + copy_field("$[field].n","$[field].add.$append") |
| 93 | + join_field("$[field].add",", ") |
| 94 | + replace_all("$[field].add","^(.*)$"," <$1>") |
| 95 | + if exists("$[field].p") |
| 96 | + paste("$[field].@combinedLabel", "$[field].a", "~ / ", "$[field].p", join_char:"") |
| 97 | + else |
| 98 | + copy_field("$[field].a","$[field].@combinedLabel") |
| 99 | + end |
| 100 | + if exists("$[field].add") |
| 101 | + paste("$[field].@combinedLabel", "$[field].@combinedLabel", "$[field].add", join_char:"") |
| 102 | + end |
| 103 | + copy_field("$[field].@combinedLabel", "$[out]") |
| 104 | + end |
| 105 | +end |
| 106 | + |
| 107 | +copy_field(" [email protected]","@type") |
| 108 | +substring("@type","1","1") |
| 109 | + |
| 110 | +# pn |
| 111 | +do list(path:"028A","var":"PERSONNAME") |
| 112 | + call_macro("gndPersonCombinedLabel",field:"PERSONNAME",out:"@name") |
| 113 | +end |
| 114 | +do list(path:"028@","var":"PERSONNAME") |
| 115 | + call_macro("gndPersonCombinedLabel",field:"PERSONNAME",out:"@syn.$append") |
| 116 | +end |
| 117 | + |
| 118 | +do list(path:"029A","var":"CORPORATIONNAME") |
| 119 | + call_macro("gndCorporationCombinedLabel",field:"CORPORATIONNAME",out:"@name") |
| 120 | +end |
| 121 | +do list(path:"029@","var":"CORPORATIONNAME") |
| 122 | + call_macro("gndCorporationCombinedLabel",field:"CORPORATIONNAME",out:"@syn.$append") |
| 123 | +end |
| 124 | + |
| 125 | +#f |
| 126 | +do list(path:"030A","var":"CONFERENCENAME") |
| 127 | + call_macro("gndConferenceCombinedLabel",field:"CONFERENCENAME",out:"@name") |
| 128 | +end |
| 129 | +do list(path:"030@","var":"CONFERENCENAME") |
| 130 | + call_macro("gndConferenceCombinedLabel",field:"CONFERENCENAME",out:"@syn.$append") |
| 131 | +end |
| 132 | + |
| 133 | +#s |
| 134 | +do list(path:"065A","var":"GEONAME") |
| 135 | + call_macro("gndGeolocationCombinedLabel",field:"GEONAME",out:"@name") |
| 136 | +end |
| 137 | +do list(path:"065@","var":"GEONAME") |
| 138 | + call_macro("gndGeolocationCombinedLabel",field:"GEONAME",out:"@syn.$append") |
| 139 | +end |
| 140 | + |
| 141 | +# g |
| 142 | +do list(path:"041A","var":"SUBJECTNAME") |
| 143 | + call_macro("gndSubjectCombinedLabel",field:"SUBJECTNAME",out:"@name") |
| 144 | +end |
| 145 | +do list(path:"041@","var":"SUBJECTNAME") |
| 146 | + call_macro("gndSubjectCombinedLabel",field:"SUBJECTNAME",out:"@syn.$append") |
| 147 | +end |
| 148 | + |
| 149 | +#u |
| 150 | +do list(path:"022A","var":"WORKNAME") |
| 151 | + call_macro("gndWorkCombinedLabel",field:"WORKNAME",out:"@name") |
| 152 | +end |
| 153 | +do list(path:"022@","var":"WORKNAME") |
| 154 | + call_macro("gndWorkCombinedLabel",field:"WORKNAME",out:"@syn.$append") |
| 155 | +end |
| 156 | + |
| 157 | +# copy_field("008A.a","teilbest") |
| 158 | + |
| 159 | +do list(path:"041A*|041A","var":"$i") # Until https://github.com/metafacture/metafacture-core/issues/651 is fixed one hass to add "041A" |
| 160 | + trim("$i.9") |
| 161 | + to_var("$i.9","ref") |
| 162 | + if exists("$i.9") |
| 163 | + add_field("{to:$[ref]}refed","") |
| 164 | + end |
| 165 | +end |
| 166 | + |
| 167 | +copy_field("@name","gnd.name") |
| 168 | +copy_field(" [email protected]","gnd.katlevel") |
| 169 | +substring("gnd.katlevel","2","1") |
| 170 | +copy_field(" [email protected]","gnd.satzart") |
| 171 | +substring("gnd.satzart","0","2") |
| 172 | + |
| 173 | +# copy_field(" [email protected]","gnd.id") |
| 174 | +copy_field("007K.0","gnd.nid") |
| 175 | +do list(path:"042A", "var":"$i") |
| 176 | + do list(path:"$i.a","var":"$a") |
| 177 | + copy_field("$a","gnd.sys.$append") |
| 178 | + end |
| 179 | +end |
| 180 | +replace_all("gnd.sys.*",";",",") |
| 181 | +join_field("gnd.sys"," | ") |
| 182 | +unless exists("gnd.sys") |
| 183 | + add_field("gnd.sys","") |
| 184 | +end |
| 185 | + |
| 186 | +do list(path:"004B", "var":"$i") |
| 187 | + do list(path:"$i.a","var":"$a") |
| 188 | + copy_field("$a","gnd.ent.$append") |
| 189 | + end |
| 190 | +end |
| 191 | +join_field("gnd.ent"," | ") |
| 192 | +unless exists("gnd.ent") |
| 193 | + add_field("gnd.ent","") |
| 194 | +end |
| 195 | + |
| 196 | + |
| 197 | +copy_field("@syn","gnd.syn") |
| 198 | +join_field("gnd.syn"," | ") |
| 199 | +unless exists("gnd.syn") |
| 200 | + add_field("gnd.syn","") |
| 201 | +end |
| 202 | + |
| 203 | +unless any_match("004B.a", "gib|gio|giw") |
| 204 | + copy_field("004B.a","filter1") |
| 205 | +end |
| 206 | + |
| 207 | +if any_match(" [email protected]", "Ts1|Tg1") |
| 208 | + copy_field(" [email protected]","filter2") |
| 209 | +end |
| 210 | + |
| 211 | +unless exists("037G.c") |
| 212 | + add_field("filter3","ok") |
| 213 | +end |
| 214 | + |
| 215 | + |
| 216 | +retain("{to*","gnd","filter*","@*") |
0 commit comments