Last change
on this file since 38744 was 38744, checked in by davidb, 3 months ago |
Example file to help digital librarians work with the metadata mapping rule format
|
File size:
1.0 KB
|
Line | |
---|
1 | # Each line of the metadata_mapping_rules tab-separated value file must consist of 5 entries
|
---|
2 |
|
---|
3 | # 1. Source metadata name to use
|
---|
4 | # This must start with either 's/...' or 'm/...'
|
---|
5 | # 's' means the line is a substitution rule, which is always aplied to generate the desintation metadata name+value
|
---|
6 | # 'm' means the line must match the regular expression before the rule is applied to generate the desintation metadata name+value
|
---|
7 |
|
---|
8 | # 2. Source Regex it needs to match
|
---|
9 | # 3. Destination Regex substitution
|
---|
10 | # 4. Regex modifiers (e.g. 'i' of case-insensitive, 'g' for global)
|
---|
11 | # 5. Destination metadata name to set with the modified value
|
---|
12 |
|
---|
13 | Source, s/\.\w+$/, // , '' , _transientSourceTitle1 # removes filename extension from end
|
---|
14 | _transientSourceTitle1, s/([A-Z][a-z]+)(?=[A-Z])/, /$1 /, 'g', _transientSourceTitle2 # break up CamelCase
|
---|
15 | _transientSourceTitle2, s/(_|-)+/, / /, 'g', ex.SourceTitle # reduce sequences of underscores and/or hyphens to a single space per sequence
|
---|
16 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.