{"action":"created","comment":{"url":"https://api.github.com/repos/dpla/heidrun-mappings/pulls/comments/34503766","id":34503766,"diff_hunk":"@@ -0,0 +1,98 @@\n+Krikri::Mapper.define(:ncdhc, :parser => Krikri::ModsParser) do\n+  provider :class => DPLA::MAP::Agent do\n+    uri 'http://dp.la/api/contributor/ncdhc'\n+    label 'North Carolina Digital Heritage Center'\n+  end\n+\n+  dataProvider :class => DPLA::MAP::Agent do\n+    providedLabel record.field('mods:note').match_attribute(:type, 'ownership')\n+  end\n+\n+  isShownAt :class => DPLA::MAP::WebResource do\n+    uri record.field('mods:location', 'mods:url')\n+    \t.match_attribute(:usage, 'primary display')\n+    \t.match_attribute(:access, 'object in context')\n+  end\n+\n+  preview :class => DPLA::MAP::WebResource do\n+    uri record.field('mods:location', 'mods:url')\n+    \t.match_attribute(:access, 'preview')\n+  end\n+\n+  originalRecord :class => DPLA::MAP::WebResource do\n+    uri record_uri\n+  end\n+\n+  sourceResource :class => DPLA::MAP::SourceResource do\n+  \t  \n+    collection :class => DPLA::MAP::Collection, \n+    \t\t   \t\t :each => header.field('xmlns:set_spec'), \n+    \t\t   \t\t :as => :coll do\n+      title coll\n+    end\n+\n+    contributor :class => DPLA::MAP::Agent, \n+    \t\t  \t\t  :each => record.field('mods:name')\n+    \t\t  \t\t  .select { |name| name['mods:role'].map(&:value).include?('contributor') }, \n+    \t\t  \t\t  :as => :contrib do\n+      providedLabel contrib.field('mods:namePart')\n+    end\n+\n+    creator :class => DPLA::MAP::Agent, \n+    \t\t:each => record.field('mods:name')\n+    \t\t.select { |name| name['mods:role'].map(&:value).include?('creator') }, \n+    \t\t:as => :creator_role do\n+      providedLabel creator_role.field('mods:namePart')\n+    end\n+\n+    date :class => DPLA::MAP::TimeSpan, \n+    \t\t :each => record.field('mods:originInfo'), \n+    \t\t :as => :created do\n+      providedLabel created.field('mods:dateCreated').match_attribute(:keyDate, 'yes')\n+      self.begin created.field('mods:dateCreated').first_value\n+      self.end created.field('mods:dateCreated').last_value\n+    end\n+\n+    description record.field('mods:note').match_attribute(:type, 'content')\n+\n+    dcformat record.field('mods:physicalDescription', 'mods:form')\n+    \n+    genre record.field('mods:physicalDescription', 'mods:form')\n+\n+    identifier record.field('mods:identifier')\n+\n+    language :class => DPLA::MAP::Controlled::Language, \n+    \t\t\t\t :each => record.field('mods:language', 'mods:languageTerm'), \n+    \t\t\t\t :as => :lang do\n+      providedLabel lang\n+    end\n+\n+    spatial :class => DPLA::MAP::Place, \n+    \t      :each => record.field('mods:subject'), \n+    \t      :as => :place do\n+      providedLabel place.field('mods:geographic')\n+    end\n+\n+    publisher :class => DPLA::MAP::Agent, \n+    \t\t\t\t\t:each => record.field('mods:originInfo'), \n+    \t\t\t\t\t:as => :publisher do\n+      providedLabel publisher.field('mods:publisher')\n+    end\n+    \n+    relation record.field('mods:reltedItem')","path":"heidrun/ncdhc.rb","position":82,"original_position":82,"commit_id":"e7a0d9cc28a5e6455d9645009b967ca8211adcb5","original_commit_id":"e7a0d9cc28a5e6455d9645009b967ca8211adcb5","user":{"login":"anarchivist","id":73732,"avatar_url":"https://avatars.githubusercontent.com/u/73732?v=3","gravatar_id":"","url":"https://api.github.com/users/anarchivist","html_url":"https://github.com/anarchivist","followers_url":"https://api.github.com/users/anarchivist/followers","following_url":"https://api.github.com/users/anarchivist/following{/other_user}","gists_url":"https://api.github.com/users/anarchivist/gists{/gist_id}","starred_url":"https://api.github.com/users/anarchivist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anarchivist/subscriptions","organizations_url":"https://api.github.com/users/anarchivist/orgs","repos_url":"https://api.github.com/users/anarchivist/repos","events_url":"https://api.github.com/users/anarchivist/events{/privacy}","received_events_url":"https://api.github.com/users/anarchivist/received_events","type":"User","site_admin":false},"body":"I think this and the next few lines should be:\r\n\r\n```ruby\r\nrelation record.field('mods:relatedItem').fields(['mods:location', 'mods:url'], ['mods:titleInfo', 'mods:title'])\r\n```\r\n\r\ncc @no-reply ","created_at":"2015-07-13T19:51:51Z","updated_at":"2015-07-13T19:51:51Z","html_url":"https://github.com/dpla/heidrun-mappings/pull/20#discussion_r34503766","pull_request_url":"https://api.github.com/repos/dpla/heidrun-mappings/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/dpla/heidrun-mappings/pulls/comments/34503766"},"html":{"href":"https://github.com/dpla/heidrun-mappings/pull/20#discussion_r34503766"},"pull_request":{"href":"https://api.github.com/repos/dpla/heidrun-mappings/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/dpla/heidrun-mappings/pulls/20","id":39707072,"html_url":"https://github.com/dpla/heidrun-mappings/pull/20","diff_url":"https://github.com/dpla/heidrun-mappings/pull/20.diff","patch_url":"https://github.com/dpla/heidrun-mappings/pull/20.patch","issue_url":"https://api.github.com/repos/dpla/heidrun-mappings/issues/20","number":20,"state":"open","locked":false,"title":"NCDHC mapping","user":{"login":"guegueng","id":10745028,"avatar_url":"https://avatars.githubusercontent.com/u/10745028?v=3","gravatar_id":"","url":"https://api.github.com/users/guegueng","html_url":"https://github.com/guegueng","followers_url":"https://api.github.com/users/guegueng/followers","following_url":"https://api.github.com/users/guegueng/following{/other_user}","gists_url":"https://api.github.com/users/guegueng/gists{/gist_id}","starred_url":"https://api.github.com/users/guegueng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guegueng/subscriptions","organizations_url":"https://api.github.com/users/guegueng/orgs","repos_url":"https://api.github.com/users/guegueng/repos","events_url":"https://api.github.com/users/guegueng/events{/privacy}","received_events_url":"https://api.github.com/users/guegueng/received_events","type":"User","site_admin":false},"body":"second attempt at NCDHC mapping. Someone should pay particular attention to the date mapping as I’m not confident it’s done correctly.","created_at":"2015-07-10T17:42:37Z","updated_at":"2015-07-13T19:51:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cca8ae83e513d213569f903a208c68c56ba82f76","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dpla/heidrun-mappings/pulls/20/commits","review_comments_url":"https://api.github.com/repos/dpla/heidrun-mappings/pulls/20/comments","review_comment_url":"https://api.github.com/repos/dpla/heidrun-mappings/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dpla/heidrun-mappings/issues/20/comments","statuses_url":"https://api.github.com/repos/dpla/heidrun-mappings/statuses/e7a0d9cc28a5e6455d9645009b967ca8211adcb5","head":{"label":"dpla:feature/NCDHC2","ref":"feature/NCDHC2","sha":"e7a0d9cc28a5e6455d9645009b967ca8211adcb5","user":{"login":"dpla","id":1252916,"avatar_url":"https://avatars.githubusercontent.com/u/1252916?v=3","gravatar_id":"","url":"https://api.github.com/users/dpla","html_url":"https://github.com/dpla","followers_url":"https://api.github.com/users/dpla/followers","following_url":"https://api.github.com/users/dpla/following{/other_user}","gists_url":"https://api.github.com/users/dpla/gists{/gist_id}","starred_url":"https://api.github.com/users/dpla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpla/subscriptions","organizations_url":"https://api.github.com/users/dpla/orgs","repos_url":"https://api.github.com/users/dpla/repos","events_url":"https://api.github.com/users/dpla/events{/privacy}","received_events_url":"https://api.github.com/users/dpla/received_events","type":"Organization","site_admin":false},"repo":{"id":31089468,"name":"heidrun-mappings","full_name":"dpla/heidrun-mappings","owner":{"login":"dpla","id":1252916,"avatar_url":"https://avatars.githubusercontent.com/u/1252916?v=3","gravatar_id":"","url":"https://api.github.com/users/dpla","html_url":"https://github.com/dpla","followers_url":"https://api.github.com/users/dpla/followers","following_url":"https://api.github.com/users/dpla/following{/other_user}","gists_url":"https://api.github.com/users/dpla/gists{/gist_id}","starred_url":"https://api.github.com/users/dpla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpla/subscriptions","organizations_url":"https://api.github.com/users/dpla/orgs","repos_url":"https://api.github.com/users/dpla/repos","events_url":"https://api.github.com/users/dpla/events{/privacy}","received_events_url":"https://api.github.com/users/dpla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dpla/heidrun-mappings","description":"Metadata mappings for the DPLA Heidrun deployment","fork":false,"url":"https://api.github.com/repos/dpla/heidrun-mappings","forks_url":"https://api.github.com/repos/dpla/heidrun-mappings/forks","keys_url":"https://api.github.com/repos/dpla/heidrun-mappings/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dpla/heidrun-mappings/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dpla/heidrun-mappings/teams","hooks_url":"https://api.github.com/repos/dpla/heidrun-mappings/hooks","issue_events_url":"https://api.github.com/repos/dpla/heidrun-mappings/issues/events{/number}","events_url":"https://api.github.com/repos/dpla/heidrun-mappings/events","assignees_url":"https://api.github.com/repos/dpla/heidrun-mappings/assignees{/user}","branches_url":"https://api.github.com/repos/dpla/heidrun-mappings/branches{/branch}","tags_url":"https://api.github.com/repos/dpla/heidrun-mappings/tags","blobs_url":"https://api.github.com/repos/dpla/heidrun-mappings/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dpla/heidrun-mappings/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dpla/heidrun-mappings/git/refs{/sha}","trees_url":"https://api.github.com/repos/dpla/heidrun-mappings/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dpla/heidrun-mappings/statuses/{sha}","languages_url":"https://api.github.com/repos/dpla/heidrun-mappings/languages","stargazers_url":"https://api.github.com/repos/dpla/heidrun-mappings/stargazers","contributors_url":"https://api.github.com/repos/dpla/heidrun-mappings/contributors","subscribers_url":"https://api.github.com/repos/dpla/heidrun-mappings/subscribers","subscription_url":"https://api.github.com/repos/dpla/heidrun-mappings/subscription","commits_url":"https://api.github.com/repos/dpla/heidrun-mappings/commits{/sha}","git_commits_url":"https://api.github.com/repos/dpla/heidrun-mappings/git/commits{/sha}","comments_url":"https://api.github.com/repos/dpla/heidrun-mappings/comments{/number}","issue_comment_url":"https://api.github.com/repos/dpla/heidrun-mappings/issues/comments{/number}","contents_url":"https://api.github.com/repos/dpla/heidrun-mappings/contents/{+path}","compare_url":"https://api.github.com/repos/dpla/heidrun-mappings/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dpla/heidrun-mappings/merges","archive_url":"https://api.github.com/repos/dpla/heidrun-mappings/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dpla/heidrun-mappings/downloads","issues_url":"https://api.github.com/repos/dpla/heidrun-mappings/issues{/number}","pulls_url":"https://api.github.com/repos/dpla/heidrun-mappings/pulls{/number}","milestones_url":"https://api.github.com/repos/dpla/heidrun-mappings/milestones{/number}","notifications_url":"https://api.github.com/repos/dpla/heidrun-mappings/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dpla/heidrun-mappings/labels{/name}","releases_url":"https://api.github.com/repos/dpla/heidrun-mappings/releases{/id}","created_at":"2015-02-20T23:03:12Z","updated_at":"2015-07-08T13:56:06Z","pushed_at":"2015-07-10T17:54:09Z","git_url":"git://github.com/dpla/heidrun-mappings.git","ssh_url":"git@github.com:dpla/heidrun-mappings.git","clone_url":"https://github.com/dpla/heidrun-mappings.git","svn_url":"https://github.com/dpla/heidrun-mappings","homepage":"https://github.com/dpla/heidrun","size":468,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"dpla:master","ref":"master","sha":"9da93c3795aef9af37af1f2b5e80e7584e18e03b","user":{"login":"dpla","id":1252916,"avatar_url":"https://avatars.githubusercontent.com/u/1252916?v=3","gravatar_id":"","url":"https://api.github.com/users/dpla","html_url":"https://github.com/dpla","followers_url":"https://api.github.com/users/dpla/followers","following_url":"https://api.github.com/users/dpla/following{/other_user}","gists_url":"https://api.github.com/users/dpla/gists{/gist_id}","starred_url":"https://api.github.com/users/dpla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpla/subscriptions","organizations_url":"https://api.github.com/users/dpla/orgs","repos_url":"https://api.github.com/users/dpla/repos","events_url":"https://api.github.com/users/dpla/events{/privacy}","received_events_url":"https://api.github.com/users/dpla/received_events","type":"Organization","site_admin":false},"repo":{"id":31089468,"name":"heidrun-mappings","full_name":"dpla/heidrun-mappings","owner":{"login":"dpla","id":1252916,"avatar_url":"https://avatars.githubusercontent.com/u/1252916?v=3","gravatar_id":"","url":"https://api.github.com/users/dpla","html_url":"https://github.com/dpla","followers_url":"https://api.github.com/users/dpla/followers","following_url":"https://api.github.com/users/dpla/following{/other_user}","gists_url":"https://api.github.com/users/dpla/gists{/gist_id}","starred_url":"https://api.github.com/users/dpla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpla/subscriptions","organizations_url":"https://api.github.com/users/dpla/orgs","repos_url":"https://api.github.com/users/dpla/repos","events_url":"https://api.github.com/users/dpla/events{/privacy}","received_events_url":"https://api.github.com/users/dpla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dpla/heidrun-mappings","description":"Metadata mappings for the DPLA Heidrun deployment","fork":false,"url":"https://api.github.com/repos/dpla/heidrun-mappings","forks_url":"https://api.github.com/repos/dpla/heidrun-mappings/forks","keys_url":"https://api.github.com/repos/dpla/heidrun-mappings/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dpla/heidrun-mappings/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dpla/heidrun-mappings/teams","hooks_url":"https://api.github.com/repos/dpla/heidrun-mappings/hooks","issue_events_url":"https://api.github.com/repos/dpla/heidrun-mappings/issues/events{/number}","events_url":"https://api.github.com/repos/dpla/heidrun-mappings/events","assignees_url":"https://api.github.com/repos/dpla/heidrun-mappings/assignees{/user}","branches_url":"https://api.github.com/repos/dpla/heidrun-mappings/branches{/branch}","tags_url":"https://api.github.com/repos/dpla/heidrun-mappings/tags","blobs_url":"https://api.github.com/repos/dpla/heidrun-mappings/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dpla/heidrun-mappings/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dpla/heidrun-mappings/git/refs{/sha}","trees_url":"https://api.github.com/repos/dpla/heidrun-mappings/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dpla/heidrun-mappings/statuses/{sha}","languages_url":"https://api.github.com/repos/dpla/heidrun-mappings/languages","stargazers_url":"https://api.github.com/repos/dpla/heidrun-mappings/stargazers","contributors_url":"https://api.github.com/repos/dpla/heidrun-mappings/contributors","subscribers_url":"https://api.github.com/repos/dpla/heidrun-mappings/subscribers","subscription_url":"https://api.github.com/repos/dpla/heidrun-mappings/subscription","commits_url":"https://api.github.com/repos/dpla/heidrun-mappings/commits{/sha}","git_commits_url":"https://api.github.com/repos/dpla/heidrun-mappings/git/commits{/sha}","comments_url":"https://api.github.com/repos/dpla/heidrun-mappings/comments{/number}","issue_comment_url":"https://api.github.com/repos/dpla/heidrun-mappings/issues/comments{/number}","contents_url":"https://api.github.com/repos/dpla/heidrun-mappings/contents/{+path}","compare_url":"https://api.github.com/repos/dpla/heidrun-mappings/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dpla/heidrun-mappings/merges","archive_url":"https://api.github.com/repos/dpla/heidrun-mappings/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dpla/heidrun-mappings/downloads","issues_url":"https://api.github.com/repos/dpla/heidrun-mappings/issues{/number}","pulls_url":"https://api.github.com/repos/dpla/heidrun-mappings/pulls{/number}","milestones_url":"https://api.github.com/repos/dpla/heidrun-mappings/milestones{/number}","notifications_url":"https://api.github.com/repos/dpla/heidrun-mappings/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dpla/heidrun-mappings/labels{/name}","releases_url":"https://api.github.com/repos/dpla/heidrun-mappings/releases{/id}","created_at":"2015-02-20T23:03:12Z","updated_at":"2015-07-08T13:56:06Z","pushed_at":"2015-07-10T17:54:09Z","git_url":"git://github.com/dpla/heidrun-mappings.git","ssh_url":"git@github.com:dpla/heidrun-mappings.git","clone_url":"https://github.com/dpla/heidrun-mappings.git","svn_url":"https://github.com/dpla/heidrun-mappings","homepage":"https://github.com/dpla/heidrun","size":468,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dpla/heidrun-mappings/pulls/20"},"html":{"href":"https://github.com/dpla/heidrun-mappings/pull/20"},"issue":{"href":"https://api.github.com/repos/dpla/heidrun-mappings/issues/20"},"comments":{"href":"https://api.github.com/repos/dpla/heidrun-mappings/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/dpla/heidrun-mappings/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/dpla/heidrun-mappings/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dpla/heidrun-mappings/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/dpla/heidrun-mappings/statuses/e7a0d9cc28a5e6455d9645009b967ca8211adcb5"}}}}