{"action":"created","comment":{"url":"https://api.github.com/repos/dpla/audumbla/pulls/comments/32463164","id":32463164,"diff_hunk":"@@ -0,0 +1,203 @@\n+require 'twofishes'\n+require 'geokit'\n+\n+module Audumbla::Enrichments\n+  ##\n+  # Enriches a `DPLA::MAP::Place` node by running its data through external \n+  # geocoders, using heuristics to determine a matching feature from GeoNames,\n+  # and repopulating the `Place` with related data.\n+  #\n+  # If the existing `Place` contains data other than a `providedLabel`, that \n+  # data will be used as context for evaluating interpretations. For example: \n+  # a `Place` with an existing latitude and longitude will verify that the\n+  # point is within the bounding box for a candidate match.\n+  # \n+  # `skos:exactMatch` are reserved for the GeoNames features returned by the \n+  # geocoder. Other matching URIs (currently: LC authorities) are included as\n+  # `skos:closeMatch`\n+  #\n+  # @example enriching from a `#providedLabel`\n+  #   \n+  #    place = DPLA::MAP::Place.new.tap { |p| p.providedLabel = 'Georgia' }\n+  #    CoarseGeocode.new.enrich_value.dump :ttl\n+  #    # [\n+  #    #    a <http://www.europeana.eu/schemas/edm/Place>;\n+  #    #    <http://dp.la/about/map/providedLabel> \"Georgia\";\n+  #    #    <http://www.geonames.org/ontology#countryCode> \"US\";\n+  #    #    <http://www.w3.org/2003/01/geo/wgs84_pos#lat> 3.275042e1;\n+  #    #    <http://www.w3.org/2003/01/geo/wgs84_pos#long> -8.350018e1;\n+  #    #    <http://www.w3.org/2004/02/skos/core#closeMatch> <http://id.loc.gov/authorities/names/n79023113>;\n+  #    #    <http://www.w3.org/2004/02/skos/core#exactMatch> <http://sws.geonames.org/4197000/>;\n+  #    #    <http://www.w3.org/2004/02/skos/core#prefLabel> \"Georgia, United States\"\n+  #    # ] .\n+  #\n+  # @example enriching from a `#providedLabel` with lat/lng guidance\n+  #   \n+  #    place = DPLA::MAP::Place.new.tap do |p| \n+  #      p.providedLabel = 'Georgia'\n+  #      p.lat = 41.9997\n+  #      p.long = 43.4998\n+  #    end\n+  #    \n+  #    CoarseGeocode.new.enrich_value.dump :ttl\n+  #    # [\n+  #    #    a <http://www.europeana.eu/schemas/edm/Place>;\n+  #    #    <http://dp.la/about/map/providedLabel> \"Georgia\";\n+  #    #    <http://www.geonames.org/ontology#countryCode> \"GE\";\n+  #    #    <http://www.w3.org/2003/01/geo/wgs84_pos#lat> 4.199998e1;","path":"lib/audumbla/enrichments/coarse_geocode.rb","position":47,"original_position":47,"commit_id":"be81b76ce0942e597b95a699f15e95eace6ca383","original_commit_id":"be81b76ce0942e597b95a699f15e95eace6ca383","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":"Out of curiosity, what units are these in?","created_at":"2015-06-15T20:31:44Z","updated_at":"2015-06-15T20:31:44Z","html_url":"https://github.com/dpla/audumbla/pull/2#discussion_r32463164","pull_request_url":"https://api.github.com/repos/dpla/audumbla/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/dpla/audumbla/pulls/comments/32463164"},"html":{"href":"https://github.com/dpla/audumbla/pull/2#discussion_r32463164"},"pull_request":{"href":"https://api.github.com/repos/dpla/audumbla/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/dpla/audumbla/pulls/2","id":37602310,"html_url":"https://github.com/dpla/audumbla/pull/2","diff_url":"https://github.com/dpla/audumbla/pull/2.diff","patch_url":"https://github.com/dpla/audumbla/pull/2.patch","issue_url":"https://api.github.com/repos/dpla/audumbla/issues/2","number":2,"state":"open","locked":false,"title":"Add geocoding enrichment","user":{"login":"no-reply","id":1361776,"avatar_url":"https://avatars.githubusercontent.com/u/1361776?v=3","gravatar_id":"","url":"https://api.github.com/users/no-reply","html_url":"https://github.com/no-reply","followers_url":"https://api.github.com/users/no-reply/followers","following_url":"https://api.github.com/users/no-reply/following{/other_user}","gists_url":"https://api.github.com/users/no-reply/gists{/gist_id}","starred_url":"https://api.github.com/users/no-reply/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/no-reply/subscriptions","organizations_url":"https://api.github.com/users/no-reply/orgs","repos_url":"https://api.github.com/users/no-reply/repos","events_url":"https://api.github.com/users/no-reply/events{/privacy}","received_events_url":"https://api.github.com/users/no-reply/received_events","type":"User","site_admin":false},"body":"This has two remaining requirements before it's ready to go:\r\n\r\n  - The test suite does not currently run independently. It requires a running twofishes. I think the best approach is to stub out all the web requests. Webmock is installed for this purpose, but not currently working.\r\n  - We need Automation tasks to get twofishes up in production; and possibly we need to do more work to plan where we will host similar external services for other enrichments.\r\n\r\nNote also the changes from: https://github.com/dpla/audumbla/compare/feature/geocode?expand=1#diff-bd0c51c8d1d7aa8175be83499a22f6c5R46\r\n\r\nI'm not sure why this enrichment runs up against this bug, but if we can resolve it, we should.","created_at":"2015-06-12T20:42:32Z","updated_at":"2015-06-15T20:31:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fa48a48056b8cf3caa43560a8ff1aedaed661ec9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dpla/audumbla/pulls/2/commits","review_comments_url":"https://api.github.com/repos/dpla/audumbla/pulls/2/comments","review_comment_url":"https://api.github.com/repos/dpla/audumbla/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dpla/audumbla/issues/2/comments","statuses_url":"https://api.github.com/repos/dpla/audumbla/statuses/be81b76ce0942e597b95a699f15e95eace6ca383","head":{"label":"dpla:feature/geocode","ref":"feature/geocode","sha":"be81b76ce0942e597b95a699f15e95eace6ca383","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":36449510,"name":"audumbla","full_name":"dpla/audumbla","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/audumbla","description":"A toolkit for metadata enrichment in ActiveTriples","fork":false,"url":"https://api.github.com/repos/dpla/audumbla","forks_url":"https://api.github.com/repos/dpla/audumbla/forks","keys_url":"https://api.github.com/repos/dpla/audumbla/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dpla/audumbla/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dpla/audumbla/teams","hooks_url":"https://api.github.com/repos/dpla/audumbla/hooks","issue_events_url":"https://api.github.com/repos/dpla/audumbla/issues/events{/number}","events_url":"https://api.github.com/repos/dpla/audumbla/events","assignees_url":"https://api.github.com/repos/dpla/audumbla/assignees{/user}","branches_url":"https://api.github.com/repos/dpla/audumbla/branches{/branch}","tags_url":"https://api.github.com/repos/dpla/audumbla/tags","blobs_url":"https://api.github.com/repos/dpla/audumbla/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dpla/audumbla/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dpla/audumbla/git/refs{/sha}","trees_url":"https://api.github.com/repos/dpla/audumbla/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dpla/audumbla/statuses/{sha}","languages_url":"https://api.github.com/repos/dpla/audumbla/languages","stargazers_url":"https://api.github.com/repos/dpla/audumbla/stargazers","contributors_url":"https://api.github.com/repos/dpla/audumbla/contributors","subscribers_url":"https://api.github.com/repos/dpla/audumbla/subscribers","subscription_url":"https://api.github.com/repos/dpla/audumbla/subscription","commits_url":"https://api.github.com/repos/dpla/audumbla/commits{/sha}","git_commits_url":"https://api.github.com/repos/dpla/audumbla/git/commits{/sha}","comments_url":"https://api.github.com/repos/dpla/audumbla/comments{/number}","issue_comment_url":"https://api.github.com/repos/dpla/audumbla/issues/comments{/number}","contents_url":"https://api.github.com/repos/dpla/audumbla/contents/{+path}","compare_url":"https://api.github.com/repos/dpla/audumbla/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dpla/audumbla/merges","archive_url":"https://api.github.com/repos/dpla/audumbla/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dpla/audumbla/downloads","issues_url":"https://api.github.com/repos/dpla/audumbla/issues{/number}","pulls_url":"https://api.github.com/repos/dpla/audumbla/pulls{/number}","milestones_url":"https://api.github.com/repos/dpla/audumbla/milestones{/number}","notifications_url":"https://api.github.com/repos/dpla/audumbla/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dpla/audumbla/labels{/name}","releases_url":"https://api.github.com/repos/dpla/audumbla/releases{/id}","created_at":"2015-05-28T15:54:08Z","updated_at":"2015-05-28T21:02:35Z","pushed_at":"2015-06-12T20:53:56Z","git_url":"git://github.com/dpla/audumbla.git","ssh_url":"git@github.com:dpla/audumbla.git","clone_url":"https://github.com/dpla/audumbla.git","svn_url":"https://github.com/dpla/audumbla","homepage":null,"size":208,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"develop"}},"base":{"label":"dpla:develop","ref":"develop","sha":"af220bf65faba0f5cf083e1b5941e0706583d88c","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":36449510,"name":"audumbla","full_name":"dpla/audumbla","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/audumbla","description":"A toolkit for metadata enrichment in ActiveTriples","fork":false,"url":"https://api.github.com/repos/dpla/audumbla","forks_url":"https://api.github.com/repos/dpla/audumbla/forks","keys_url":"https://api.github.com/repos/dpla/audumbla/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dpla/audumbla/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dpla/audumbla/teams","hooks_url":"https://api.github.com/repos/dpla/audumbla/hooks","issue_events_url":"https://api.github.com/repos/dpla/audumbla/issues/events{/number}","events_url":"https://api.github.com/repos/dpla/audumbla/events","assignees_url":"https://api.github.com/repos/dpla/audumbla/assignees{/user}","branches_url":"https://api.github.com/repos/dpla/audumbla/branches{/branch}","tags_url":"https://api.github.com/repos/dpla/audumbla/tags","blobs_url":"https://api.github.com/repos/dpla/audumbla/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dpla/audumbla/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dpla/audumbla/git/refs{/sha}","trees_url":"https://api.github.com/repos/dpla/audumbla/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dpla/audumbla/statuses/{sha}","languages_url":"https://api.github.com/repos/dpla/audumbla/languages","stargazers_url":"https://api.github.com/repos/dpla/audumbla/stargazers","contributors_url":"https://api.github.com/repos/dpla/audumbla/contributors","subscribers_url":"https://api.github.com/repos/dpla/audumbla/subscribers","subscription_url":"https://api.github.com/repos/dpla/audumbla/subscription","commits_url":"https://api.github.com/repos/dpla/audumbla/commits{/sha}","git_commits_url":"https://api.github.com/repos/dpla/audumbla/git/commits{/sha}","comments_url":"https://api.github.com/repos/dpla/audumbla/comments{/number}","issue_comment_url":"https://api.github.com/repos/dpla/audumbla/issues/comments{/number}","contents_url":"https://api.github.com/repos/dpla/audumbla/contents/{+path}","compare_url":"https://api.github.com/repos/dpla/audumbla/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dpla/audumbla/merges","archive_url":"https://api.github.com/repos/dpla/audumbla/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dpla/audumbla/downloads","issues_url":"https://api.github.com/repos/dpla/audumbla/issues{/number}","pulls_url":"https://api.github.com/repos/dpla/audumbla/pulls{/number}","milestones_url":"https://api.github.com/repos/dpla/audumbla/milestones{/number}","notifications_url":"https://api.github.com/repos/dpla/audumbla/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dpla/audumbla/labels{/name}","releases_url":"https://api.github.com/repos/dpla/audumbla/releases{/id}","created_at":"2015-05-28T15:54:08Z","updated_at":"2015-05-28T21:02:35Z","pushed_at":"2015-06-12T20:53:56Z","git_url":"git://github.com/dpla/audumbla.git","ssh_url":"git@github.com:dpla/audumbla.git","clone_url":"https://github.com/dpla/audumbla.git","svn_url":"https://github.com/dpla/audumbla","homepage":null,"size":208,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/dpla/audumbla/pulls/2"},"html":{"href":"https://github.com/dpla/audumbla/pull/2"},"issue":{"href":"https://api.github.com/repos/dpla/audumbla/issues/2"},"comments":{"href":"https://api.github.com/repos/dpla/audumbla/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/dpla/audumbla/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/dpla/audumbla/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dpla/audumbla/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/dpla/audumbla/statuses/be81b76ce0942e597b95a699f15e95eace6ca383"}}}}