sdmx-twg / sdmx-im

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

DSD: Infomodel contradiction between minOccurs and usageType #26

Closed buhaiovos closed 3 weeks ago

buhaiovos commented 1 year ago

Hello!

Working with the Infomodel, we have stumbled upon one particular thing:

image

IM describes (section 5.3) data attributes and measures of DSD having both minOccurs/maxOccurs and usage attributes. And it's the usage attribute which dictates whether the measure (or data attribute) is mandatory. But the question which arises, is how implementors should handle situations when there is a structure which declares, say, minOccurs=0 and usage=mandatory? They seem to contradict to each other.

At the same time, in the description of metadata structure definition - metadata attributes specifically, there is no usage property and the requirement of the attribute is derived from the minOccurs value, i.e 0 standing for optional and >=1 standing for mandatory. Should DSD be similar to this?

Thanks!

stratosn commented 6 months ago

Dear @buhaiovos thanks for the questions and apologies for the long turnaround.

As regards the first issue, the point of having both usage and minOccurs is required for the use-cases were a Measure or Attribute has to be reported by a minimum set of occurrences regardless of the need or not to report it. While the minOccurs=0 + usage=mandatory may seem a bit strange (but has to be handled at a business rule level), the minOccurs=3 + usage=Optional would not be possible otherwise.

As regards the reference metadata, the case is a bit different compared to the data, since MetadataAttributes can also contain other MetadataAttributes (which is not the case for data Attributes and Measures), thus it would not be possible to implement it the same way as for data. This means that the same can be implemented a bit differently in metadatasets (which was already there before even introducing multiple values for Attributes/Measures in datasets).

tmartine commented 6 months ago

Hi! I know I should panic but I tried finding you on confluence. Do you need me to add you on my reminder ? I seriously have no way of knowing if you want to be credited for your invisible presence or not.. I it makes me panic. Could you please tell me what you think ? Best

Martine Tchitchihe 612 402 1978 ''L’école est une clef pour la vie" Baba Simon "Teachers plant seeds of knowledge that last a lifetime"

On Wed, Dec 20, 2023 at 10:41 AM Stratos Nikoloutsos < @.***> wrote:

Dear @buhaiovos https://github.com/buhaiovos thanks for the questions and apologies for the long turnaround.

As regards the first issue, the point of having both usage and minOccurs is required for the use-cases were a Measure or Attribute has to be reported by a minimum set of occurrences regardless of the need or not to report it. While the minOccurs=0 + usage=mandatory may seem a bit strange (but has to be handled at a business rule level), the minOccurs=3 + usage=Optional would not be possible otherwise.

As regards the reference metadata, the case is a bit different compared to the data, since MetadataAttributes can also contain other MetadataAttributes (which is not the case for data Attributes and Measures), thus it would not be possible to implement it the same way as for data. This means that the same can be implemented a bit differently in metadatasets (which was already there before even introducing multiple values for Attributes/Measures in datasets).

— Reply to this email directly, view it on GitHub https://github.com/sdmx-twg/sdmx-im/issues/26#issuecomment-1864705105, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJYBVLINJPQCK6LQ5SIG3LTYKMBJBAVCNFSM6AAAAAAXC2HKX6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRUG4YDKMJQGU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

stratosn commented 3 weeks ago

Considered as solved, following the acceptance by the author.