Closed steve9164 closed 3 years ago
ABS has released the latest data api based on SDMX JSON v2.1 Here are the details to test: https://docs.google.com/document/d/1J3con-CBdBGlQLSelZ_eYwesX2cjYI5UnGfSLMNZg9o/edit# ABS would like for an APIkey to be used with the calls
REST cheat sheets:
https://raw.githubusercontent.com/sdmx-twg/sdmx-rest/master/v2_1/ws/rest/docs/rest_cheat_sheet.pdf https://sis-cc.gitlab.io/dotstatsuite-documentation/using-api/restful/
For structure messages see - https://github.com/sdmx-twg/sdmx-json/blob/structure-message-release/structure-message/docs/1-sdmx-json-field-guide.md#agencyscheme
Something similar to this - https://ilostat.ilo.org/data/sdmx-query-builder/
https://registry.sdmx.org/webservice/data.html
https://sdd-dotstat-api-gateway.portal.azure-api.net/concepts
See https://github.com/sdmx-twg/sdmx-rest for more
Maybe use sdmx-csv instead? - see https://github.com/sdmx-twg/sdmx-csv/blob/master/data-message/docs/sdmx-csv-field-guide.md
Started with sdmx-rest
, but is only really useful for creating requests.
Master used sdmxjsonlib
, but it is quite basic, isn't maintained
dotstatsuite-sdmxjs
which is used by .stat suite - looks like the most useful.
At this stage I am not using any libs - as the type definitions do all the hard work. I may reconsider this as I create the SdmxJsonCatalogItem
I have types for all SDMX data messages, and some SDMX structure messages - https://github.com/nf-s/sdmx-json-types
Groups are now working in this order:
All of this information is given by = https://stats-nsi-stable.pacificdata.org/rest/dataflow/SPC/DF_CPI?references=all It may be more efficient to fetch Codelists and concepts at the SdmxGroup level - but this is easier for the moment
Very basic SDMX item is now working
Some TODOs:
cubeRegions
don't seem 100% for most layersBasic region mapping is working (time selector isn't working yet)
But this isn't a very good visualisation for pacific countries...
Issue with region-mapping https://github.com/TerriaJS/terriajs/issues/4676 and time-dimension #4674
ABS region mapping now working
It is now working on CI-deployment http://ci.terria.io/sdmx-next/#clean&https://gist.githubusercontent.com/nf-s/24b9288c6cdb6ba41d12f3d269318a0d/raw/c5ed64071c8a651ae458b4c0d3dc79c8618cb86d/sdmx.json
Not all layers will work (especially some ABS ones), but quite a few do. Note issues with region-mapping #4676 and time-dimension #4674
Some layers will require setting conceptTraits
to work correctly - (usually for region-mapping).
Information about that can be found here - https://github.com/TerriaJS/terriajs/blob/c351cb6c598ce66dc1ed373e7cc811a88766f0c5/lib/Traits/SdmxCommonTraits.ts
RegionType is determined by sdmxJsonDataflowStratum.column in this order:
conceptTraits.regionType
- if
conceptTraits.type === 'region'
and there exists another conceptTraits withtype === 'region-type'
in the datastructure, therefore region-type will be set from this concept- the dimension id
- the concept name
- the concept id (the actual string, not URN form)
The following catalog json specifies that the CS_COMMON(2.0).GEO_PICT
concept corresponds to regionType CNT2
(2-digit country code). So whenever this concept is used in a dataflow, the region type will be set to CNT2
"conceptOverrides": [
{
"id": "urn:sdmx:org.sdmx.infomodel.conceptscheme.Concept=SPC:CS_COMMON(2.0).GEO_PICT",
"type": "region",
"regionType": "CNT2"
},
...
Some dataflows use REGION_TYPE
concept to specify the region type, and REGION
concept to specify the region. If the REGION_TYPE
concept is found within a dataflow, it's selectedId
will be used as the regionType
for the REGION
concept.
"conceptOverrides": [
{
"id": "urn:sdmx:org.sdmx.infomodel.conceptscheme.Concept=ABS:CS_C16_COMMON(1.0.0).REGION_TYPE",
"type": "region-type",
"selectedId": "SA3"
},
{
"id": "urn:sdmx:org.sdmx.infomodel.conceptscheme.Concept=ABS:CS_C16_COMMON(1.0.0).REGION",
"type": "region"
},
...
These are a bit more obvious, and are kind of handled in the same way a column title is used to find the corresponding regionType
- for example lga_code_2016
- but it uses the first option which matches a valid regionType
ConceptTraits
ConceptTraits
extends DimensionTraits
so you also get the following properties you can override:
@primitiveTrait({
type: "string",
name: "Name",
description: "Dimension name (human-readable)"
})
name?: string;
@objectArrayTrait({
type: DimensionOptionTraits,
idProperty: "id",
name: "Options",
description: "Dimension options"
})
options?: DimensionOptionTraits[];
@primitiveTrait({
type: "string",
name: "Selected ID",
description: "Selected Option's ID"
})
selectedId?: string;
@primitiveTrait({
type: "boolean",
name: "Allow undefined",
description: "Allow dimension to be undefined"
})
allowUndefined?: boolean;
@primitiveTrait({
type: "boolean",
name: "Disable dimension",
description: "Hides dimension"
})
disable?: boolean;
Some TODOs:
HTTP/1.1 400 Bad Request X-Powered-By: Express Access-Control-Allow-Origin: * content-type: application/json; charset=utf-8 content-length: 0 date: Wed, 02 Sep 2020 05:36:34 GMT x-amzn-requestid: 43faaed7-84af-458b-8e09-e865338dd2cf x-amzn-remapped-content-length: 0 x-amzn-remapped-connection: Keep-Alive x-amz-apigw-id: SORXXGyGSwMFYaw= x-amzn-remapped-server: BigIP x-cache: Error from cloudfront via: 1.1 aee00c65edc39a007fb4a2fe5f4541d6.cloudfront.net (CloudFront) x-amz-cf-pop: SYD1-C1 x-amz-cf-id: HCKu6JPsdHohx9V71EPRandj5NYujfJtdj9Q_RmJiBvLMvq82JBDaQ== Vary: Accept-Encoding Connection: keep-alive
HTTP 400 issue may be related to lack of IPv6 support.
I might add ColumnTraits
to ConceptTraits
so you can directly add column style/etc... properties to concepts
I consider this finished (as a first pass anyway) - I just need to write tests.
ColumnTraits
to ConceptTraits
rowan: test some of the ways we use in nationalmap for it - and if we get the same results then we are good.
nick: main difference w/ v7 implementation, we have sdmx groups, instead of creating a catalog item for every single data flow ideally we just 'browse a sdmx'
@nf-s to update post-Wedneday
I'm going to close this as https://github.com/TerriaJS/terriajs/pull/4659 has been merged. We can create new issue(s) after we have received more feedback - I will make issues on current feedback
I'm going to re-open this for - NationalMap - Beta release (V8) - Feb 2021 https://github.com/TerriaJS/nationalmap/issues/997
I wanted to create separate tickets, but I didn't have time
This is not great:
Maybe write a featureInfoTemplate using region feature info from https://github.com/TerriaJS/terriajs/pull/5211
TableMixin
time-series chart for region mappingSdmxDataflowStratum.featureInfoTemplate
to improve feature info sectionconceptOverrides
to modelOverrides
- and added codelist override supportregionTypeReplacements
- so manually override detected regionTypes
primary-measure-descriptor
modelOverride
type - this will set the primary measure title based on selected value of primary measure descriptor dimensionURL to test it out!
http://ci.terria.io/sdmx-fixes-loading/#clean&https://gist.githubusercontent.com/nf-s/1e05f005a93d7b9ab6f1723b8b40d1d2/raw/f74e8c68f849db10cccfa96b05943cdb9cdb635b/abs-sdmx.json
Known dataset issues
RIME by region of arrival by departure, SA4 and above (ASGS 2016), 2016-17 onwards - Not sure how to represent
Consumer Price Index - Time period issue (2020-Q1...)
Population Projections... - GCCSA region issue - region mapping type not supported by Terria
Australian Census Longitudinal Dataset (ACLD): Tenure and landlord type, 2006-2011 - using "urn:sdmx:org.sdmx.infomodel.codelist.Codelist=ABS:CL_ASGS_2011(1.0.0)" but doesn't have region_type dimension
At the moment, when you expand a chart you don't get any information about dimensions
UNIT_MEASURE
is set to OBS_COMMENT
concept.
https://api.data.abs.gov.au/dataflow/ABS/ABS_SU_TABLE_2018?references=all
Closing again! Due to https://github.com/TerriaJS/terriajs/pull/5234
Ping Rowan or Nanda if the master sdmx stuff is still unclear