{"action":"created","issue":{"url":"https://api.github.com/repos/kids-first/kf-api-dataservice/issues/104","repository_url":"https://api.github.com/repos/kids-first/kf-api-dataservice","labels_url":"https://api.github.com/repos/kids-first/kf-api-dataservice/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/kids-first/kf-api-dataservice/issues/104/comments","events_url":"https://api.github.com/repos/kids-first/kf-api-dataservice/issues/104/events","html_url":"https://github.com/kids-first/kf-api-dataservice/issues/104","id":295266382,"number":104,"title":"Consider moving relations to _links","user":{"login":"dankolbman","id":2495894,"avatar_url":"https://avatars0.githubusercontent.com/u/2495894?v=4","gravatar_id":"","url":"https://api.github.com/users/dankolbman","html_url":"https://github.com/dankolbman","followers_url":"https://api.github.com/users/dankolbman/followers","following_url":"https://api.github.com/users/dankolbman/following{/other_user}","gists_url":"https://api.github.com/users/dankolbman/gists{/gist_id}","starred_url":"https://api.github.com/users/dankolbman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dankolbman/subscriptions","organizations_url":"https://api.github.com/users/dankolbman/orgs","repos_url":"https://api.github.com/users/dankolbman/repos","events_url":"https://api.github.com/users/dankolbman/events{/privacy}","received_events_url":"https://api.github.com/users/dankolbman/received_events","type":"User","site_admin":false},"labels":[{"id":807712323,"url":"https://api.github.com/repos/kids-first/kf-api-dataservice/labels/refactor","name":"refactor","color":"2fbf3b","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-07T19:39:08Z","updated_at":"2018-02-23T16:54:39Z","closed_at":null,"author_association":"MEMBER","body":"Right now, entity relationships are properties with the kf_id as the value:\r\n\r\n```\r\n{\r\n            \"_links\": {\r\n                \"self\": \"/participants/EANSE585\"\r\n            },\r\n            \"created_at\": \"2018-02-07T19:30:48.095286+00:00\",\r\n            \"demographic\": \"/demographics/0A8QGFQX\",\r\n            \"diagnoses\": [\r\n                \"J6NPXSD8\",\r\n                \"H1Y00WE4\"\r\n            ],\r\n            \"external_id\": \"participant_4\",\r\n            \"kf_id\": \"EANSE585\",\r\n            \"modified_at\": \"2018-02-07T19:30:48.095302+00:00\",\r\n            \"samples\": [\r\n                \"6AH8HJNK\",\r\n                \"HEY6S7R1\"\r\n            ]\r\n}\r\n```\r\n\r\nPerhaps we should move these into _links with an endpoint, or create a copy there:\r\n\r\n```\r\n{\r\n            \"_links\": {\r\n                \"self\": \"/participants/EANSE585\",\r\n                \"demographic\": \"0A8QGFQX\",\r\n                \"diagnoses\": [\r\n                    \"/diagnoses/J6NPXSD8\",\r\n                    \"/diagnoses/H1Y00WE4\"\r\n                ],\r\n                \"samples\": [\r\n                    \"/samples/6AH8HJNK\",\r\n                    \"/samples/HEY6S7R1\"\r\n                ]\r\n            },\r\n            \"created_at\": \"2018-02-07T19:30:48.095286+00:00\",\r\n            \"external_id\": \"participant_4\",\r\n            \"kf_id\": \"EANSE585\",\r\n            \"modified_at\": \"2018-02-07T19:30:48.095302+00:00\",\r\n\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/kids-first/kf-api-dataservice/issues/comments/368068521","html_url":"https://github.com/kids-first/kf-api-dataservice/issues/104#issuecomment-368068521","issue_url":"https://api.github.com/repos/kids-first/kf-api-dataservice/issues/104","id":368068521,"user":{"login":"znatty22","id":10283712,"avatar_url":"https://avatars2.githubusercontent.com/u/10283712?v=4","gravatar_id":"","url":"https://api.github.com/users/znatty22","html_url":"https://github.com/znatty22","followers_url":"https://api.github.com/users/znatty22/followers","following_url":"https://api.github.com/users/znatty22/following{/other_user}","gists_url":"https://api.github.com/users/znatty22/gists{/gist_id}","starred_url":"https://api.github.com/users/znatty22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/znatty22/subscriptions","organizations_url":"https://api.github.com/users/znatty22/orgs","repos_url":"https://api.github.com/users/znatty22/repos","events_url":"https://api.github.com/users/znatty22/events{/privacy}","received_events_url":"https://api.github.com/users/znatty22/received_events","type":"User","site_admin":false},"created_at":"2018-02-23T16:54:39Z","updated_at":"2018-02-23T16:54:39Z","author_association":"CONTRIBUTOR","body":"👍 I like the idea of moving the relations to _links. Perhaps we could do something like, move the related entity's link url to `_links` and optionally include the fully expanded entity in the properties section of the body. We probably wouldn't do this for all related entities. Maybe just for participant. An example would be something like: \r\n\r\n```\r\n{\r\n            \"_links\": {\r\n                \"self\": \"/participants/EANSE585\",\r\n                \"demographic\": \"0A8QGFQX\",\r\n                \"diagnoses\": [\r\n                    \"/diagnoses/J6NPXSD8\",\r\n                    \"/diagnoses/H1Y00WE4\"\r\n                ],\r\n                \"samples\": [\r\n                    \"/samples/6AH8HJNK\",\r\n                    \"/samples/HEY6S7R1\"\r\n                ]\r\n            },\r\n            \"created_at\": \"2018-02-07T19:30:48.095286+00:00\",\r\n            \"external_id\": \"participant_4\",\r\n            \"kf_id\": \"EANSE585\",\r\n            \"modified_at\": \"2018-02-07T19:30:48.095302+00:00\",\r\n            \"demographic\": {\r\n                  \"race\": \"asian\",\r\n                  \"ethnicity\": \"not hispanic or latino\", \r\n                  \"gender\": \"male\" \r\n             }\r\n}\r\n```"}}
{"actor":{"display_login":"znatty22"}}