Changes for page 10 Constraints

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

From version 14.2
edited by Helena
on 2025/05/16 12:20
Change comment: There is no comment for this version
To version 12.1
edited by Helena
on 2025/05/15 15:48
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,6 +1,4 @@
1 -{{box title="**Contents**"}}
2 -{{toc/}}
3 -{{/box}}
1 += 10 Constraints =
4 4  
5 5  == 10.1 Introduction ==
6 6  
... ... @@ -82,7 +82,7 @@
82 82  
83 83  There can be many Constraints for any Constrainable Artefact (e.g., DSD), subject to the following restrictions:
84 84  
85 -==== 10.3.2.1 Cube Region ====
83 +**10.3.2.1 Cube Region**
86 86  
87 87  A Constraint can contain multiple Member Selections (e.g., Dimensions).
88 88  
... ... @@ -92,7 +92,7 @@
92 92  * 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.
93 93  * 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.
94 94  
95 -==== 10.3.2.2 Key Set ====
93 +**10.3.2.2 Key Set**
96 96  
97 97  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").
98 98  
... ... @@ -104,7 +104,7 @@
104 104  
105 105  === 10.3.3 Inheritance of a Constraint ===
106 106  
107 -==== 10.3.3.1 Attachment levels of a Constraint ====
105 +**10.3.3.1 Attachment levels of a Constraint**
108 108  
109 109  There are three levels of constraint attachment for which these inheritance rules apply:
110 110  
... ... @@ -116,13 +116,13 @@
116 116  
117 117  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.
118 118  
119 -==== 10.3.3.2 Cascade rules for processing Constraints ====
117 +**10.3.3.2 Cascade rules for processing Constraints**
120 120  
121 121  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.
122 122  
123 123  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.
124 124  
125 -==== 10.3.3.3 Cube Region ====
123 +**10.3.3.3 Cube Region**
126 126  
127 127  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:
128 128  
... ... @@ -133,7 +133,7 @@
133 133  
134 134  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.
135 135  
136 -==== 10.3.3.4 Key Set ====
134 +**10.3.3.4 Key Set**
137 137  
138 138  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:
139 139  
... ... @@ -146,7 +146,7 @@
146 146  
147 147  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.
148 148  
149 -*
147 +*
150 150  *1. Determine all possible keys that are valid at the higher level.
151 151  *1. These keys are deemed to be inherited by the lower-level constrained object, subject to the Constraints specified at the lower level.
152 152  *1. Determine all possible keys that are possible using the Constraints specified at the lower level.
... ... @@ -155,10 +155,8 @@
155 155  
156 156  === 10.3.4 Constraints Examples ===
157 157  
158 -==== 10.3.4.1 Data Constraint and Cascading ====
156 +**10.3.4.1 Data Constraint and Cascading **The following scenario is used.
159 159  
160 -The following scenario is used.
161 -
162 162  A DSD contains the following Dimensions:
163 163  
164 164  * GEO – Geography
... ... @@ -170,10 +170,8 @@
170 170  
171 171  [[image:SDMX 3-0-0 SECTION 6 FINAL-1.0_en_77bea5e.png||height="344" width="554"]]
172 172  
173 -**Figure 20: Example Scenario for Constraints **
169 +**Figure 20: Example Scenario for Constraints **Constraints are declared as follows:
174 174  
175 -Constraints are declared as follows:
176 -
177 177  [[image:SDMX 3-0-0 SECTION 6 FINAL-1.0_en_7c36c475.png||height="356" width="541"]]
178 178  
179 179  **Figure 21: Example Constraints**
... ... @@ -215,62 +215,187 @@
215 215  
216 216  DSD Constraint
217 217  
218 -[[image:1747386911707-332.png]]
212 +**<str:DataConstraint agencyID="SDMX" id="DATA_CONSTRAINT" version="1.0.0draft" type="Allowed">**
219 219  
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 +
220 220  Dataflow Constraints
221 221  
222 -[[image:1747386933952-158.png]]
240 +**<str:DataConstraint agencyID="SDMX" id="DATA_CONSTRAINT_2" version="1.0.0draft" type="Allowed">**
223 223  
224 -[[image:1747386970127-658.png]]
242 +**<com:Name xml:lang="en">SDMX 3.0 Data Constraint sample</com:Name>**
225 225  
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 +
226 226  Provision Agreement Constraint
227 227  
228 -[[image:1747386991329-805.png]]
302 +**<str:DataConstraint agencyID="SDMX" id="DATA_CONSTRAINT_4" version="1.0.0draft" type="Allowed">**
229 229  
230 -==== 10.3.4.2 Combination of Constraints ====
304 +**<com:Name xml:lang="en">SDMX 3.0 Data Constraint sample</com:Name>**
231 231  
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 +
232 232  The possible combination of constraining terms are explained in this section, following a few examples.
233 233  
234 234  Let’s assume a DSD with the following Components:
235 235  
236 -[[image:1747387057775-838.png]]
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
237 237  
238 -[[image:1747387089210-741.png]]
239 -
240 240  On the above, let’s assume the following use cases with their constraining requirements:
241 241  
242 -===== 10.3.4.2.1 Use Case 1: A Constraint on allowed values for some Dimensions =====
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**//
243 243  
244 244  R1: Allow monthly and quarterly data
357 +
245 245  R2: Allow Mexico for vis-à-vis country
246 246  
247 247  This is expressed with the following CubeRegion:
248 248  
249 -[[image:1747387154981-708.png]]
362 +|FREQ|M, Q
363 +|VIS_CTY|MX
250 250  
251 -===== 10.3.4.2.2 Use Case 2: A Constraint on allowed combinations for some Dimensions =====
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**//
252 252  
253 253  R1: Allow monthly data for Germany
368 +
254 254  R2: Allow quarterly data for Mexico
255 255  
256 256  This is expressed with the following DataKeySet:
257 257  
258 -[[image:1747387188821-467.png]]
373 +|(% rowspan="2" %)Key1|FREQ|M
374 +|VIS_CTY|DE
375 +|(% rowspan="2" %)Key2|FREQ|Q
376 +|VIS_CTY|MX
259 259  
260 -===== 0.3.4.2.3 Use Case 3: A Constraint on allowed values for some Dimensions combined with allowed values for some Attributes =====
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**//
261 261  
262 262  R1: Allow monthly and quarterly data
381 +
263 263  R2: Allow Mexico for vis-à-vis country
383 +
264 264  R3: Allow present for status
265 265  
266 266  This may be expressed with the following CubeRegion:
267 267  
268 -
269 269  |FREQ|M, Q
270 270  |VIS_CTY|MX
271 271  |OBS_STATUS|A
272 272  
273 -===== 10.3.4.2.4 Use Case 4: A Constraint on allowed combinations for some =====
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**//
274 274  
275 275  //**Dimensions combined with specific Attribute values**//
276 276  
... ... @@ -280,14 +280,14 @@
280 280  
281 281  This is may be expressed with the following DataKeySet:
282 282  
283 -|(% rowspan="3" style="width:87px" %)Key1|(% style="width:1327px" %)FREQ|M
284 -|(% style="width:1327px" %)VIS_CTY|DE
285 -|(% style="width:1327px" %)UNIT|EUR
286 -|(% rowspan="3" style="width:87px" %)Key2|(% style="width:1327px" %)FREQ|Q
287 -|(% style="width:1327px" %)VIS_CTY|MX
288 -|(% style="width:1327px" %)UNIT|USD
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
289 289  
290 -===== 10.3.4.2.5 Use Case 5: A Constraint on allowed values for some Dimensions together with some combination of Dimension values =====
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**//
291 291  
292 292  R1: For annually and quarterly data, for Mexico and Germany, only A status is allowed
293 293  
... ... @@ -324,7 +324,7 @@
324 324  |VIS_CTY|MX, DE
325 325  |OBS_STATUS|A
326 326  
327 -===== 10.3.4.2.6 Use case 6: A Constraint on allowed values for some Dimensions combined with allowed values for Measures =====
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**//
328 328  
329 329  R1: Allow monthly data, for Germany, with unit euro, and measure choice is 'A'
330 330  
... ... @@ -339,7 +339,7 @@
339 339  |UNIT|USD
340 340  |CHOICE|B
341 341  
342 -===== 10.3.4.2.7 Use Case 7: A Constraint with wildcards for Codes and removePrefix property =====
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**//
343 343  
344 344  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.
345 345  
... ... @@ -354,7 +354,7 @@
354 354  |FREQ|M, Q
355 355  |VIS_CTY (removePrefix=’AREA_’)|M%
356 356  
357 -===== 10.3.4.2.Use Case 8: A Constraint with multilingual support on Attributes =====
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**//
358 358  
359 359  R1: Allow monthly and quarterly data
360 360  
... ... @@ -368,7 +368,7 @@
368 368  |VIS_CTY|MX
369 369  |COMMENT (lang=’en’)|%adjusted%
370 370  
371 -===== 10.3.4.2.Use Case 9: A Constraint on allowed values for Dimensions combined with allowed values for Metadata Attributes =====
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**//
372 372  
373 373  R1: Allow monthly and quarterly data
374 374  
... ... @@ -382,7 +382,7 @@
382 382  |VIS_CTY|MX
383 383  |CONTACT|John Doe
384 384  
385 -==== 10.3.4.3 Other constraining terms ====
504 +**10.3.4.3 Other constraining terms**
386 386  
387 387  Beyond the cube regions and keysets, there is one more constraining term, i.e., the ReleaseCalendar.
388 388  
1747386911707-332.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.helena
Size
... ... @@ -1,1 +1,0 @@
1 -47.1 KB
Content
1747386933952-158.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.helena
Size
... ... @@ -1,1 +1,0 @@
1 -35.3 KB
Content
1747386970127-658.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.helena
Size
... ... @@ -1,1 +1,0 @@
1 -59.4 KB
Content
1747386991329-805.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.helena
Size
... ... @@ -1,1 +1,0 @@
1 -56.5 KB
Content
1747387057775-838.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.helena
Size
... ... @@ -1,1 +1,0 @@
1 -13.1 KB
Content
1747387089210-741.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.helena
Size
... ... @@ -1,1 +1,0 @@
1 -8.3 KB
Content
1747387135817-339.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.helena
Size
... ... @@ -1,1 +1,0 @@
1 -3.8 KB
Content
1747387154981-708.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.helena
Size
... ... @@ -1,1 +1,0 @@
1 -3.8 KB
Content
1747387188821-467.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.helena
Size
... ... @@ -1,1 +1,0 @@
1 -8.2 KB
Content
SDMX 3-0-0 SECTION 6 FINAL-1.0_en_7e57ad28.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.helena
Size
... ... @@ -1,1 +1,0 @@
1 -1.7 KB
Content