Changes for page 10 Constraints
Last modified by Helena on 2025/09/10 11:19
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Attachments (0 modified, 0 added, 13 removed)
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,79 +215,217 @@ 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.2CombinationofConstraints====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.1Use 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.2Use 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.3Use 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 -[[image:1747387231598-634.png]] 388 +|FREQ|M, Q 389 +|VIS_CTY|MX 390 +|OBS_STATUS|A 269 269 270 - =====10.3.4.2.4Use 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**// 271 271 272 272 //**Dimensions combined with specific Attribute values**// 273 273 274 274 R1: Allow monthly data, for Germany, with unit euro 397 + 275 275 R2: Allow quarterly data, for Mexico, with unit usd 276 276 277 277 This is may be expressed with the following DataKeySet: 278 278 279 -[[image:1747387252077-954.png]] 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 280 280 281 -[[image: 1747387281625-859.png]]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**// 282 282 283 -===== 10.3.4.2.5 Use Case 5: A Constraint on allowed values for some Dimensions together with some combination of Dimension values ===== 284 - 285 285 R1: For annually and quarterly data, for Mexico and Germany, only A status is allowed 412 + 286 286 R2: For monthly data, for Mexico and Germany, only F status is allowed 287 287 288 288 Considering the above examples, the following CubeRegions would be created: 289 289 290 -[[image:1747387330751-405.png]] 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 291 291 292 292 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). 293 293 ... ... @@ -295,17 +295,39 @@ 295 295 296 296 DSD CubeRegion: 297 297 430 +|FREQ|M, Q, A 431 +|VIS_CTY|MX, DE 432 +|OBS_STATUS|A, F 433 + 298 298 Dataflow1 CubeRegion: 299 299 436 +|FREQ|Q, A 437 +|VIS_CTY|MX, DE 438 +|OBS_STATUS|F 439 + 300 300 Dataflow2 CubeRegion: 301 301 302 -===== 10.3.4.2.6 Use case 6: A Constraint on allowed values for some Dimensions combined with allowed values for Measures ===== 442 +|FREQ|M 443 +|VIS_CTY|MX, DE 444 +|OBS_STATUS|A 303 303 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 + 304 304 R1: Allow monthly data, for Germany, with unit euro, and measure choice is 'A' 449 + 305 305 R2: Allow quarterly data, for Mexico, with unit usd, and measure choice is 'B' This is may be expressed with the following DataKeySet: 306 306 307 -===== 10.3.4.2.7 Use Case 7: A Constraint with wildcards for Codes and removePrefix property ===== 452 +|(% rowspan="4" %)Key1|FREQ|M 453 +|VIS_CTY|DE 454 +|UNIT|EUR 455 +|CHOICE|A 456 +|(% rowspan="4" %)Key2|FREQ|Q 457 +|VIS_CTY|MX 458 +|UNIT|USD 459 +|CHOICE|B 308 308 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**// 462 + 309 309 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. 310 310 311 311 R1: Allow monthly and quarterly data ... ... @@ -319,7 +319,7 @@ 319 319 |FREQ|M, Q 320 320 |VIS_CTY (removePrefix=’AREA_’)|M% 321 321 322 - =====10.3.4.2.8Use 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**// 323 323 324 324 R1: Allow monthly and quarterly data 325 325 ... ... @@ -333,7 +333,7 @@ 333 333 |VIS_CTY|MX 334 334 |COMMENT (lang=’en’)|%adjusted% 335 335 336 - =====10.3.4.2.9Use 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**// 337 337 338 338 R1: Allow monthly and quarterly data 339 339 ... ... @@ -347,7 +347,7 @@ 347 347 |VIS_CTY|MX 348 348 |CONTACT|John Doe 349 349 350 - ====10.3.4.3 Other constraining terms====504 +**10.3.4.3 Other constraining terms** 351 351 352 352 Beyond the cube regions and keysets, there is one more constraining term, i.e., the ReleaseCalendar. 353 353
- 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
- 1747387231598-634.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.helena - Size
-
... ... @@ -1,1 +1,0 @@ 1 -6.2 KB - Content
- 1747387252077-954.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.helena - Size
-
... ... @@ -1,1 +1,0 @@ 1 -5.1 KB - Content
- 1747387281625-859.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.helena - Size
-
... ... @@ -1,1 +1,0 @@ 1 -6.0 KB - Content
- 1747387330751-405.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.helena - Size
-
... ... @@ -1,1 +1,0 @@ 1 -15.8 KB - Content