NYULibraries/ichabod — pull request #103 by eshadatta (2014-11-19 14:34:12+00:00)
Title: Feature/iso language code map

@NYULibraries/hydra,

Creating initial PR for this use case: https://www.pivotaltracker.com/s/projects/1025368/stories/80297254. It works but I have a few questions.

1. I am currently directly mapping ISO English code of language to the language attribute in NYUCore. So, it erases the canonical value of the language. I'm not a big fan of this. I don't see a way to store both right now unless I'm mistaken. Does anyone have any other recommendations or should we keep this question for another use case? Is this a question for @chrpr, @ckassel or @dlovins? The code to do this is at the resource set level here: lib/ichabod/resource_set/resource.rb. I wanted to keep it in a generic place rather than call it at every specific resource set. If anyone believes it should be moved elsewhere, please let me know.

2. I am calling the mapping function in the object initialize method. Should I move the call to the to_nyucore function in resource.rb? As I think about it more, I believe I should because of point 3.

3. I see language can occur multiple times in the nyucore model. Right now, in the FDA stern dataset, I noticed that there are arrays in this form: ["en_US","English"]. I am not handling this very well right now(just sending the first value) but will tweak the code to handle arrays. I am ignoring whatever doesn't match the iso code as per the use case requirements. I would need to send two(or more depending on the size of the array and how many correct values it matches against the iso gem) language,value pairs to the attribute hash that is being sent to nyucore.

4. Do I need a cucumber test for this?