{"action":"created","comment":{"url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/pulls/comments/30503246","id":30503246,"diff_hunk":"@@ -186,4 +191,129 @@ class DataAccess(val driver: JdbcProfile)\n   def lookupEntityByTypeAttribute(entityType: String, attributeName: String, attributeValue: String)(implicit session: Session) = {\n     entityByTypeAttribute((entityType, attributeName, attributeValue)).firstOption\n   }\n+\n+  // query for downstream entities\n+  private val kids = Compiled(\n+    (guid: Column[String]) =>\n+      for {\n+        rel <- relations\n+        if rel.entity1GUID === guid\n+        selfEnt <- rel.relation\n+        targetEnt <- rel.entity2 } yield (selfEnt.guid,selfEnt.entityType,targetEnt) )\n+\n+  private val kidAttrs = Compiled(\n+    (guid: Column[String]) =>\n+      for {\n+        rel <- relations\n+        if rel.entity1GUID === guid\n+        attr <- attributes\n+        if attr.entityGUID === rel.relationGUID ||\n+           attr.entityGUID === rel.entity2GUID } yield (attr.entityGUID, attr.name -> attr.value) )\n+\n+  def findDownstream(guid: String)(implicit session: Session) = {\n+    val attrMap = mutable.Map[String,mutable.Map[String,String]]()","path":"src/main/scala/org/broadinstitute/dsde/vault/datamanagement/domain/DataAccess.scala","position":38,"original_position":38,"commit_id":"20205231d970018131ec104491ab5c2641862404","original_commit_id":"20205231d970018131ec104491ab5c2641862404","user":{"login":"geoffjentry","id":961771,"avatar_url":"https://avatars.githubusercontent.com/u/961771?v=3","gravatar_id":"","url":"https://api.github.com/users/geoffjentry","html_url":"https://github.com/geoffjentry","followers_url":"https://api.github.com/users/geoffjentry/followers","following_url":"https://api.github.com/users/geoffjentry/following{/other_user}","gists_url":"https://api.github.com/users/geoffjentry/gists{/gist_id}","starred_url":"https://api.github.com/users/geoffjentry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoffjentry/subscriptions","organizations_url":"https://api.github.com/users/geoffjentry/orgs","repos_url":"https://api.github.com/users/geoffjentry/repos","events_url":"https://api.github.com/users/geoffjentry/events{/privacy}","received_events_url":"https://api.github.com/users/geoffjentry/received_events","type":"User","site_admin":false},"body":"Let me phrase what I think is happening here in English and someone let me know if I got it right :)  \r\n\r\nFor every attr in kitAttrs(guid).run, ensure that attrMap(attr._1) contains a mutable.Map and add attr._2 to it\r\n\r\nIs that right? Beyond attrMap being a mutable.Map is there a reason for the internal one to be mutable beyond it being easier to construct this?","created_at":"2015-05-18T12:41:34Z","updated_at":"2015-05-18T12:41:34Z","html_url":"https://github.com/broadinstitute/vault-datamanagement/pull/36#discussion_r30503246","pull_request_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/pulls/36","_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/vault-datamanagement/pulls/comments/30503246"},"html":{"href":"https://github.com/broadinstitute/vault-datamanagement/pull/36#discussion_r30503246"},"pull_request":{"href":"https://api.github.com/repos/broadinstitute/vault-datamanagement/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/pulls/36","id":35573671,"html_url":"https://github.com/broadinstitute/vault-datamanagement/pull/36","diff_url":"https://github.com/broadinstitute/vault-datamanagement/pull/36.diff","patch_url":"https://github.com/broadinstitute/vault-datamanagement/pull/36.patch","issue_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/issues/36","number":36,"state":"open","locked":false,"title":"Generic API","user":{"login":"tedsharpe","id":9284156,"avatar_url":"https://avatars.githubusercontent.com/u/9284156?v=3","gravatar_id":"","url":"https://api.github.com/users/tedsharpe","html_url":"https://github.com/tedsharpe","followers_url":"https://api.github.com/users/tedsharpe/followers","following_url":"https://api.github.com/users/tedsharpe/following{/other_user}","gists_url":"https://api.github.com/users/tedsharpe/gists{/gist_id}","starred_url":"https://api.github.com/users/tedsharpe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tedsharpe/subscriptions","organizations_url":"https://api.github.com/users/tedsharpe/orgs","repos_url":"https://api.github.com/users/tedsharpe/repos","events_url":"https://api.github.com/users/tedsharpe/events{/privacy}","received_events_url":"https://api.github.com/users/tedsharpe/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-16T16:37:13Z","updated_at":"2015-05-18T12:41:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a7e476882c3a13ef32ff5c86929208fca352177f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/pulls/36/commits","review_comments_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/pulls/36/comments","review_comment_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/pulls/comments{/number}","comments_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/issues/36/comments","statuses_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/statuses/20205231d970018131ec104491ab5c2641862404","head":{"label":"broadinstitute:genericAPI","ref":"genericAPI","sha":"20205231d970018131ec104491ab5c2641862404","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":31208477,"name":"vault-datamanagement","full_name":"broadinstitute/vault-datamanagement","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/vault-datamanagement","description":"","fork":false,"url":"https://api.github.com/repos/broadinstitute/vault-datamanagement","forks_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/forks","keys_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/teams","hooks_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/events","assignees_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/tags","blobs_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/subscription","commits_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/merges","archive_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/downloads","issues_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/releases{/id}","created_at":"2015-02-23T13:10:03Z","updated_at":"2015-05-12T19:49:22Z","pushed_at":"2015-05-16T16:37:55Z","git_url":"git://github.com/broadinstitute/vault-datamanagement.git","ssh_url":"git@github.com:broadinstitute/vault-datamanagement.git","clone_url":"https://github.com/broadinstitute/vault-datamanagement.git","svn_url":"https://github.com/broadinstitute/vault-datamanagement","homepage":null,"size":1527,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"base":{"label":"broadinstitute:develop","ref":"develop","sha":"265e9a1dd3217e9f9617250a82f112f0ed615108","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":31208477,"name":"vault-datamanagement","full_name":"broadinstitute/vault-datamanagement","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/vault-datamanagement","description":"","fork":false,"url":"https://api.github.com/repos/broadinstitute/vault-datamanagement","forks_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/forks","keys_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/teams","hooks_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/events","assignees_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/tags","blobs_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/subscription","commits_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/merges","archive_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/downloads","issues_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/vault-datamanagement/releases{/id}","created_at":"2015-02-23T13:10:03Z","updated_at":"2015-05-12T19:49:22Z","pushed_at":"2015-05-16T16:37:55Z","git_url":"git://github.com/broadinstitute/vault-datamanagement.git","ssh_url":"git@github.com:broadinstitute/vault-datamanagement.git","clone_url":"https://github.com/broadinstitute/vault-datamanagement.git","svn_url":"https://github.com/broadinstitute/vault-datamanagement","homepage":null,"size":1527,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/vault-datamanagement/pulls/36"},"html":{"href":"https://github.com/broadinstitute/vault-datamanagement/pull/36"},"issue":{"href":"https://api.github.com/repos/broadinstitute/vault-datamanagement/issues/36"},"comments":{"href":"https://api.github.com/repos/broadinstitute/vault-datamanagement/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/broadinstitute/vault-datamanagement/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/broadinstitute/vault-datamanagement/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/broadinstitute/vault-datamanagement/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/broadinstitute/vault-datamanagement/statuses/20205231d970018131ec104491ab5c2641862404"}}}}