{"action":"created","issue":{"url":"https://api.github.com/repos/inveniosoftware/invenio-records/issues/11","labels_url":"https://api.github.com/repos/inveniosoftware/invenio-records/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/inveniosoftware/invenio-records/issues/11/comments","events_url":"https://api.github.com/repos/inveniosoftware/invenio-records/issues/11/events","html_url":"https://github.com/inveniosoftware/invenio-records/pull/11","id":95673639,"number":11,"title":"WIP: A sample test of jsonref usage in invenio-records","user":{"login":"Theer108","id":4771679,"avatar_url":"https://avatars.githubusercontent.com/u/4771679?v=3","gravatar_id":"","url":"https://api.github.com/users/Theer108","html_url":"https://github.com/Theer108","followers_url":"https://api.github.com/users/Theer108/followers","following_url":"https://api.github.com/users/Theer108/following{/other_user}","gists_url":"https://api.github.com/users/Theer108/gists{/gist_id}","starred_url":"https://api.github.com/users/Theer108/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Theer108/subscriptions","organizations_url":"https://api.github.com/users/Theer108/orgs","repos_url":"https://api.github.com/users/Theer108/repos","events_url":"https://api.github.com/users/Theer108/events{/privacy}","received_events_url":"https://api.github.com/users/Theer108/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/inveniosoftware/invenio-records/milestones/5","html_url":"https://github.com/inveniosoftware/invenio-records/milestones/v0.3.1","labels_url":"https://api.github.com/repos/inveniosoftware/invenio-records/milestones/5/labels","id":1251471,"number":5,"title":"v0.3.1","description":"","creator":{"login":"jirikuncar","id":189798,"avatar_url":"https://avatars.githubusercontent.com/u/189798?v=3","gravatar_id":"","url":"https://api.github.com/users/jirikuncar","html_url":"https://github.com/jirikuncar","followers_url":"https://api.github.com/users/jirikuncar/followers","following_url":"https://api.github.com/users/jirikuncar/following{/other_user}","gists_url":"https://api.github.com/users/jirikuncar/gists{/gist_id}","starred_url":"https://api.github.com/users/jirikuncar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jirikuncar/subscriptions","organizations_url":"https://api.github.com/users/jirikuncar/orgs","repos_url":"https://api.github.com/users/jirikuncar/repos","events_url":"https://api.github.com/users/jirikuncar/events{/privacy}","received_events_url":"https://api.github.com/users/jirikuncar/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":2,"state":"open","created_at":"2015-08-12T09:57:55Z","updated_at":"2015-08-25T08:49:29Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-07-17T14:59:01Z","updated_at":"2015-08-25T13:46:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/inveniosoftware/invenio-records/pulls/11","html_url":"https://github.com/inveniosoftware/invenio-records/pull/11","diff_url":"https://github.com/inveniosoftware/invenio-records/pull/11.diff","patch_url":"https://github.com/inveniosoftware/invenio-records/pull/11.patch"},"body":"This is just a WIP. One might try to launch it, but I'm not 100% sure it will work out-of-the-box. Nevertheless, it gives an idea about jsonref usage in invenio-records."},"comment":{"url":"https://api.github.com/repos/inveniosoftware/invenio-records/issues/comments/134591031","html_url":"https://github.com/inveniosoftware/invenio-records/pull/11#issuecomment-134591031","issue_url":"https://api.github.com/repos/inveniosoftware/invenio-records/issues/11","id":134591031,"user":{"login":"tiborsimko","id":517546,"avatar_url":"https://avatars.githubusercontent.com/u/517546?v=3","gravatar_id":"","url":"https://api.github.com/users/tiborsimko","html_url":"https://github.com/tiborsimko","followers_url":"https://api.github.com/users/tiborsimko/followers","following_url":"https://api.github.com/users/tiborsimko/following{/other_user}","gists_url":"https://api.github.com/users/tiborsimko/gists{/gist_id}","starred_url":"https://api.github.com/users/tiborsimko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiborsimko/subscriptions","organizations_url":"https://api.github.com/users/tiborsimko/orgs","repos_url":"https://api.github.com/users/tiborsimko/repos","events_url":"https://api.github.com/users/tiborsimko/events{/privacy}","received_events_url":"https://api.github.com/users/tiborsimko/received_events","type":"User","site_admin":false},"created_at":"2015-08-25T13:46:02Z","updated_at":"2015-08-25T13:46:02Z","body":"Thanks for the multimedia test examples.  One issue to ponder is how\r\nto best deal with link attributes.\r\n\r\n**(1)** The current test case describes a use case like the following:\r\n\r\n```\r\n\"photos\" [\r\n    {\r\n        \"$ref\": \"cds://1800701.json\"\r\n    },\r\n    {\r\n        \"$ref\": \"cds://1800701.json\"\r\n    }\r\n]\r\n```\r\n\r\nwhere one would access referenced objects like this:\r\n\r\n```\r\nphotos[0].title_statement_title\r\nphotos[1].title_statement_title\r\n\r\n```\r\n\r\nThis works well for dereferencing \"naked links\".\r\n\r\n**(2)** Now consider a situation where the link relation has parameters,\r\nfor example:\r\n\r\n```\r\n        +-------+                      +--------+\r\n        | album |  <-------------->    | photo1 |\r\n        +-------+   paramA, paramB     +--------+\r\n          ref                           paramX, paramY\r\n\r\n```\r\n\r\nThe parameters can be considered part of the linked object (`paramX`,\r\n`paramY`) but also part of the relation itself (`paramA`, `paramB`).\r\n\r\nHow would one represent the relation with parameters?  Note that\r\n[JSON Reference](http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-00)\r\nstandard does not permit to have another field next to `$ref`, which\r\nmeans one would have to introduce one more level:\r\n\r\n```\r\n\"photos\" [\r\n    {\r\n        'context': 'cover',\r\n        '__link__': {\r\n            \"$ref\": \"cds://1800701.json\"\r\n        }\r\n    },\r\n    {\r\n        \"$ref\": \"cds://1800701.json\"\r\n    }\r\n]\r\n```\r\n\r\nwhich not so consistent access technique:\r\n\r\n```\r\nphotos[0].__link__.title_statement_title\r\nphotos[1].title_statement_title\r\n\r\n```\r\n\r\n**(3)** It may be better to use always-consistent linking and accessing\r\ntechnique like:\r\n\r\n```\r\n\"photos\" [\r\n    {\r\n        'context': 'cover',\r\n        '__link__': {\r\n            \"$ref\": \"cds://1800701.json\"\r\n        }\r\n    },\r\n    {\r\n        '__link__': {\r\n            \"$ref\": \"cds://1800701.json\"\r\n        }\r\n    }\r\n]\r\n```\r\n\r\nand use the access methods explicitly:\r\n\r\n```\r\nphotos[0].__link__.title_statement_title\r\nphotos[1].__link__.title_statement_title\r\n```\r\n\r\neven though this may appear a bit convoluted.  However, consistent\r\nlinking and accessing technique would win for me here.  (Principle of\r\nleast astonishment of sorts.)\r\n\r\n**(4)** See also\r\n[JSON Hyper-Schema](http://json-schema.org/latest/json-schema-hypermedia.html)\r\nway of linking to other JSON records.\r\n\r\nWhat did you thought of using in the multimedia album use case when\r\nnaked links aren't enough and one has to store some context attributes\r\nof the relation?  Let's ponder pros/cons IRL?  CC @egabancho\r\n@ludmilamarian\r\n\r\n**P.S.** See similar musings for the authorities:\r\n\r\n- https://github.com/inveniosoftware/invenio-authorities/issues/1\r\n\r\nWe may want to profit from the same inter-linking technique for\r\nlinking records with parameters.\r\n"}}