Changes for page 10 Constraints

Last modified by Helena on 2025/09/10 11:19

From version 11.1
edited by Helena
on 2025/05/15 15:48
Change comment: There is no comment for this version
To version 14.3
edited by Helena
on 2025/05/16 12:21
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,4 +1,6 @@
1 -= 10 Constraints =
1 +{{box title="**Contents**"}}
2 +{{toc/}}
3 +{{/box}}
2 2  
3 3  == 10.1 Introduction ==
4 4  
... ... @@ -80,7 +80,7 @@
80 80  
81 81  There can be many Constraints for any Constrainable Artefact (e.g., DSD), subject to the following restrictions:
82 82  
83 -**10.3.2.1 Cube Region**
85 +==== 10.3.2.1 Cube Region ====
84 84  
85 85  A Constraint can contain multiple Member Selections (e.g., Dimensions).
86 86  
... ... @@ -90,7 +90,7 @@
90 90  * A Member Selection may include wildcarding of values (using character ‘%’ to represent zero or more occurrences of any character), as well as cascading through hierarchic structures (e.g., parents in Codelist), or localised values (e.g., text for English only). Lack of locale means any language may match. Cascading values are mutual exclusive to localised values, as the former refer to coded values, while the latter refer to uncoded values.
91 91  * Any values included in a Member Selection for Components with an array data type (i.e., Measures, Attributes or Metadata Attributes), will be applied as single values and will not be assessed combined with other values to match all possible array values. For example, including the Code ‘A’ for an Attribute will allow any instance of the Attribute that includes ‘A’, like [‘A’, ‘B’] or [‘A’, ‘C’, ‘D’]. Similarly, if Code ‘A’ was excluded, all those arrays of values would also be excluded.
92 92  
93 -**10.3.2.2 Key Set**
95 +==== 10.3.2.2 Key Set ====
94 94  
95 95  Key Sets will be processed in the order they appear in the Constraint and wildcards can be used (e.g., any key position not reference explicitly is deemed to be "all values").
96 96  
... ... @@ -102,7 +102,7 @@
102 102  
103 103  === 10.3.3 Inheritance of a Constraint ===
104 104  
105 -**10.3.3.1 Attachment levels of a Constraint**
107 +==== 10.3.3.1 Attachment levels of a Constraint ====
106 106  
107 107  There are three levels of constraint attachment for which these inheritance rules apply:
108 108  
... ... @@ -114,13 +114,13 @@
114 114  
115 115  It is not necessary for a Constraint to be attached to a higher level artefact. e.g., it is valid to have a Constraint for a Provision Agreement where there are no constraints attached the relevant dataflow or DSD.
116 116  
117 -**10.3.3.2 Cascade rules for processing Constraints**
119 +==== 10.3.3.2 Cascade rules for processing Constraints ====
118 118  
119 119  The processing of the constraints on either Dataflow/Metadataflow or Provision Agreement must take into account the constraints declared at higher levels. The rules for the lower-level constraints (attached to Dataflow/ Metadataflow and Provision Agreement) are detailed below.
120 120  
121 121  Note that there can be a situation where a constraint is specified at a lower level before a constraint is specified at a higher level. Therefore, it is possible that a higher-level constraint makes a lower-level constraint invalid. SDMX makes no rules on how such a conflict should be handled when processing the constraint for attachment. However, the cascade rules on evaluating constraints for usage are clear – the higher-level constraint takes precedence in any conflicts that result in a less restrictive specification at the lower level.
122 122  
123 -**10.3.3.3 Cube Region**
125 +==== 10.3.3.3 Cube Region ====
124 124  
125 125  It is not necessary to have a Constraint on the higher-level artefact (e.g., DSD referenced by the Dataflow), but if there is such a Constraint at the higher level(s) then:
126 126  
... ... @@ -131,7 +131,7 @@
131 131  
132 132  Note that it is possible for a Constraint at a higher level to constrain, say, four Dimensions in a single Constraint, and a Constraint at a lower level to constrain the same four in two, three, or four Constraints.
133 133  
134 -**10.3.3.4 Key Set**
136 +==== 10.3.3.4 Key Set ====
135 135  
136 136  It is not necessary to have a Constraint on the higher-level artefact (e.g., DSD referenced by the Dataflow), but if there is such a Constraint at the higher level(s) then:
137 137  
... ... @@ -144,7 +144,7 @@
144 144  
145 145  The following logic explains how the inheritance mechanism works. Note that this is conceptual logic and actual systems may differ in the way this is implemented.
146 146  
147 -*
149 +*
148 148  *1. Determine all possible keys that are valid at the higher level.
149 149  *1. These keys are deemed to be inherited by the lower-level constrained object, subject to the Constraints specified at the lower level.
150 150  *1. Determine all possible keys that are possible using the Constraints specified at the lower level.
... ... @@ -153,8 +153,10 @@
153 153  
154 154  === 10.3.4 Constraints Examples ===
155 155  
156 -**10.3.4.1 Data Constraint and Cascading **The following scenario is used.
158 +==== 10.3.4.1 Data Constraint and Cascading ====
157 157  
160 +The following scenario is used.
161 +
158 158  A DSD contains the following Dimensions:
159 159  
160 160  * GEO – Geography
... ... @@ -166,8 +166,10 @@
166 166  
167 167  [[image:SDMX 3-0-0 SECTION 6 FINAL-1.0_en_77bea5e.png||height="344" width="554"]]
168 168  
169 -**Figure 20: Example Scenario for Constraints **Constraints are declared as follows:
173 +**Figure 20: Example Scenario for Constraints **
170 170  
175 +Constraints are declared as follows:
176 +
171 171  [[image:SDMX 3-0-0 SECTION 6 FINAL-1.0_en_7c36c475.png||height="356" width="541"]]
172 172  
173 173  **Figure 21: Example Constraints**
... ... @@ -209,217 +209,77 @@
209 209  
210 210  DSD Constraint
211 211  
212 -**<str:DataConstraint agencyID="SDMX" id="DATA_CONSTRAINT" version="1.0.0draft" type="Allowed">**
218 +[[image:1747386911707-332.png]]
213 213  
214 -**<com:Name xml:lang="en">SDMX 3.0 Data Constraint sample</com:Name>**
215 -
216 -**<str:ConstraintAttachment>**
217 -
218 -**<str:DataStructure>urn:sdmx:org.sdmx.infomodel.datastructure.**
219 -
220 -**DataStructure=CENSUSHUB:CENSUS(1.0.0)</str:DataStructure>**
221 -
222 -**</str:ConstraintAttachment>**
223 -
224 -**<str:CubeRegion include="true">**
225 -
226 -**<!~-~- the ability to exclude values is illustrated – i.e., all values valid except this one ~-~->**
227 -
228 -**<com:KeyValue id="AGE" include="false">**
229 -
230 -**<com:Value>001</com:Value>**
231 -
232 -**</com:KeyValue>**
233 -
234 -**</str:CubeRegion>**
235 -
236 -**</str:DataConstraint>**
237 -
238 238  Dataflow Constraints
239 239  
240 -**<str:DataConstraint agencyID="SDMX" id="DATA_CONSTRAINT_2" version="1.0.0draft" type="Allowed">**
222 +[[image:1747386933952-158.png]]
241 241  
242 -**<com:Name xml:lang="en">SDMX 3.0 Data Constraint sample</com:Name>**
224 +[[image:1747386970127-658.png]]
243 243  
244 -**<str:ConstraintAttachment>**
245 -
246 -**<str:Dataflow>urn:sdmx:org.sdmx.infomodel.datastructure.Dataflow=**
247 -
248 -**CENSUSHUB:CENSUS_CUBE1(1.0.0)</str:Dataflow>**
249 -
250 -**</str:ConstraintAttachment>**
251 -
252 -**<str:CubeRegion include="true">**
253 -
254 -**<com:KeyValue id="AGE" include="true">**
255 -
256 -**<com:Value>002</com:Value>**
257 -
258 -**<com:Value>003</com:Value>**
259 -
260 -**</com:KeyValue>**
261 -
262 -**<com:KeyValue id="CAS">**
263 -
264 -**<com:Value>003</com:Value>**
265 -
266 -**<com:Value>004</com:Value>**
267 -
268 -**</com:KeyValue>**
269 -
270 -**</str:CubeRegion>**
271 -
272 -**</str:DataConstraint>**
273 -
274 -**<str:DataConstraint agencyID="SDMX" id="DATA_CONSTRAINT_3" version="1.0.0draft" type="Allowed">**
275 -
276 -**<com:Name xml:lang="en">SDMX 3.0 Data Constraint sample</com:Name>**
277 -
278 -**<str:ConstraintAttachment>**
279 -
280 -**<str:Dataflow>urn:sdmx:org.sdmx.infomodel.datastructure.Dataflow=**
281 -
282 -**CENSUSHUB:CENSUS_CUBE2(1.0.0)</str:Dataflow>**
283 -
284 -**</str:ConstraintAttachment>**
285 -
286 -**<str:CubeRegion include="true">**
287 -
288 -**<com:KeyValue id="CAS" include="true">**
289 -
290 -**<com:Value>TOT</com:Value>**
291 -
292 -**<com:Value>NAP</com:Value>**
293 -
294 -**</com:KeyValue>**
295 -
296 -**</str:CubeRegion>**
297 -
298 -**</str:DataConstraint>**
299 -
300 300  Provision Agreement Constraint
301 301  
302 -**<str:DataConstraint agencyID="SDMX" id="DATA_CONSTRAINT_4" version="1.0.0draft" type="Allowed">**
228 +[[image:1747386991329-805.png]]
303 303  
304 -**<com:Name xml:lang="en">SDMX 3.0 Data Constraint sample</com:Name>**
230 +==== 10.3.4.2 Combination of Constraints ====
305 305  
306 -**<str:ConstraintAttachment>**
307 -
308 -**<str:ProvisionAgreement>urn:sdmx:org.sdmx.infomodel.registry.**
309 -
310 -**ProvisionAgreement=CENSUSHUB:CENSUS_CUBE1_IT(1.0.0)**
311 -
312 -**</str:ProvisionAgreement>**
313 -
314 -**<str:ProvisionAgreement>urn:sdmx:org.sdmx.infomodel.registry.**
315 -
316 -**ProvisionAgreement=CENSUSHUB:CENSUS_CUBE2_IT(1.0.0)**
317 -
318 -**</str:ProvisionAgreement>**
319 -
320 -**</str:ConstraintAttachment>**
321 -
322 -**<str:CubeRegion include="true">**
323 -
324 -**<com:KeyValue id="GEO" include="true">**
325 -
326 -**<com:Value cascadeValues="true">IT</com:Value>**
327 -
328 -**</com:KeyValue>**
329 -
330 -**</str:CubeRegion>**
331 -
332 -**</str:DataConstraint**
333 -
334 -**10.3.4.2 Combination of Constraints**
335 -
336 336  The possible combination of constraining terms are explained in this section, following a few examples.
337 337  
338 338  Let’s assume a DSD with the following Components:
339 339  
340 -|Dimension|FREQ
341 -|Dimension|JD_TYPE
342 -|Dimension|JD_CATEGORY
343 -|Dimension|VIS_CTY
344 -|TimeDimension|TIME_PERIOD
345 -|Attribute|OBS_STATUS
346 -|Attribute|UNIT
347 -|Attribute|COMMENT
348 -|MetadataAttribute|CONTACT
349 -|Measure|MULTISELECT
350 -|Measure|CHOICE
236 +[[image:1747387057775-838.png]]
351 351  
238 +[[image:1747387089210-741.png]]
239 +
352 352  On the above, let’s assume the following use cases with their constraining requirements:
353 353  
354 -[[image:SDMX 3-0-0 SECTION 6 FINAL-1.0_en_6b13e05d.png||height="12" width="62"]] //**Use Case 1: A Constraint on allowed values for some Dimensions**//
242 +===== 10.3.4.2.1 Use Case 1: A Constraint on allowed values for some Dimensions =====
355 355  
356 356  R1: Allow monthly and quarterly data
357 -
358 358  R2: Allow Mexico for vis-à-vis country
359 359  
360 360  This is expressed with the following CubeRegion:
361 361  
362 -|FREQ|M, Q
363 -|VIS_CTY|MX
249 +[[image:1747387154981-708.png]]
364 364  
365 -[[image:SDMX 3-0-0 SECTION 6 FINAL-1.0_en_18c3726e.png||height="12" width="64"]] //**Use Case 2: A Constraint on allowed combinations for some Dimensions**//
251 +===== 10.3.4.2.2 Use Case 2: A Constraint on allowed combinations for some Dimensions =====
366 366  
367 367  R1: Allow monthly data for Germany
368 -
369 369  R2: Allow quarterly data for Mexico
370 370  
371 371  This is expressed with the following DataKeySet:
372 372  
373 -|(% rowspan="2" %)Key1|FREQ|M
374 -|VIS_CTY|DE
375 -|(% rowspan="2" %)Key2|FREQ|Q
376 -|VIS_CTY|MX
258 +[[image:1747387188821-467.png]]
377 377  
378 -[[image:SDMX 3-0-0 SECTION 6 FINAL-1.0_en_8d48dc1a.png||height="12" width="64"]] //**Use Case 3: A Constraint on allowed values for some Dimensions combined with allowed values for some Attributes**//
260 +===== 0.3.4.2.3 Use Case 3: A Constraint on allowed values for some Dimensions combined with allowed values for some Attributes =====
379 379  
380 380  R1: Allow monthly and quarterly data
381 -
382 382  R2: Allow Mexico for vis-à-vis country
383 -
384 384  R3: Allow present for status
385 385  
386 386  This may be expressed with the following CubeRegion:
387 387  
388 -|FREQ|M, Q
389 -|VIS_CTY|MX
390 -|OBS_STATUS|A
268 +[[image:1747387231598-634.png]]
391 391  
392 -[[image:SDMX 3-0-0 SECTION 6 FINAL-1.0_en_a0d353e8.png||height="12" width="64"]] //**Use Case 4: A Constraint on allowed combinations for some**//
270 +===== 10.3.4.2.4 Use Case 4: A Constraint on allowed combinations for some =====
393 393  
394 394  //**Dimensions combined with specific Attribute values**//
395 395  
396 396  R1: Allow monthly data, for Germany, with unit euro
397 -
398 398  R2: Allow quarterly data, for Mexico, with unit usd
399 399  
400 400  This is may be expressed with the following DataKeySet:
401 401  
402 -|(% rowspan="3" %)Key1|FREQ|M
403 -|VIS_CTY|DE
404 -|UNIT|EUR
405 -|(% rowspan="3" %)Key2|FREQ|Q
406 -|VIS_CTY|MX
407 -|UNIT|USD
279 +[[image:1747387252077-954.png]]
408 408  
409 -[[image:SDMX 3-0-0 SECTION 6 FINAL-1.0_en_6e97b73c.png||height="12" width="64"]] //**Use Case 5: A Constraint on allowed values for some Dimensions together with some combination of Dimension values**//
281 +===== 10.3.4.2.5 Use Case 5: A Constraint on allowed values for some Dimensions together with some combination of Dimension values =====
410 410  
411 411  R1: For annually and quarterly data, for Mexico and Germany, only A status is allowed
412 -
413 413  R2: For monthly data, for Mexico and Germany, only F status is allowed
414 414  
415 415  Considering the above examples, the following CubeRegions would be created:
416 416  
417 -|(% rowspan="3" %)CubeRegion1|FREQ|Q, A
418 -|VIS_CTY|MX, DE
419 -|OBS_STATUS|A
420 -|(% rowspan="3" %)CubeRegion2|FREQ|M
421 -|VIS_CTY|MX, DE
422 -|OBS_STATUS|F
288 +[[image:1747387281625-859.png]]
423 423  
424 424  The problem with this approach is that according to the business rule for Constraints, only one should be specified per Component. Thus, if a software would perform some conflict resolution would end up with empty sets for FREQ and OBS_STATUS (as they do not share any values).
425 425  
... ... @@ -427,24 +427,12 @@
427 427  
428 428  DSD CubeRegion:
429 429  
430 -|FREQ|M, Q, A
431 -|VIS_CTY|MX, DE
432 -|OBS_STATUS|A, F
433 -
434 434  Dataflow1 CubeRegion:
435 435  
436 -|FREQ|Q, A
437 -|VIS_CTY|MX, DE
438 -|OBS_STATUS|F
439 -
440 440  Dataflow2 CubeRegion:
441 441  
442 -|FREQ|M
443 -|VIS_CTY|MX, DE
444 -|OBS_STATUS|A
300 +===== 10.3.4.2.6 Use case 6: A Constraint on allowed values for some Dimensions combined with allowed values for Measures =====
445 445  
446 -[[image:SDMX 3-0-0 SECTION 6 FINAL-1.0_en_b4693e0d.png||height="12" width="64"]] //**Use case 6: A Constraint on allowed values for some Dimensions combined with allowed values for Measures**//
447 -
448 448  R1: Allow monthly data, for Germany, with unit euro, and measure choice is 'A'
449 449  
450 450  R2: Allow quarterly data, for Mexico, with unit usd, and measure choice is 'B' This is may be expressed with the following DataKeySet:
... ... @@ -458,7 +458,7 @@
458 458  |UNIT|USD
459 459  |CHOICE|B
460 460  
461 -[[image:SDMX 3-0-0 SECTION 6 FINAL-1.0_en_9818c7f7.png||height="12" width="64"]] //**Use Case 7: A Constraint with wildcards for Codes and removePrefix property**//
315 +===== 10.3.4.2.7 Use Case 7: A Constraint with wildcards for Codes and removePrefix property =====
462 462  
463 463  For this example, we assume that the VIS_CTY representation has been prefixed with prefix ‘AREA_’. In this Constraint, we need to remove the prefix.
464 464  
... ... @@ -473,7 +473,7 @@
473 473  |FREQ|M, Q
474 474  |VIS_CTY (removePrefix=’AREA_’)|M%
475 475  
476 -[[image:SDMX 3-0-0 SECTION 6 FINAL-1.0_en_7df2eea7.png||height="12" width="64"]] //**Use Case 8: A Constraint with multilingual support on Attributes**//
330 +===== 10.3.4.2.8 Use Case 8: A Constraint with multilingual support on Attributes =====
477 477  
478 478  R1: Allow monthly and quarterly data
479 479  
... ... @@ -487,7 +487,7 @@
487 487  |VIS_CTY|MX
488 488  |COMMENT (lang=’en’)|%adjusted%
489 489  
490 -[[image:SDMX 3-0-0 SECTION 6 FINAL-1.0_en_7e57ad28.png||height="12" width="64"]] //**Use Case 9: A Constraint on allowed values for Dimensions combined with allowed values for Metadata Attributes**//
344 +===== 10.3.4.2.9 Use Case 9: A Constraint on allowed values for Dimensions combined with allowed values for Metadata Attributes =====
491 491  
492 492  R1: Allow monthly and quarterly data
493 493  
... ... @@ -501,7 +501,7 @@
501 501  |VIS_CTY|MX
502 502  |CONTACT|John Doe
503 503  
504 -**10.3.4.3 Other constraining terms**
358 +==== 10.3.4.3 Other constraining terms ====
505 505  
506 506  Beyond the cube regions and keysets, there is one more constraining term, i.e., the ReleaseCalendar.
507 507  
1747386911707-332.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.helena
Size
... ... @@ -1,0 +1,1 @@
1 +47.1 KB
Content
1747386933952-158.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.helena
Size
... ... @@ -1,0 +1,1 @@
1 +35.3 KB
Content
1747386970127-658.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.helena
Size
... ... @@ -1,0 +1,1 @@
1 +59.4 KB
Content
1747386991329-805.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.helena
Size
... ... @@ -1,0 +1,1 @@
1 +56.5 KB
Content
1747387057775-838.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.helena
Size
... ... @@ -1,0 +1,1 @@
1 +13.1 KB
Content
1747387089210-741.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.helena
Size
... ... @@ -1,0 +1,1 @@
1 +8.3 KB
Content
1747387135817-339.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.helena
Size
... ... @@ -1,0 +1,1 @@
1 +3.8 KB
Content
1747387154981-708.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.helena
Size
... ... @@ -1,0 +1,1 @@
1 +3.8 KB
Content
1747387188821-467.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.helena
Size
... ... @@ -1,0 +1,1 @@
1 +8.2 KB
Content
1747387231598-634.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.helena
Size
... ... @@ -1,0 +1,1 @@
1 +6.2 KB
Content
1747387252077-954.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.helena
Size
... ... @@ -1,0 +1,1 @@
1 +5.1 KB
Content
1747387281625-859.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.helena
Size
... ... @@ -1,0 +1,1 @@
1 +6.0 KB
Content
SDMX 3-0-0 SECTION 6 FINAL-1.0_en_18c3726e.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.helena
Size
... ... @@ -1,0 +1,1 @@
1 +1.7 KB
Content
SDMX 3-0-0 SECTION 6 FINAL-1.0_en_7e57ad28.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.helena
Size
... ... @@ -1,0 +1,1 @@
1 +1.7 KB
Content