Wow, I didn’t realize I could do that!
This could be exactly what I need for this specific problem.
Forgive this dumb question, but would this pattern.map also exist in marc_local.properties or maintained separately?
I am in the middle of working on Todd’s suggestion, but I am sure I’ll use both suggestions for the various fields that I have to tinker with.
For question 1, you could use a pattern-based translation map, which allows regular-expression based pattern matching. The following example is one that we use for mapping the contents of the 245h field to a more normalized form.
medium_display = 245h, (pattern_map.medium), first
pattern_map.medium.pattern_0 = [Ss]ound[ ]+recording=>sound recording
pattern_map.medium.pattern_1 = [Vv]ideo[-]?recording=>videorecording
pattern_map.medium.pattern_2 = [Ee]lectronic book=>electronic book
pattern_map.medium.pattern_3 = [Ee]lectronic [a-z]*=>electronic resource
pattern_map.medium.pattern_4 = [Mm]icro(form|film|fiche)=>microform
pattern_map.medium.pattern_5 = [Mm]icrofiche=>microform
pattern_map.medium.pattern_6 = [Ss]lide=>slide
pattern_map.medium.pattern_7 = CD=>sound recording
pattern_map.medium.pattern_8 = DVD=>videorecording
pattern_map.medium.pattern_9 = [Cc]omputer[ ]*file=>computer file
pattern_map.medium.pattern_10 = [Mm]anuscript=>manuscript
pattern_map.medium.pattern_11 = [Pp]icture=>picture
pattern_map.medium.pattern_12 = \b[Gg]raphic\b=>graphic
pattern_map.medium.pattern_13 = [Mm]ap=>cartographic material
pattern_map.medium.pattern_13 = [Cc]artographic material=>cartographic material
pattern_map.medium.pattern_14 = [Ss]eries record=>series record
pattern_map.medium.pattern_15 = [Mm]otion picture=>motion picture
pattern_map.medium.pattern_16 = [Aa]rt reproduction=>art reproduction
pattern_map.medium.pattern_17 = [Aa]rt original=>art original
pattern_map.medium.pattern_18 = [Mm]otion picture=>motion picture
pattern_map.medium.pattern_19 = ^([Cc]hart|[Kk]it|[Bb]raille|[Rr]ealia|[Gg]ame|[Ee]quipment|[Ff]ilmstrip|[Ww]ebsite|[Tt]ransparency|[Mm]odel)$=>$1
For question 2 if you change the specification to be like this, I think it will work:
format2 = 521a:300e, format2_map.properties, first
On 6/18/2014 11:21 AM, Tod Olson wrote:
Yes, either focus on the bash scripts for what you want to do, or if you’re comfortable with Java you can do a mixin.
If you want to do the bash script, pick apart this line from import/marc_local.properties:
dewey-hundreds = script(dewey.bsh), getDeweyNumber(082a:083a, 100), ddc22_map.properties(hundreds)
That names the script file to load, the function in the script file to invoke, and the translation map. getDeweyNumber() should show you how to process the tag string to pick up the fields you want.
On Jun 18, 2014, at 8:39 AM, Shepard, Thomas - 1150 - MITLL <firstname.lastname@example.org> wrote:
I have a couple of follow-up questions to my March 2014 post (which I should add has been resolved by escaping those pesky periods).
1. I want to create a new translation_map but it appear that the original values (left column) must be single strings/words without spaces. I would like vufind to be able to take a character string with spaces and punctuation and change it to a uniform lookup value. I suppose the real solution is to copy and edit one of those bash scripts found in index_scripts, but I was hoping to take this problem down an easier road. I tried using quotes but those didn’t work.
2. In my marc_local.properties, I have attempted in various ways to set up two marc fields to share the same translation_map.
To be specific, I want 521a and 300e to share format2_map.properties.
format2 = 521a, format2_map.properties, first works just fine but none of the following variations do:
format2 = 521a, format2_map.properties, first:300e, format2_map.properties, first
format2 = 521a, format2_map.properties, first:300e, format2_map.properties
This also works;
format2 = 521a:300e
to give me the raw values from those fields, but of course does nothing to normalize those values.
So… should I focus on editing one of those bash scripts to get what I want?
I’m copying the solrmarc-tech list in case anyone there has more specific insights.
I’m guessing that the problem here is that periods have a special meaning in the property map, because you can use them to create named maps. You might want to try escaping them with backslashes to see if that helps.
If you remove all of the values from your map that contain dots, do you at least see the other values coming through? I would expect so – I see no other obvious problems with your map or properties configuration. If even a stripped-down map is failing, perhaps there is some other problematic detail that I am failing to spot right now.
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
VuFind-General mailing list
You received this message because you are subscribed to the Google Groups "solrmarc-tech" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
To post to this group, send email to firstname.lastname@example.org.
Visit this group at http://groups.google.com/group/solrmarc-tech.
For more options, visit https://groups.google.com/d/optout.