{"action":"created","issue":{"url":"https://api.github.com/repos/ga4gh/server/issues/1012","repository_url":"https://api.github.com/repos/ga4gh/server","labels_url":"https://api.github.com/repos/ga4gh/server/issues/1012/labels{/name}","comments_url":"https://api.github.com/repos/ga4gh/server/issues/1012/comments","events_url":"https://api.github.com/repos/ga4gh/server/issues/1012/events","html_url":"https://github.com/ga4gh/server/issues/1012","id":142737353,"number":1012,"title":"ID scheme allows non-unique IDs","user":{"login":"david4096","id":3795586,"avatar_url":"https://avatars.githubusercontent.com/u/3795586?v=3","gravatar_id":"","url":"https://api.github.com/users/david4096","html_url":"https://github.com/david4096","followers_url":"https://api.github.com/users/david4096/followers","following_url":"https://api.github.com/users/david4096/following{/other_user}","gists_url":"https://api.github.com/users/david4096/gists{/gist_id}","starred_url":"https://api.github.com/users/david4096/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david4096/subscriptions","organizations_url":"https://api.github.com/users/david4096/orgs","repos_url":"https://api.github.com/users/david4096/repos","events_url":"https://api.github.com/users/david4096/events{/privacy}","received_events_url":"https://api.github.com/users/david4096/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"dcolligan","id":7422120,"avatar_url":"https://avatars.githubusercontent.com/u/7422120?v=3","gravatar_id":"","url":"https://api.github.com/users/dcolligan","html_url":"https://github.com/dcolligan","followers_url":"https://api.github.com/users/dcolligan/followers","following_url":"https://api.github.com/users/dcolligan/following{/other_user}","gists_url":"https://api.github.com/users/dcolligan/gists{/gist_id}","starred_url":"https://api.github.com/users/dcolligan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcolligan/subscriptions","organizations_url":"https://api.github.com/users/dcolligan/orgs","repos_url":"https://api.github.com/users/dcolligan/repos","events_url":"https://api.github.com/users/dcolligan/events{/privacy}","received_events_url":"https://api.github.com/users/dcolligan/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/ga4gh/server/milestones/9","html_url":"https://github.com/ga4gh/server/milestones/Reference%20server%20demo%20with%201000%20genome%20data","labels_url":"https://api.github.com/repos/ga4gh/server/milestones/9/labels","id":1643701,"number":9,"title":"Reference server demo with 1000 genome data","description":"The focus of this milestone is to bring together the functionality already present in the reference server with the features that are almost complete, and then serve up the data from the 1000 genome project. We need to fix a few problems as well as add support for some file types to successfully server up that data set. This milestone will act as a good proof of concept to motivate future applications that will leverage the GA4GH API.","creator":{"login":"kozbo","id":17557555,"avatar_url":"https://avatars.githubusercontent.com/u/17557555?v=3","gravatar_id":"","url":"https://api.github.com/users/kozbo","html_url":"https://github.com/kozbo","followers_url":"https://api.github.com/users/kozbo/followers","following_url":"https://api.github.com/users/kozbo/following{/other_user}","gists_url":"https://api.github.com/users/kozbo/gists{/gist_id}","starred_url":"https://api.github.com/users/kozbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kozbo/subscriptions","organizations_url":"https://api.github.com/users/kozbo/orgs","repos_url":"https://api.github.com/users/kozbo/repos","events_url":"https://api.github.com/users/kozbo/events{/privacy}","received_events_url":"https://api.github.com/users/kozbo/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":10,"state":"open","created_at":"2016-03-14T17:17:15Z","updated_at":"2016-03-25T18:04:26Z","due_on":"2016-04-25T07:00:00Z","closed_at":null},"comments":8,"created_at":"2016-03-22T18:23:43Z","updated_at":"2016-03-25T21:43:54Z","closed_at":null,"body":"Identifiers are required to be unique, but naming two files the same will cause them to have the same ID.\r\n\r\n```\r\nimport ga4gh.datamodel.variants as variants\r\nimport ga4gh.datamodel.reads as reads\r\nimport ga4gh.datamodel.datasets as datasets\r\n\r\nds = datasets.AbstractDataset(\"bruce\")\r\nrgs = reads.AbstractReadGroupSet(ds, \"wayne\")\r\n\r\nrgs.getId()\r\n# 'YnJ1Y2U6d2F5bmU'\r\n\r\nvs = variants.AbstractVariantSet(ds, \"wayne\")\r\n\r\nvs.getId()\r\n#'YnJ1Y2U6d2F5bmU'\r\n```\r\n\r\nPerhaps we could add a character per type to the compound ID?"},"comment":{"url":"https://api.github.com/repos/ga4gh/server/issues/comments/201527097","html_url":"https://github.com/ga4gh/server/issues/1012#issuecomment-201527097","issue_url":"https://api.github.com/repos/ga4gh/server/issues/1012","id":201527097,"user":{"login":"macieksmuga","id":6685511,"avatar_url":"https://avatars.githubusercontent.com/u/6685511?v=3","gravatar_id":"","url":"https://api.github.com/users/macieksmuga","html_url":"https://github.com/macieksmuga","followers_url":"https://api.github.com/users/macieksmuga/followers","following_url":"https://api.github.com/users/macieksmuga/following{/other_user}","gists_url":"https://api.github.com/users/macieksmuga/gists{/gist_id}","starred_url":"https://api.github.com/users/macieksmuga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macieksmuga/subscriptions","organizations_url":"https://api.github.com/users/macieksmuga/orgs","repos_url":"https://api.github.com/users/macieksmuga/repos","events_url":"https://api.github.com/users/macieksmuga/events{/privacy}","received_events_url":"https://api.github.com/users/macieksmuga/received_events","type":"User","site_admin":false},"created_at":"2016-03-25T21:43:54Z","updated_at":"2016-03-25T21:43:54Z","body":"The following is a sketch of a solution architecture that I'd like to implement at some point in the future, not a reflection on the code that's generating these IDs now.\r\n\r\nIdeally, the ID conundrum would be solved by every class for an ID-backed entity having two required methods, the implementation of which would presumably call on some standard obfuscation utility:\r\n\r\n```\r\ngetId(self) -> string\r\n\r\n@classmethod\r\ngetById(string: id) ->  object representing the entity\r\n```\r\n\r\nThe issue with this simple approach is that  server architecture assigns IDs to two distinct types of entities (from the server's viewpoint):\r\n\r\n- data containers, such as datasets, readGroupSets, featureSets, variantSets, etc... - these correspond to directories and files that the server has to access in order to serve out their contents.\r\n- data items and containers, such as variants, features, readGroups (which don't correspond to a container, but are entities named within a readGroupSet) - that correspond to data accessible within some container. \r\n\r\nThus, given a request with a data item ID, the server needs to figure out the appropriate data container to access first. \r\n\r\nThis could be done through a third standard `@classmethod` on every data item entity class that, given an ID provides the appropriate parent container, or possibly by folding this functionality automatically into the `getById` method. Some generic mechanisms need to be built to allow for all this, but I don't think that building and maintaining an entire parallel hierarchy of classes within `datamodel.__init__` just to satisfy this unique ID requirement is the right approach going forward."}}