sdmx icon indicating copy to clipboard operation
sdmx copied to clipboard

Clarify role of <com:Link> in SDMX-ML 3.0.0

Open khaeru opened this issue 9 months ago • 1 comments

In the wild, SDMX-ML 3.0.0 from IMF (see specimen here) contains:

…
<str:Codelist urn="urn:sdmx:org.sdmx.infomodel.codelist.Codelist=IMF:CL_FREQ(1.0.3)" agencyID="IMF" id="CL_FREQ" version="1.0.3" isExternalReference="false" isPartial="false">
  <com:Link url="urn:sdmx:org.sdmx.infomodel.codelist.Codelist=IMF:CL_FREQ(1.0.3)" type="codelist" rel="self"/>
  …

In SDMX 3.0.0:

  • The IM (§3.2.2.2, page 31) specifies the following:
    • IdentifiableArtefact.uri: Universal resource identifier that may or may not be resolvable.
    • IdentifiableArtefact.urn: Universal resource name – this is for use in registries: all registered objects have a urn.
  • The class diagram (§3.2.1, page 29) shows these as having type "url" and "urn" respectively, with cardinality of 1.
  • The SDMX-ML 3.0.0 schemas (here) show:
    <xs:element name="Link" type="LinkType">
      <xs:annotation>
        <xs:documentation>Allows for the linking of other resources to identifiable objects. For example, if there is reference metadata associated with a structure, a link to the meatadata report can be dynamically inserted in the structure metadata.</xs:documentation>
      </xs:annotation>
    </xs:element>
    
    …and further that this element has the mandatory url attribute and optional urn attribute.
  • The schemas also show, in many places:
    <xs:element ref="common:Link" minOccurs="0" maxOccurs="unbounded"/>
    
    In other words, there can be arbitrarily many <com:Link> elements within a parent element representing an IdentifiableArtefact

Generally, "URN" and "URL" are both subcategories of "URI".

There are multiple things to clarify here:

  1. Is IdentifiableArtefact.uri supposed to be, per its name, any URI (so possibly a URL or URN) or only (per its type) a URL?
  2. Is a <com:Link url="…" rel="self"> supposed to correspond to IdentifiableArtefact.uri?
  3. Is SDMX-ML that contains multiple <com:Link> (as allowed by the XSD) valid? Which should correspond to IdentifiableArtefact.uri?
  4. Is the IMF usage valid in which a URN, not a URL, appears in the url="…" attribute?

Pending clarification, #227 ignores <com:Link> with a log message.

khaeru avatar Mar 04 '25 16:03 khaeru

While I think these are good to clarify, as far as the IMF endpoint, we are planning to remove the generation of the link attribute as part of our responses. Valid or not repeating the URN doesn't seem to add any value.

aboddie avatar Mar 21 '25 18:03 aboddie