{"action":"created","comment":{"url":"https://api.github.com/repos/everypolitician/legislative-explorer/pulls/comments/168093792","pull_request_review_id":96403619,"id":168093792,"diff_hunk":"@@ -39,5 +39,9 @@ def sparql\n     def division_results\n       @res ||= Sparql.new(sparql).results\n     end\n+\n+    def legislatures(place_id)\n+      division_results.select { |r| r[:item] == place_id }.map { |i| i[:legislature] }.uniq","path":"lib/query/country_divisions.rb","position":26,"original_position":26,"commit_id":"e4babe151ddd29ebe2b41d446cbaa41b4ed18a46","original_commit_id":"e4babe151ddd29ebe2b41d446cbaa41b4ed18a46","user":{"login":"tmtmtmtm","id":57483,"avatar_url":"https://avatars2.githubusercontent.com/u/57483?v=4","gravatar_id":"","url":"https://api.github.com/users/tmtmtmtm","html_url":"https://github.com/tmtmtmtm","followers_url":"https://api.github.com/users/tmtmtmtm/followers","following_url":"https://api.github.com/users/tmtmtmtm/following{/other_user}","gists_url":"https://api.github.com/users/tmtmtmtm/gists{/gist_id}","starred_url":"https://api.github.com/users/tmtmtmtm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmtmtmtm/subscriptions","organizations_url":"https://api.github.com/users/tmtmtmtm/orgs","repos_url":"https://api.github.com/users/tmtmtmtm/repos","events_url":"https://api.github.com/users/tmtmtmtm/events{/privacy}","received_events_url":"https://api.github.com/users/tmtmtmtm/received_events","type":"User","site_admin":false},"body":"Is the `.uniq` at the end of this needed? I can't quite figure out when/why it is, and the tests pass without it, so if there _is_ a scenario where it's important, I think we need a new test.","created_at":"2018-02-14T07:28:49Z","updated_at":"2018-02-14T07:53:48Z","html_url":"https://github.com/everypolitician/legislative-explorer/pull/23#discussion_r168093792","pull_request_url":"https://api.github.com/repos/everypolitician/legislative-explorer/pulls/23","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/everypolitician/legislative-explorer/pulls/comments/168093792"},"html":{"href":"https://github.com/everypolitician/legislative-explorer/pull/23#discussion_r168093792"},"pull_request":{"href":"https://api.github.com/repos/everypolitician/legislative-explorer/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/everypolitician/legislative-explorer/pulls/23","id":168153849,"html_url":"https://github.com/everypolitician/legislative-explorer/pull/23","diff_url":"https://github.com/everypolitician/legislative-explorer/pull/23.diff","patch_url":"https://github.com/everypolitician/legislative-explorer/pull/23.patch","issue_url":"https://api.github.com/repos/everypolitician/legislative-explorer/issues/23","number":23,"state":"open","locked":false,"title":"Show multiple P194 legislatures for a place","user":{"login":"henare","id":48945,"avatar_url":"https://avatars2.githubusercontent.com/u/48945?v=4","gravatar_id":"","url":"https://api.github.com/users/henare","html_url":"https://github.com/henare","followers_url":"https://api.github.com/users/henare/followers","following_url":"https://api.github.com/users/henare/following{/other_user}","gists_url":"https://api.github.com/users/henare/gists{/gist_id}","starred_url":"https://api.github.com/users/henare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henare/subscriptions","organizations_url":"https://api.github.com/users/henare/orgs","repos_url":"https://api.github.com/users/henare/repos","events_url":"https://api.github.com/users/henare/events{/privacy}","received_events_url":"https://api.github.com/users/henare/received_events","type":"User","site_admin":false},"body":"# What does this do?\r\n\r\nShows multiple legislatures next to a place if that place has multiple legislatures returned in the query.\r\n\r\nIt also ensures only one of each place is displayed on division and city lists. This problem was additionally noted on https://github.com/everypolitician/legislative-explorer/issues/8#issuecomment-364290316.\r\n\r\n# Why was this needed?\r\n\r\nCurrently if a place has multiple truthy statements for its Legislative Body For (P194) property then these are not shown (for countries) or result in duplicate entries (for FLACS and cities).\r\n\r\n# Relevant Issue(s)\r\n\r\n#8\r\n\r\n# Implementation notes\r\n\r\n# Screenshots\r\n![screenshot from 2018-02-09 15-56-24](https://user-images.githubusercontent.com/48945/36012399-f3c77850-0db1-11e8-9555-0b8c7946bef9.png)\r\n\r\n![screenshot from 2018-02-09 15-56-42](https://user-images.githubusercontent.com/48945/36012395-ef258274-0db1-11e8-9195-46ec36d1a42c.png)\r\n\r\n![screenshot from 2018-02-09 15-56-56](https://user-images.githubusercontent.com/48945/36012401-f7bc5d40-0db1-11e8-849d-650a6007201f.png)\r\n\r\n# Notes to Reviewer\r\n\r\nIt includes ac749ea, which isn't strictly about this topic, but is mentioned as part of #8 so it seems to make sense to resolve it as part of this PR.\r\n\r\n# Notes to Merger\r\n\r\n","created_at":"2018-02-09T04:58:30Z","updated_at":"2018-02-14T07:53:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"746607de6a96444acb597f12dcc10447ac10970b","assignee":{"login":"tmtmtmtm","id":57483,"avatar_url":"https://avatars2.githubusercontent.com/u/57483?v=4","gravatar_id":"","url":"https://api.github.com/users/tmtmtmtm","html_url":"https://github.com/tmtmtmtm","followers_url":"https://api.github.com/users/tmtmtmtm/followers","following_url":"https://api.github.com/users/tmtmtmtm/following{/other_user}","gists_url":"https://api.github.com/users/tmtmtmtm/gists{/gist_id}","starred_url":"https://api.github.com/users/tmtmtmtm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmtmtmtm/subscriptions","organizations_url":"https://api.github.com/users/tmtmtmtm/orgs","repos_url":"https://api.github.com/users/tmtmtmtm/repos","events_url":"https://api.github.com/users/tmtmtmtm/events{/privacy}","received_events_url":"https://api.github.com/users/tmtmtmtm/received_events","type":"User","site_admin":false},"assignees":[{"login":"tmtmtmtm","id":57483,"avatar_url":"https://avatars2.githubusercontent.com/u/57483?v=4","gravatar_id":"","url":"https://api.github.com/users/tmtmtmtm","html_url":"https://github.com/tmtmtmtm","followers_url":"https://api.github.com/users/tmtmtmtm/followers","following_url":"https://api.github.com/users/tmtmtmtm/following{/other_user}","gists_url":"https://api.github.com/users/tmtmtmtm/gists{/gist_id}","starred_url":"https://api.github.com/users/tmtmtmtm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmtmtmtm/subscriptions","organizations_url":"https://api.github.com/users/tmtmtmtm/orgs","repos_url":"https://api.github.com/users/tmtmtmtm/repos","events_url":"https://api.github.com/users/tmtmtmtm/events{/privacy}","received_events_url":"https://api.github.com/users/tmtmtmtm/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"mhl","id":7907,"avatar_url":"https://avatars3.githubusercontent.com/u/7907?v=4","gravatar_id":"","url":"https://api.github.com/users/mhl","html_url":"https://github.com/mhl","followers_url":"https://api.github.com/users/mhl/followers","following_url":"https://api.github.com/users/mhl/following{/other_user}","gists_url":"https://api.github.com/users/mhl/gists{/gist_id}","starred_url":"https://api.github.com/users/mhl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhl/subscriptions","organizations_url":"https://api.github.com/users/mhl/orgs","repos_url":"https://api.github.com/users/mhl/repos","events_url":"https://api.github.com/users/mhl/events{/privacy}","received_events_url":"https://api.github.com/users/mhl/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/everypolitician/legislative-explorer/pulls/23/commits","review_comments_url":"https://api.github.com/repos/everypolitician/legislative-explorer/pulls/23/comments","review_comment_url":"https://api.github.com/repos/everypolitician/legislative-explorer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/everypolitician/legislative-explorer/issues/23/comments","statuses_url":"https://api.github.com/repos/everypolitician/legislative-explorer/statuses/e4babe151ddd29ebe2b41d446cbaa41b4ed18a46","head":{"label":"everypolitician:multiple-legislatures","ref":"multiple-legislatures","sha":"e4babe151ddd29ebe2b41d446cbaa41b4ed18a46","user":{"login":"everypolitician","id":12497298,"avatar_url":"https://avatars2.githubusercontent.com/u/12497298?v=4","gravatar_id":"","url":"https://api.github.com/users/everypolitician","html_url":"https://github.com/everypolitician","followers_url":"https://api.github.com/users/everypolitician/followers","following_url":"https://api.github.com/users/everypolitician/following{/other_user}","gists_url":"https://api.github.com/users/everypolitician/gists{/gist_id}","starred_url":"https://api.github.com/users/everypolitician/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/everypolitician/subscriptions","organizations_url":"https://api.github.com/users/everypolitician/orgs","repos_url":"https://api.github.com/users/everypolitician/repos","events_url":"https://api.github.com/users/everypolitician/events{/privacy}","received_events_url":"https://api.github.com/users/everypolitician/received_events","type":"Organization","site_admin":false},"repo":{"id":114168057,"name":"legislative-explorer","full_name":"everypolitician/legislative-explorer","owner":{"login":"everypolitician","id":12497298,"avatar_url":"https://avatars2.githubusercontent.com/u/12497298?v=4","gravatar_id":"","url":"https://api.github.com/users/everypolitician","html_url":"https://github.com/everypolitician","followers_url":"https://api.github.com/users/everypolitician/followers","following_url":"https://api.github.com/users/everypolitician/following{/other_user}","gists_url":"https://api.github.com/users/everypolitician/gists{/gist_id}","starred_url":"https://api.github.com/users/everypolitician/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/everypolitician/subscriptions","organizations_url":"https://api.github.com/users/everypolitician/orgs","repos_url":"https://api.github.com/users/everypolitician/repos","events_url":"https://api.github.com/users/everypolitician/events{/privacy}","received_events_url":"https://api.github.com/users/everypolitician/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/everypolitician/legislative-explorer","description":"prototype of app for exploring legislative information in Wikidata","fork":false,"url":"https://api.github.com/repos/everypolitician/legislative-explorer","forks_url":"https://api.github.com/repos/everypolitician/legislative-explorer/forks","keys_url":"https://api.github.com/repos/everypolitician/legislative-explorer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/everypolitician/legislative-explorer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/everypolitician/legislative-explorer/teams","hooks_url":"https://api.github.com/repos/everypolitician/legislative-explorer/hooks","issue_events_url":"https://api.github.com/repos/everypolitician/legislative-explorer/issues/events{/number}","events_url":"https://api.github.com/repos/everypolitician/legislative-explorer/events","assignees_url":"https://api.github.com/repos/everypolitician/legislative-explorer/assignees{/user}","branches_url":"https://api.github.com/repos/everypolitician/legislative-explorer/branches{/branch}","tags_url":"https://api.github.com/repos/everypolitician/legislative-explorer/tags","blobs_url":"https://api.github.com/repos/everypolitician/legislative-explorer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/everypolitician/legislative-explorer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/everypolitician/legislative-explorer/git/refs{/sha}","trees_url":"https://api.github.com/repos/everypolitician/legislative-explorer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/everypolitician/legislative-explorer/statuses/{sha}","languages_url":"https://api.github.com/repos/everypolitician/legislative-explorer/languages","stargazers_url":"https://api.github.com/repos/everypolitician/legislative-explorer/stargazers","contributors_url":"https://api.github.com/repos/everypolitician/legislative-explorer/contributors","subscribers_url":"https://api.github.com/repos/everypolitician/legislative-explorer/subscribers","subscription_url":"https://api.github.com/repos/everypolitician/legislative-explorer/subscription","commits_url":"https://api.github.com/repos/everypolitician/legislative-explorer/commits{/sha}","git_commits_url":"https://api.github.com/repos/everypolitician/legislative-explorer/git/commits{/sha}","comments_url":"https://api.github.com/repos/everypolitician/legislative-explorer/comments{/number}","issue_comment_url":"https://api.github.com/repos/everypolitician/legislative-explorer/issues/comments{/number}","contents_url":"https://api.github.com/repos/everypolitician/legislative-explorer/contents/{+path}","compare_url":"https://api.github.com/repos/everypolitician/legislative-explorer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/everypolitician/legislative-explorer/merges","archive_url":"https://api.github.com/repos/everypolitician/legislative-explorer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/everypolitician/legislative-explorer/downloads","issues_url":"https://api.github.com/repos/everypolitician/legislative-explorer/issues{/number}","pulls_url":"https://api.github.com/repos/everypolitician/legislative-explorer/pulls{/number}","milestones_url":"https://api.github.com/repos/everypolitician/legislative-explorer/milestones{/number}","notifications_url":"https://api.github.com/repos/everypolitician/legislative-explorer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/everypolitician/legislative-explorer/labels{/name}","releases_url":"https://api.github.com/repos/everypolitician/legislative-explorer/releases{/id}","deployments_url":"https://api.github.com/repos/everypolitician/legislative-explorer/deployments","created_at":"2017-12-13T20:56:58Z","updated_at":"2018-02-07T23:28:52Z","pushed_at":"2018-02-14T07:06:29Z","git_url":"git://github.com/everypolitician/legislative-explorer.git","ssh_url":"git@github.com:everypolitician/legislative-explorer.git","clone_url":"https://github.com/everypolitician/legislative-explorer.git","svn_url":"https://github.com/everypolitician/legislative-explorer","homepage":"https://legislative-explorer.herokuapp.com/","size":495,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":8,"license":null,"forks":1,"open_issues":8,"watchers":0,"default_branch":"master"}},"base":{"label":"everypolitician:master","ref":"master","sha":"6f2cdc2fbe1c5ab5cd939e0e71532dc852c46276","user":{"login":"everypolitician","id":12497298,"avatar_url":"https://avatars2.githubusercontent.com/u/12497298?v=4","gravatar_id":"","url":"https://api.github.com/users/everypolitician","html_url":"https://github.com/everypolitician","followers_url":"https://api.github.com/users/everypolitician/followers","following_url":"https://api.github.com/users/everypolitician/following{/other_user}","gists_url":"https://api.github.com/users/everypolitician/gists{/gist_id}","starred_url":"https://api.github.com/users/everypolitician/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/everypolitician/subscriptions","organizations_url":"https://api.github.com/users/everypolitician/orgs","repos_url":"https://api.github.com/users/everypolitician/repos","events_url":"https://api.github.com/users/everypolitician/events{/privacy}","received_events_url":"https://api.github.com/users/everypolitician/received_events","type":"Organization","site_admin":false},"repo":{"id":114168057,"name":"legislative-explorer","full_name":"everypolitician/legislative-explorer","owner":{"login":"everypolitician","id":12497298,"avatar_url":"https://avatars2.githubusercontent.com/u/12497298?v=4","gravatar_id":"","url":"https://api.github.com/users/everypolitician","html_url":"https://github.com/everypolitician","followers_url":"https://api.github.com/users/everypolitician/followers","following_url":"https://api.github.com/users/everypolitician/following{/other_user}","gists_url":"https://api.github.com/users/everypolitician/gists{/gist_id}","starred_url":"https://api.github.com/users/everypolitician/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/everypolitician/subscriptions","organizations_url":"https://api.github.com/users/everypolitician/orgs","repos_url":"https://api.github.com/users/everypolitician/repos","events_url":"https://api.github.com/users/everypolitician/events{/privacy}","received_events_url":"https://api.github.com/users/everypolitician/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/everypolitician/legislative-explorer","description":"prototype of app for exploring legislative information in Wikidata","fork":false,"url":"https://api.github.com/repos/everypolitician/legislative-explorer","forks_url":"https://api.github.com/repos/everypolitician/legislative-explorer/forks","keys_url":"https://api.github.com/repos/everypolitician/legislative-explorer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/everypolitician/legislative-explorer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/everypolitician/legislative-explorer/teams","hooks_url":"https://api.github.com/repos/everypolitician/legislative-explorer/hooks","issue_events_url":"https://api.github.com/repos/everypolitician/legislative-explorer/issues/events{/number}","events_url":"https://api.github.com/repos/everypolitician/legislative-explorer/events","assignees_url":"https://api.github.com/repos/everypolitician/legislative-explorer/assignees{/user}","branches_url":"https://api.github.com/repos/everypolitician/legislative-explorer/branches{/branch}","tags_url":"https://api.github.com/repos/everypolitician/legislative-explorer/tags","blobs_url":"https://api.github.com/repos/everypolitician/legislative-explorer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/everypolitician/legislative-explorer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/everypolitician/legislative-explorer/git/refs{/sha}","trees_url":"https://api.github.com/repos/everypolitician/legislative-explorer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/everypolitician/legislative-explorer/statuses/{sha}","languages_url":"https://api.github.com/repos/everypolitician/legislative-explorer/languages","stargazers_url":"https://api.github.com/repos/everypolitician/legislative-explorer/stargazers","contributors_url":"https://api.github.com/repos/everypolitician/legislative-explorer/contributors","subscribers_url":"https://api.github.com/repos/everypolitician/legislative-explorer/subscribers","subscription_url":"https://api.github.com/repos/everypolitician/legislative-explorer/subscription","commits_url":"https://api.github.com/repos/everypolitician/legislative-explorer/commits{/sha}","git_commits_url":"https://api.github.com/repos/everypolitician/legislative-explorer/git/commits{/sha}","comments_url":"https://api.github.com/repos/everypolitician/legislative-explorer/comments{/number}","issue_comment_url":"https://api.github.com/repos/everypolitician/legislative-explorer/issues/comments{/number}","contents_url":"https://api.github.com/repos/everypolitician/legislative-explorer/contents/{+path}","compare_url":"https://api.github.com/repos/everypolitician/legislative-explorer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/everypolitician/legislative-explorer/merges","archive_url":"https://api.github.com/repos/everypolitician/legislative-explorer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/everypolitician/legislative-explorer/downloads","issues_url":"https://api.github.com/repos/everypolitician/legislative-explorer/issues{/number}","pulls_url":"https://api.github.com/repos/everypolitician/legislative-explorer/pulls{/number}","milestones_url":"https://api.github.com/repos/everypolitician/legislative-explorer/milestones{/number}","notifications_url":"https://api.github.com/repos/everypolitician/legislative-explorer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/everypolitician/legislative-explorer/labels{/name}","releases_url":"https://api.github.com/repos/everypolitician/legislative-explorer/releases{/id}","deployments_url":"https://api.github.com/repos/everypolitician/legislative-explorer/deployments","created_at":"2017-12-13T20:56:58Z","updated_at":"2018-02-07T23:28:52Z","pushed_at":"2018-02-14T07:06:29Z","git_url":"git://github.com/everypolitician/legislative-explorer.git","ssh_url":"git@github.com:everypolitician/legislative-explorer.git","clone_url":"https://github.com/everypolitician/legislative-explorer.git","svn_url":"https://github.com/everypolitician/legislative-explorer","homepage":"https://legislative-explorer.herokuapp.com/","size":495,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":8,"license":null,"forks":1,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/everypolitician/legislative-explorer/pulls/23"},"html":{"href":"https://github.com/everypolitician/legislative-explorer/pull/23"},"issue":{"href":"https://api.github.com/repos/everypolitician/legislative-explorer/issues/23"},"comments":{"href":"https://api.github.com/repos/everypolitician/legislative-explorer/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/everypolitician/legislative-explorer/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/everypolitician/legislative-explorer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/everypolitician/legislative-explorer/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/everypolitician/legislative-explorer/statuses/e4babe151ddd29ebe2b41d446cbaa41b4ed18a46"}},"author_association":"OWNER"}}
{"actor":{"display_login":"tmtmtmtm"}}