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

Fix unexpected exception while getting data on WITS #110

Closed
charphi opened this issue Jun 11, 2021 · 1 comment
Closed

Fix unexpected exception while getting data on WITS #110

charphi opened this issue Jun 11, 2021 · 1 comment
Labels
API bug Something isn't working
Milestone

Comments

@charphi
Copy link
Member

charphi commented Jun 11, 2021

At least one flow of WITS has a time dimension that is not the latest dimension.
This triggers a IndexOutOfBoundsException in Key.Builder.

Example: http://wits.worldbank.org/API/V1/SDMX/V21/rest/datastructure/WBG_WITS/TARIFF_TRAINS/1.1/?references=children

<DimensionList id="DimensionDescriptor" urn="urn:sdmx:org.sdmx.infomodel.datastructure.DimensionDescriptor=WBG_WITS:TARIFF_TRAINS(1.1).DimensionDescriptor">
	<Dimension id="FREQ" urn="urn:sdmx:org.sdmx.infomodel.datastructure.Dimension=WBG_WITS:TARIFF_TRAINS(1.1).FREQ" position="1">
		<ConceptIdentity>
			<Ref id="FREQ" maintainableParentID="TARIFF_CONCEPTS" maintainableParentVersion="1.0" agencyID="WBG_WITS" package="conceptscheme" class="Concept" xmlns="" />
		</ConceptIdentity>
		<LocalRepresentation>
			<Enumeration>
				<Ref id="CL_FREQ_WITS" version="1.0" agencyID="WBG_WITS" package="codelist" class="Codelist" xmlns="" />
			</Enumeration>
		</LocalRepresentation>
	</Dimension>
	<Dimension id="REPORTER" urn="urn:sdmx:org.sdmx.infomodel.datastructure.Dimension=WBG_WITS:TARIFF_TRAINS(1.1).REPORTER" position="2">
		<ConceptIdentity>
			<Ref id="REPORTER" maintainableParentID="TARIFF_CONCEPTS" maintainableParentVersion="1.0" agencyID="WBG_WITS" package="conceptscheme" class="Concept" xmlns="" />
		</ConceptIdentity>
		<LocalRepresentation>
			<Enumeration>
				<Ref id="CL_COUNTRY_WITS" version="1.0" agencyID="WBG_WITS" package="codelist" class="Codelist" xmlns="" />
			</Enumeration>
		</LocalRepresentation>
	</Dimension>
	<Dimension id="PARTNER" urn="urn:sdmx:org.sdmx.infomodel.datastructure.Dimension=WBG_WITS:TARIFF_TRAINS(1.1).PARTNER" position="3">
		<ConceptIdentity>
			<Ref id="PARTNER" maintainableParentID="TARIFF_CONCEPTS" maintainableParentVersion="1.0" agencyID="WBG_WITS" package="conceptscheme" class="Concept" xmlns="" />
		</ConceptIdentity>
		<LocalRepresentation>
			<Enumeration>
				<Ref id="CL_COUNTRY_WITS" version="1.0" agencyID="WBG_WITS" package="codelist" class="Codelist" xmlns="" />
			</Enumeration>
		</LocalRepresentation>
	</Dimension>
	<TimeDimension id="TIME_PERIOD" urn="urn:sdmx:org.sdmx.infomodel.datastructure.TimeDimension=WBG_WITS:TARIFF_TRAINS(1.1).TIME_PERIOD" position="4">
		<ConceptIdentity>
			<Ref id="YEAR" maintainableParentID="TARIFF_CONCEPTS" maintainableParentVersion="1.0" agencyID="WBG_WITS" package="conceptscheme" class="Concept" xmlns="" />
		</ConceptIdentity>
		<LocalRepresentation>
			<TextFormat textType="ObservationalTimePeriod" />
		</LocalRepresentation>
	</TimeDimension>
	<Dimension id="PRODUCTCODE" urn="urn:sdmx:org.sdmx.infomodel.datastructure.Dimension=WBG_WITS:TARIFF_TRAINS(1.1).PRODUCTCODE" position="5">
		<ConceptIdentity>
			<Ref id="PRODUCTCODE" maintainableParentID="TARIFF_CONCEPTS" maintainableParentVersion="1.0" agencyID="WBG_WITS" package="conceptscheme" class="Concept" xmlns="" />
		</ConceptIdentity>
		<LocalRepresentation>
			<Enumeration>
				<Ref id="CL_PRODUCTCODE_WITS" version="1.0" agencyID="WBG_WITS" package="codelist" class="Codelist" xmlns="" />
			</Enumeration>
		</LocalRepresentation>
	</Dimension>
	<Dimension id="DATATYPE" urn="urn:sdmx:org.sdmx.infomodel.datastructure.Dimension=WBG_WITS:TARIFF_TRAINS(1.1).DATATYPE" position="6">
		<ConceptIdentity>
			<Ref id="DATATYPE" maintainableParentID="TARIFF_CONCEPTS" maintainableParentVersion="1.0" agencyID="WBG_WITS" package="conceptscheme" class="Concept" xmlns="" />
		</ConceptIdentity>
		<LocalRepresentation>
			<Enumeration>
				<Ref id="CL_DATATYPE_WITS" version="1.0" agencyID="WBG_WITS" package="codelist" class="Codelist" xmlns="" />
			</Enumeration>
		</LocalRepresentation>
	</Dimension>
</DimensionList>

Same example with cli:

> sdmx-dl list concepts WITS DF_WITS_Tariff_TRAINS --sort | convertfrom-csv | format-table

Concept           Label             Type      Coded Position
-------           -----             ----      ----- --------
FREQ              Freq              dimension true  1
REPORTER          Reporter_ISO_N    dimension true  2
PARTNER           Partner           dimension true  3
PRODUCTCODE       ProductCode       dimension true  5
DATATYPE          DataType          dimension true  6
DATASOURCE        DataSource        attribute true
EXCLUDEDFROM      ExcludedFrom      attribute true
@charphi charphi added bug Something isn't working API labels Jun 11, 2021
@charphi charphi added this to the 3.0.0-beta.3 milestone Jun 11, 2021
@charphi
Copy link
Member Author

charphi commented Jun 11, 2021

Done in b4631dd

@charphi charphi closed this as completed Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant