{"action":"created","issue":{"url":"https://api.github.com/repos/openspending/fiscal-data-package/issues/48","labels_url":"https://api.github.com/repos/openspending/fiscal-data-package/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/openspending/fiscal-data-package/issues/48/comments","events_url":"https://api.github.com/repos/openspending/fiscal-data-package/issues/48/events","html_url":"https://github.com/openspending/fiscal-data-package/issues/48","id":108540231,"number":48,"title":"Representing dimensions which are trees, denormalised in a single resource","user":{"login":"pwalsh","id":791678,"avatar_url":"https://avatars.githubusercontent.com/u/791678?v=3","gravatar_id":"","url":"https://api.github.com/users/pwalsh","html_url":"https://github.com/pwalsh","followers_url":"https://api.github.com/users/pwalsh/followers","following_url":"https://api.github.com/users/pwalsh/following{/other_user}","gists_url":"https://api.github.com/users/pwalsh/gists{/gist_id}","starred_url":"https://api.github.com/users/pwalsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwalsh/subscriptions","organizations_url":"https://api.github.com/users/pwalsh/orgs","repos_url":"https://api.github.com/users/pwalsh/repos","events_url":"https://api.github.com/users/pwalsh/events{/privacy}","received_events_url":"https://api.github.com/users/pwalsh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/openspending/fiscal-data-package/labels/Example%20Needed","name":"Example Needed","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-09-27T14:45:21Z","updated_at":"2015-10-15T14:23:22Z","closed_at":null,"body":"The classic case is functional classification, but it could apply to any dimension potentially (projects, entities, etc.)\r\n\r\nHow do we use `mapping.{dimension}` to represent a tree, when the tree is denormalised in a single resource?\r\n\r\nSome recent discussion around this:\r\n\r\n* https://discuss.okfn.org/t/open-spending-data-structure-ideas-and-suggestions/300/21?u=pwalsh\r\n* https://github.com/openspending/osep/issues/20\r\n"},"comment":{"url":"https://api.github.com/repos/openspending/fiscal-data-package/issues/comments/148400799","html_url":"https://github.com/openspending/fiscal-data-package/issues/48#issuecomment-148400799","issue_url":"https://api.github.com/repos/openspending/fiscal-data-package/issues/48","id":148400799,"user":{"login":"danfowler","id":772616,"avatar_url":"https://avatars.githubusercontent.com/u/772616?v=3","gravatar_id":"","url":"https://api.github.com/users/danfowler","html_url":"https://github.com/danfowler","followers_url":"https://api.github.com/users/danfowler/followers","following_url":"https://api.github.com/users/danfowler/following{/other_user}","gists_url":"https://api.github.com/users/danfowler/gists{/gist_id}","starred_url":"https://api.github.com/users/danfowler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danfowler/subscriptions","organizations_url":"https://api.github.com/users/danfowler/orgs","repos_url":"https://api.github.com/users/danfowler/repos","events_url":"https://api.github.com/users/danfowler/events{/privacy}","received_events_url":"https://api.github.com/users/danfowler/received_events","type":"User","site_admin":false},"created_at":"2015-10-15T14:23:22Z","updated_at":"2015-10-15T14:23:22Z","body":"@pwalsh @rgrp I think the implicit ordering with an array works well when the each object can express multiple mappings at the same level ([as in your example](https://discuss.okfn.org/t/open-spending-data-structure-ideas-and-suggestions/300/21?u=danfowler): `id` -> `budget_tree/id-1`, `title` -> `budget_tree/title-1`).  In the current specification, we're ordering fields, some of which could exist at the same classification level.  So I would think an object of objects would be preferable because the array can't implicitly express that two elements are at the same classification level.\r\n\r\nGiven the [Madrid Municipal Budgets](https://github.com/os-data/madrid-municipal-gastos) dataset:\r\n\r\n    AÑO,CENTRO,DESCRIPCION CENTRO,SECCION,DESCRIPCION SECCION,PROGRAMA,DESCRIPCION PROGRAMA,CAPITULO,DESCRIPCION CAPITULO,ECONOMICO,DESCRIPCION ECONOMICO,IMPORTE\r\n    2012,001,AYUNTAMIENTO DE MADRID,002,PRESIDENCIA DEL PLENO,91100,SECRETARÍA GENERAL DEL PLENO,1,GASTOS DE PERSONAL,12000,SUELDOS DEL GRUPO A1,102739\r\n    2012,001,AYUNTAMIENTO DE MADRID,002,PRESIDENCIA DEL PLENO,91100,SECRETARÍA GENERAL DEL PLENO,1,GASTOS DE PERSONAL,12001,SUELDOS DEL GRUPO A2,29354\r\n    2012,001,AYUNTAMIENTO DE MADRID,002,PRESIDENCIA DEL PLENO,91100,SECRETARÍA GENERAL DEL PLENO,1,GASTOS DE PERSONAL,12003,SUELDOS DEL GRUPO C1,215832\r\n\r\nI would express the administrative classification dimension (CENTRO/SECCION: columns 2-5) this way:\r\n\r\n     {\r\n      \"name\": \"administrative\",\r\n      \"dimensionType\": \"classification\",\r\n      \"classificationType\": \"administrative\"\r\n      \"fields\": [\r\n        {\r\n          \"name\": \"CENTRO\",\r\n          \"level\": 1,\r\n          \"source\": \"CENTRO\"\r\n        },\r\n        {\r\n          \"name\": \"DESCRIPCION CENTRO\",\r\n          \"level\": 1,\r\n          \"source\": \"DESCRIPCION CENTRO\"\r\n        },\r\n        {\r\n          \"name\": \"SECCION\",\r\n          \"level\": 2,\r\n          \"source\": \"SECCION\"\r\n        },\r\n        {\r\n          \"name\": \"DESCRIPCION SECCION\",\r\n          \"level\": 2,\r\n          \"source\": \"DESCRIPCION SECCION\"\r\n        }\r\n      ]\r\n    }\r\n\r\n"}}