Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

« Previous Version 11 Next »

Overview

Classifications are metadata that describe the codes and categories that variables use, they help to explain what the data means. Classifications can be vary in size, from just a few codes to hundreds of thousands of them. Because of the potential complexity and large size of them they can often be hard to manage. Rich Data Services aims to keep classifications as simple as possible, and provides methods to paginate and sort the codes of the classifications to keep what is traveling over the network small and efficient.

Retrieving a Classification

Classifications can be retrieved together or individually. To retrieve a group of classifications that are being used by a specific data source:

Get All Classifications
http://{host}/rds/catalog/collection/datasource/classifications
All Classifications Output
 {
    "classifications": {
        "resources": [
            {
                "id": "class1",
                "codes": {
                    "resources": [
                        {
                            "value": "1",
                            "label": "one"
                        }
                    ],
                    "info": {
                        "codeLimit": 100,
                        "codeOffset": 0,
                        "count": 1,
                        "moreCodes": false
                    }
                }
            },
            {
                "id": "class2",
                "codes": {
                    "resources": [
                        {
                            "value": "1",
                            "label": "one"
                        },
                        {
                            "value": "2",
                            "label": "two"
                        }
                    ],
                    "info": {
                        "codeLimit": 100,
                        "codeOffset": 0,
                        "count": 2,
                        "moreCodes": false
                    }
                }
            },
			{
                "id": "class3",
                "codes": {
                    "resources": [
                        {
                            "value": "1",
                            "label": "one"
                        },
                        {
                            "value": "2",
                            "label": "two"
                        },
                        {
                            "value": "3",
                            "label": "three"
                        }
                    ],
                    "info": {
                        "codeLimit": 100,
                        "codeOffset": 0,
                        "count": 3,
                        "moreCodes": false
                    }
                }
            },
			...
		],
        "info": {
            "limit": 100,
            "offset": 0,
            "codeLimit": 100,
            "codeOffset": 0,
            "more": false,
            "count": 63
        }
    }
}
 

Paginating a Classification

Classifications can be paginated using the limit and offset parameters to specify the subset desired.

Paginating Classifications
http://{host}/rds/catalog/collection/datasource/classifications?limit=1&offset=1
Paginated Output
 {
    "classifications": {
        "resources": [
           {
                "id": "class2",
                "codes": {
                    "resources": [
                        {
                            "value": "1",
                            "label": "one"
                        },
                        {
                            "value": "2",
                            "label": "two"
                        }
                    ],
                    "info": {
                        "codeLimit": 100,
                        "codeOffset": 0,
                        "count": 2,
                        "moreCodes": false
                    }
                }
            }
		],
        "info": {
            "limit": 1,
            "offset": 1,
            "codeLimit": 100,
            "codeOffset": 0,
            "more": true,
            "count": 63
        }
    }
}
 

Sorting a Group of Classifications

In addition to paginating classifications, they can also be sorted by their ID. Adding the sort parameter with either a value of ASC or DESC will result in sorted classifications.

Sort Classifications Descending
http://{host}/rds/catalog/collection/datasource/classifications?sort=DESC
Descending Classifications
{
    "classifications": {
        "resources": [
			{
                "id": "class3",
                "codes": {
                    "resources": [
                        {
                            "value": "1",
                            "label": "one"
                        },
                        {
                            "value": "2",
                            "label": "two"
                        },
                        {
                            "value": "3",
                            "label": "three"
                        }
                    ],
                    "info": {
                        "codeLimit": 100,
                        "codeOffset": 0,
                        "count": 3,
                        "moreCodes": false
                    }
                }
            },
 			{
                "id": "class2",
                "codes": {
                    "resources": [
                        {
                            "value": "1",
                            "label": "one"
                        },
                        {
                            "value": "2",
                            "label": "two"
                        }
                    ],
                    "info": {
                        "codeLimit": 100,
                        "codeOffset": 0,
                        "count": 2,
                        "moreCodes": false
                    }
                }
            },            
			{
                "id": "class1",
                "codes": {
                    "resources": [
                        {
                            "value": "1",
                            "label": "one"
                        }
                    ],
                    "info": {
                        "codeLimit": 100,
                        "codeOffset": 0,
                        "count": 1,
                        "moreCodes": false
                    }
                }
            },
			...
		],
        "info": {
            "limit": 100,
            "offset": 0,
            "codeLimit": 100,
            "codeOffset": 0,
            "more": false,
            "count": 63
        }
    }
}
  • No labels