{"action":"closed","issue":{"url":"https://api.github.com/repos/informatics-isi-edu/chaise/issues/371","repository_url":"https://api.github.com/repos/informatics-isi-edu/chaise","labels_url":"https://api.github.com/repos/informatics-isi-edu/chaise/issues/371/labels{/name}","comments_url":"https://api.github.com/repos/informatics-isi-edu/chaise/issues/371/comments","events_url":"https://api.github.com/repos/informatics-isi-edu/chaise/issues/371/events","html_url":"https://github.com/informatics-isi-edu/chaise/issues/371","id":155390372,"number":371,"title":"Record app related entities query fails with ambiguous links","user":{"login":"karlcz","id":1075148,"avatar_url":"https://avatars.githubusercontent.com/u/1075148?v=3","gravatar_id":"","url":"https://api.github.com/users/karlcz","html_url":"https://github.com/karlcz","followers_url":"https://api.github.com/users/karlcz/followers","following_url":"https://api.github.com/users/karlcz/following{/other_user}","gists_url":"https://api.github.com/users/karlcz/gists{/gist_id}","starred_url":"https://api.github.com/users/karlcz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karlcz/subscriptions","organizations_url":"https://api.github.com/users/karlcz/orgs","repos_url":"https://api.github.com/users/karlcz/repos","events_url":"https://api.github.com/users/karlcz/events{/privacy}","received_events_url":"https://api.github.com/users/karlcz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/informatics-isi-edu/chaise/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/informatics-isi-edu/chaise/labels/record","name":"record","color":"006b75"},{"url":"https://api.github.com/repos/informatics-isi-edu/chaise/labels/record%202","name":"record 2","color":"0e8a16"},{"url":"https://api.github.com/repos/informatics-isi-edu/chaise/labels/wishlist","name":"wishlist","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":{"login":"karlcz","id":1075148,"avatar_url":"https://avatars.githubusercontent.com/u/1075148?v=3","gravatar_id":"","url":"https://api.github.com/users/karlcz","html_url":"https://github.com/karlcz","followers_url":"https://api.github.com/users/karlcz/followers","following_url":"https://api.github.com/users/karlcz/following{/other_user}","gists_url":"https://api.github.com/users/karlcz/gists{/gist_id}","starred_url":"https://api.github.com/users/karlcz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karlcz/subscriptions","organizations_url":"https://api.github.com/users/karlcz/orgs","repos_url":"https://api.github.com/users/karlcz/repos","events_url":"https://api.github.com/users/karlcz/events{/privacy}","received_events_url":"https://api.github.com/users/karlcz/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/informatics-isi-edu/chaise/milestones/8","html_url":"https://github.com/informatics-isi-edu/chaise/milestones/2016-06","labels_url":"https://api.github.com/repos/informatics-isi-edu/chaise/milestones/8/labels","id":1756007,"number":8,"title":"2016-06","description":"","creator":{"login":"hongsudt","id":414732,"avatar_url":"https://avatars.githubusercontent.com/u/414732?v=3","gravatar_id":"","url":"https://api.github.com/users/hongsudt","html_url":"https://github.com/hongsudt","followers_url":"https://api.github.com/users/hongsudt/followers","following_url":"https://api.github.com/users/hongsudt/following{/other_user}","gists_url":"https://api.github.com/users/hongsudt/gists{/gist_id}","starred_url":"https://api.github.com/users/hongsudt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hongsudt/subscriptions","organizations_url":"https://api.github.com/users/hongsudt/orgs","repos_url":"https://api.github.com/users/hongsudt/repos","events_url":"https://api.github.com/users/hongsudt/events{/privacy}","received_events_url":"https://api.github.com/users/hongsudt/received_events","type":"User","site_admin":false},"open_issues":68,"closed_issues":21,"state":"open","created_at":"2016-05-09T17:04:23Z","updated_at":"2016-06-23T01:10:03Z","due_on":"2016-07-01T07:00:00Z","closed_at":null},"comments":5,"created_at":"2016-05-18T00:08:54Z","updated_at":"2016-06-23T01:10:03Z","closed_at":"2016-06-23T01:10:03Z","body":"On my test catalog https://synapse-dev.isrd.isi.edu/chaise/record/#2/Synapse:Protocol_Step/ID=PrcDsy20160101A-behave fails to load due to an ambiguous link between this table and Zebrafish:Behavior\r\n\r\nThe underlying ERMrest query which fails is https://synapse-dev.isrd.isi.edu/ermrest/catalog/2/aggregate/Synapse:Protocol_Step/ID=PrcDsy20160101A-behave/Zebrafish:Behavior/row_count:=cnt(*) because there are two different foreign keys in the Behavior table that both reference Protocol_Step.\r\n\r\nWe should do one of two things when there are ambiguous links:\r\n1. Ignore that linked table, rather than failing the whole page load\r\n2. Include a separate related entities table for each available link, using the unambiguous link syntax in the ERMrest requests.  This is preferred, but more complex.\r\n\r\nThe unambiguous version of the query above would be these two different links:\r\n- https://synapse-dev.isrd.isi.edu/ermrest/catalog/2/aggregate/Synapse:Protocol_Step/ID=PrcDsy20160101A-behave/(Zebrafish:Behavior:Image_Step)/row_count:=cnt(*)\r\n- https://synapse-dev.isrd.isi.edu/ermrest/catalog/2/aggregate/Synapse:Protocol_Step/ID=PrcDsy20160101A-behave/(Zebrafish:Behavior:Analysis_Step)/row_count:=cnt(*)\r\n\r\ni.e. one explicitly linking by each foreign key link that is available in the model."}}
{"actor":{"display_login":"hongsudt"}}