-
Notifications
You must be signed in to change notification settings - Fork 15
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
XMLParseError: KeyError: 'OBS_STATUS' when reading LSD data #171
Comments
Hi, thanks for the report! I get this file from the URL you provided: rest_flow_M3031021_4_20240404123219.xml.txt The part causing the exception is shown at the bottom of the error trace. It corresponds to this XML: <str:Attribute id="OBS_STATUS" urn="urn:sdmx:org.sdmx.infomodel.datastructure.DataAttribute=LSD:M3031021_4(1.0).OBS_STATUS" assignmentStatus="Conditional">
<str:ConceptIdentity>
<Ref id="OBS_STATUS" maintainableParentID="M3031021_4" maintainableParentVersion="1.0" agencyID="LSD" package="conceptscheme" class="Concept"/>
</str:ConceptIdentity>
</str:Attribute> To be clear, this This ConceptScheme is also in the message: <str:ConceptScheme id="M3031021_4" urn="urn:sdmx:org.sdmx.infomodel.conceptscheme.ConceptScheme=LSD:M3031021_4(1.0)" agencyID="LSD" version="1.0" isFinal="true">
<com:Name xml:lang="lt">Schema M3031021_4</com:Name>
<com:Name xml:lang="en">Concept Scheme for M3031021_4</com:Name>
<str:Concept id="Lytis" urn="urn:sdmx:org.sdmx.infomodel.conceptscheme.Concept=LSD:M3031021_4(1.0).Lytis">
<com:Name xml:lang="lt">Lytis</com:Name>
<com:Name xml:lang="en">Sex</com:Name>
</str:Concept>
<str:Concept id="darbo_vieta" urn="urn:sdmx:org.sdmx.infomodel.conceptscheme.Concept=LSD:M3031021_4(1.0).darbo_vieta">
<com:Name xml:lang="lt">Pagrindinė darbo vieta</com:Name>
<com:Name xml:lang="en">The main place of work</com:Name>
</str:Concept>
<str:Concept id="MATVNT" urn="urn:sdmx:org.sdmx.infomodel.conceptscheme.Concept=LSD:M3031021_4(1.0).MATVNT">
<com:Name xml:lang="lt">Matavimo vienetai</com:Name>
<com:Name xml:lang="en">Measure unit</com:Name>
</str:Concept>
<str:Concept id="TIME_PERIOD" urn="urn:sdmx:org.sdmx.infomodel.conceptscheme.Concept=LSD:M3031021_4(1.0).TIME_PERIOD">
<com:Name xml:lang="lt">Laikotarpis</com:Name>
<com:Name xml:lang="en">Time period</com:Name>
</str:Concept>
<str:Concept id="DS_LAST_UPDATE" urn="urn:sdmx:org.sdmx.infomodel.conceptscheme.Concept=LSD:M3031021_4(1.0).DS_LAST_UPDATE">
<com:Name xml:lang="lt">Paskutinio atnaujinimo data</com:Name>
<com:Name xml:lang="en">Last update date</com:Name>
</str:Concept>
<str:Concept id="DS_REGIONAL" urn="urn:sdmx:org.sdmx.infomodel.conceptscheme.Concept=LSD:M3031021_4(1.0).DS_REGIONAL">
<com:Name xml:lang="lt">Rodiklio duomenų rinkinys turi administracinių vienetų dimensiją?</com:Name>
<com:Name xml:lang="en">The indicator set has an administrative unit dimension?</com:Name>
</str:Concept>
<str:Concept id="OBS_VALUE" urn="urn:sdmx:org.sdmx.infomodel.conceptscheme.Concept=LSD:M3031021_4(1.0).OBS_VALUE">
<com:Name xml:lang="lt">Stebėjimo vertė</com:Name>
<com:Name xml:lang="en">Observation value</com:Name>
</str:Concept>
<str:Concept id="OSP_MASYVO_STATUSAS" urn="urn:sdmx:org.sdmx.infomodel.conceptscheme.Concept=LSD:M3031021_4(1.0).OSP_MASYVO_STATUSAS">
<com:Name xml:lang="lt">Atnaujinamas</com:Name>
<com:Name xml:lang="en">Updated</com:Name>
</str:Concept>
<str:Concept id="OBS_DECIMALS" urn="urn:sdmx:org.sdmx.infomodel.conceptscheme.Concept=LSD:M3031021_4(1.0).OBS_DECIMALS">
<com:Name xml:lang="lt">Tikslumas po kablelio</com:Name>
<com:Name xml:lang="en">Decimal precision</com:Name>
</str:Concept>
<str:Concept id="DS_TIME_FORMAT" urn="urn:sdmx:org.sdmx.infomodel.conceptscheme.Concept=LSD:M3031021_4(1.0).DS_TIME_FORMAT">
<com:Name xml:lang="lt">Periodiškumas</com:Name>
<com:Name xml:lang="en">Periodicity</com:Name>
</str:Concept>
</str:ConceptScheme> As you can see, the concept scheme does not contain a Concept with ID "OBS_STATUS". This is the proximate cause of the exception. The underlying cause is that this web service is returning invalid/malformed SDMX-ML. The DataAttribute.concept_role refers to a Concept that does not exist. I would suggest you contact the provider that operates the web service, and ask them to update the invalid SDMX-ML. (If it helps, you can link directly to this comment of mine.) As for the current package ( |
Hi @edkry —did you get any reply from LSD about the invalid SDMX-ML that their service was returning? |
This code errors to:
Also if I take a look at DataStructureDefinition and its dimensions, attributes and measures, it's empty:
However, https://osp-rs.stat.gov.lt/ords/ipospp/ospp/rest_xml/datastructure/LSD/M3031021_4/ this API call would give me a datastructure.
The text was updated successfully, but these errors were encountered: