sdmx-twg / sdmx-im

SDMX Information Model - UML model and functional description, definition of classes, associations and attributes
6 stars 3 forks source link

Identifiable Codelist subsets (sub-domains) #9

Closed Tzaphkiel closed 6 months ago

Tzaphkiel commented 4 years ago

The possibility of defining sub-domains (subsets of a Codelist) of a particular domain (Codelist) and being able to refer to it is very appealing and eases modeling in many situations.

This issue may be related to #2 in the sense that a subset could potentially be used to define a new codelist extension.

The HCL are not to be used for this as what we intend to model is not a hierarchy of any kind but individual groups with no hierarchical relations to each other.

stratosn commented 6 months ago

The Codelist extension/composition (as described #2) covers this use case by inheriting a Codelist and removing Codes from it. This can be achieved by creating a new Codelist and using the ExclusiveCodeSelection to exclude all Codes that are going to be removed from the Codelist that is extended, eg in SDMX-ML:

<str:CodelistExtension>
    <str:Codelist>urn:sdmx:org.sdmx.infomodel.codelist.Codelist=SDMX:CL2(1.0.0)</str:Codelist>
    <str:ExclusiveCodeSelection>
        <str:MemberValue>A</str:MemberValue>
        <str:MemberValue>B</str:MemberValue>
    </str:ExclusiveCodeSelection>
</str:CodelistExtension>

The equivalent for Json is exclusiveCodeSelection, ie:

"codelistExtensions":[
  {
    "codelist":"urn:sdmx:org.sdmx.infomodel.codelist.Codelist=SDMX:CL2(1.0.0)",
    "exclusiveCodeSelection":{
      "memberValues":[
        "A", "B"
      ]
    }
  }
]