Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Json format proposal for CategoryScheme and Categories #41

Closed
OECD-BBAZART opened this issue Jun 28, 2016 · 4 comments
Closed

Json format proposal for CategoryScheme and Categories #41

OECD-BBAZART opened this issue Jun 28, 2016 · 4 comments

Comments

@OECD-BBAZART
Copy link
Contributor

In this issue I would suggest a Json format for CategoryScheme and Categories:

Like AgencyScheme or Categorisation: CategoryScheme and Categories will be added to the "references" object.

Compared to the xml format: having the hierarchy of Categories represented nested I suggest a flat representation with a 'parent' link to establish the relationship between categories.

Here is an example of the parent relationship inside a Category:

"urn:sdmx:org.sdmx.infomodel.categoryscheme.Category=ESTAT:ESTAT_DATAFLOWS_SCHEME(1.2).14.14200": {
"id": "14200",
"name": "Normalisation of information systems",
"urn": "urn:sdmx:org.sdmx.infomodel.categoryscheme.Category=ESTAT:ESTAT_DATAFLOWS_SCHEME(1.2).14.14200",
"parent": {
"urn": "urn:sdmx:org.sdmx.infomodel.categoryscheme.Category=ESTAT:ESTAT_DATAFLOWS_SCHEME(1.2).14"
}

}

Full example:
From the source file: CATEGORY_SCHEME_ESTAT_DATAFLOWS_SCHEME_annotations.xml.txt
We will get: CATEGORY_SCHEME_ESTAT_DATAFLOWS_SCHEME_annotations.xml-output.json.txt

@OECD-BBAZART
Copy link
Contributor Author

The downside with a flat representation of hierarchy is that the consistency of a document is not guaranteed. Furthermore the items must be correctly sorted, for ex: The parent Category A of Category B should be defined prior to Category B.
This should be the same reasoning for Codes in Code Lists, Concepts in Concept Schemes.

@OECD-BBAZART
Copy link
Contributor Author

Thanks @sosna for the recent change on step1.json

Based on your model I suggest a complement for representing hierarchy of Categories:
CategoryScheme with hierarchy of Categories.txt

@sosna
Copy link
Member

sosna commented Jul 12, 2016

Thanks @OECD-BBAZART! The proposal is indeed what we had in mind, i.e. any Item/Item Scheme can hold an array of items. I will update the samples as soon as time allows but else feel free to fork the repo and send a pull request, if you want and have time.

@dosse
Copy link
Contributor

dosse commented Nov 16, 2016

#42

@dosse dosse closed this as completed Nov 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants