Changes for page 10 Constraints
Last modified by Artur on 2025/09/10 11:19
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,0 +1,1 @@ 1 +10 Constraints - Content
-
... ... @@ -1,0 +1,249 @@ 1 += {{id name="_Toc371061"/}}10 Constraints = 2 + 3 +== {{id name="_Toc371062"/}}10.1 Scope == 4 + 5 +The scope of this section is to describe the support in the metamodel for specifying both the access to and the content of a data source. The information may be stored in a resource such as a registry for use by applications wishing to locate data and metadata which is available via the Internet. The Constraint is also used to specify a sub set of a Codelist which may used as a partial code list which is relevant in the context of the artefact to which the Constraint is attached e.g. Data Structure Definition, Dataflow, Provision Agreement. 6 + 7 +Note that in this metamodel the term data source refers to both data and metadata sources, and data provider refers to both data and metadata providers. 8 + 9 +A data source may be a simple file of data or metadata (in SDMX-ML format), or a database or metadata repository. A data source may contain data for many data or metadataflows (called DataflowDefinition, and MetadataflowDefinition in the model), and the mechanisms described in this section allow an organisation to specify precisely the scope of the content of the data source where this data source is registered (SimpleDataSource, QueryDataSource). 10 + 11 +The DataflowDefinition and MetadataflowDefinition, themselves may be specified as containing only a sub set of all the possible keys that could be derived from a DataStructureDefinition or MetadataStructureDefinition. 12 + 13 +These specifications are called //Constraint// in this model. 14 + 15 +== {{id name="_Toc371063"/}}10.2 Inheritance == 16 + 17 +=== {{id name="_Toc371064"/}}10.2.1 Class Diagram of Constrainable Artefacts - Inheritance === 18 + 19 +**Figure 37: Inheritance class diagram of constrainable and provisioning artefacts** 20 + 21 +=== {{id name="_Toc371065"/}}10.2.2 Explanation of the Diagram === 22 + 23 +==== 10.2.2.1 Narrative ==== 24 + 25 +Any artefact that is derived from //ConstrainableArtefact// can have constraints defined. The artefacts that can have constraint metadata attached are: 26 + 27 +* DataflowDefinition 28 +* ProvisionAgreement 29 +* DataProvider – this is restricted to release calendar 30 +* MetadataflowDefinition 31 +* DataStructureDefinition 32 +* MetadataStructureDefinition 33 +* DataSet 34 +* SimpleDataSource – this is a registered data source where the registration references the actual DataSet or MetadataSet 35 +* QueryDataSource 36 + 37 +Note that, because the Constraint can specify a sub set of the component values implied by a specific //Structure// (such a specific DataStructureDefinition or specific MetadataStructureDefinition), the //ConstrainableArtefact//s must be associated with a specific //Structure//. Therefore, whilst the Constraint itself may not be linked directly to a DataStructureDefinition or MetadataStructureDefinition, the artefact that it is constraining will be linked to a DataStructureDefinition or MetadataStructureDefinition. As a Data Provider does not link to any one specific DSD or MSD the type of information that can be contained in a Constraint linked to a DataProvider is restricted to Release Calendar. 38 + 39 +== {{id name="_Toc371066"/}}10.3 Constraints == 40 + 41 +=== {{id name="_Toc371067"/}}10.3.1 Relationship Class Diagram – high level view === 42 + 43 +**Figure 38: Relationship class diagram showing constraint metadata** 44 + 45 +=== {{id name="_Toc371068"/}}10.3.2 Explanation of the Diagram === 46 + 47 +==== 10.3.2.1 Narrative ==== 48 + 49 +The constraint mechanism allows specific constraints to be attached to a //ConstrainableArtefact//. With the exception of ReferencePeriod, and ReleaseCalendar these constraints specify a sub set of the total set of values or keys that may be present in any of the ConstrainableArtefacts. 50 + 51 +For instance a DataStructureDefinition specifies, for each Dimension, the list of allowable code values. However, a specific DataflowDefinition that uses the DataStructureDefinition may contain only a sub set of the possible range of keys that is theoretically possible from the DataStructureDefinition definition (the total range of possibilities is sometimes called the Cartesian product of the dimension values). In addition to this, a DataProvider that is capable of supplying data according to the DataflowDefinition has a ProvisionAgreement, and the DataProvider may also wish to supply constraint information which may further constrain the range of possibilities in order to describe the data that the provider can supply. It may also be useful to describe the content of a datasource in terms of the KeySets or CubeRegions contained within it. 52 + 53 +A //ConstrainableArtefact// can have two types of //Constraint//: 54 + 55 +1. ContentConstraint – is used solely as a mechanism to specify either the available set of keys (DataKeySet, MetadataKeySet) or set of component values (CubeRegion, MetadatTargetRegion) in a //DataSource// such as a DataSet or a database (//QueryDatasource//), or the allowable keys that can be constructed from a DataStructureDefinition. Multiple such constraints may be present for a //ConstrainableArtefact//. For instance, there may be a ContentConstraint that specifies the values allowed for the //ConstrainableArtefact //(role is allowableContent) which can be used for validation or for constructing a partial code list, whilst another constraint can specify the actual content of a data or metadata source (role is actualContent). 56 +1. AttachmentConstraint – is used as a mechanism to define slices of the full set of data and to which metadata can be attached in a Data Set or MetadataSet. These slices can be defined either as a set of keys (KeySet) or a set of component values (CubeRegion). There can be many AttachmentConstraints specified for a specific AttachableArtefact. 57 + 58 +In addition to (DataKeySet, MetadataKeySet, CubeRegion, MetadataTargetRegion, a Constraint can have a ReferencePeriod defining one of more date ranges (ValidityPeriod) specifying the time period for which data or metadata are available in the //ConstrainableArtefact// and a ReleaseCalendar specifying when data are released for publication or reporting. 59 + 60 +=== {{id name="_Toc371069"/}}10.3.3 Relationship Class Diagram – Detail === 61 + 62 +**Figure 39: Constraints - Key Set Constraints** 63 + 64 +**Figure 40: Constraints - Cube Region and Metadata Target Region Constraints** 65 + 66 +==== 10.3.3.1 Explanation of the Diagram ==== 67 + 68 +A //Constraint// is a //MaintainableArtefact//. 69 + 70 +A //Constraint// has a choice of two ways of specifying value sub sets: 71 + 72 +1. As a set of keys that can be present in the DataSet (DataKeySet) or MetadataSet 73 + 74 +(MetadataKeySet). Each DataKey or MetadataKey specifies a number of ComponentValues each of which reference a //Component// (e.g. Dimension, TargetObject). Each ComponentValue is a value that may be present for a //Component// of a structure when contained in a DataSet or MetadataSet. The MetadataKeySet must also identify the MetadataTarget as there can be many of each of these in a MetadataStructureDefinition. For the DataKeySet the equivalent identification is not necessary as there is only one DimensionDescriptor and one AttributeDescriptor. 75 + 76 +1. As a set of CubeRegions or MetadataTaregetRegions each of which defines a “slice” of the total structure (MemberSelection) in terms of one or more MemberValues that may be present for a //Component// of a structure when contained in a //DataSet// or MetadataSet. 77 + 78 +The difference between (1) and (2) above is that in (1) a complete key is defined whereas in (2) above the “slice” defines a list of possible values for each of the// Component//s but does not specify specific key combinations. In addition, in (1) the association between //Component// and DataKeyValue or MetadataKeyValue is constrained to the components that comprise the key or identifier, whereas in (2) it can contain other component types (such as attributes). The value in ComponentValue.value and MemberValue.value must be consistent with the //Representation// declared for the //Component// in the DataStructureDefinition or MetadataStructureDefinition. Note that in all cases the “operator” on the value is deemed to be “equals”. Furthermore, it is possible in a MemberValue to specify that child values (e.g. child codes) are included in the constraint by means of the cascadeValues attribute. 79 + 80 +It is possible to define for the DataKeySet, DataKey, MetadataKeySet, MetadataKey, CubeRegion, MetadataTargetRegion, and MemberSelection whether the set is included (isIncluded = “true”) or excluded (isIncluded = ”false”) from the constraint definition. This attribute is useful if, for example, only a small sub-set of the possible values are not included in the set, then this smaller sub-set can be defined and excluded from the constraint. Note that if the child construct is “included: and the parent construct is “excluded” then the child construct is included in the list of constructs that are “excluded”. 81 + 82 +**10.3.3.2 Definitions** 83 + 84 +|**Class**|**Feature**|**Description** 85 +|//Constrainable// //Artefact//|((( 86 +Abstract Class Sub classes are: 87 + 88 +DataflowDefinition 89 + 90 +Metadataflow 91 + 92 +Definition 93 + 94 +ProvisionAgreement 95 + 96 +DataProvider 97 + 98 +//QueryDatasource// 99 + 100 +SimpleDatasource 101 + 102 +DataStructure 103 + 104 +Definition 105 + 106 +MetadataStructure 107 + 108 +Definition 109 +)))|An artefact that can have Constraints specified. 110 +||content|Associates the metadata that constrains the content to be found in a data or metadata source linked to the Constrainable Artefact. 111 +||attachment|Associates the metadata that constrains the valid content of a Constrainable Artefact to which metadata may be attached. 112 +|//Constraint//|((( 113 +Inherits from 114 + 115 +//MaintainableArtefact// 116 + 117 +Abstract class. Sub classes are: 118 + 119 +AttachmentConstraint 120 + 121 +ContentConstraint 122 +)))|Specifies a sub set of the definition of the allowable or actual content of a data or metadata source that can be derived from the Structure that defines code lists and other valid content. 123 +||+availableDates// //|Association to the time period that identifies the time range for which data or metadata are available in the data source. 124 +||+dataContentKeys|Association to a sub set of Data Key Sets (i.e. value combinations) that can be derived from the definition of the structure to which the Constrainable Artefact is linked. 125 +||+metadataContentKeys|Association to a sub set of Metdata Key Sets (i.e. value combinations) that can be derived from the definition of the Structure to which the Constrainable Artefact is linke 126 +||+dataContentRegion|Association to a sub set of component values that can be derived from the Data Structure Definition to which the Constrainable Artefact is linked. 127 +||+metadataContentRegion|Association to a sub set of component values that can be derived from the Metadata Structure Definition to which the Constrainable Artefact is linked. 128 +|ContentConstraint|((( 129 +Inherits from 130 + 131 +//Constraint// 132 +)))|Defines a Constraint in terms of the content that can be found in data or metadata sources linked to the Constrainable Artefact to which this constraint is associated. 133 +||+role|Association to the role that the Constraint plays 134 +|ConstraintRole||Specifies the way the type of content of a Constraint in terms of its purpose. 135 +||allowableContent|The Constraint contains a specification of the valid sub set of the Component values or keys. 136 +||actualContent|The Constraint contains a specification of the actual content of a data or metadata source in terms of the Component values or keys in the source. 137 +|((( 138 +Attachment 139 + 140 +Constraint 141 +)))|((( 142 +Inherits from 143 + 144 +//Constraint// 145 +)))|Defines a Constraint in terms of the combination of component values that may be found in a data source, and to which a Constrainable Artefact may be associated in a structure definition. 146 +|DataKeySet||A set of data keys. 147 +||isIncluded|Indicates whether the Data Key Set is included in the constraint definition or excluded from the constraint definition. 148 +||+keys|Association to the Data Keys in the set. 149 +|MetadataKeySet||A set of metadata keys. 150 +||isIncluded|Indicates whether the Metadata Key Set is included in the constraint definition or excluded from the constraint definition. 151 +||+keys|Association to the Metadata Keys in the set. 152 +|DataKey||The values of a key in a data set. 153 +||isIncluded|Indicates whether the Data Key is included in the constraint definition or excluded from the constraint definition. 154 +||+keyValue|Associates the Component Values that comprise the key. 155 +|MetadataKey||The values of a key in a metadata set. 156 +||isIncluded|Indicates whether the Metdadata Key is included in the constraint definition or excluded from the constraint definition. 157 +||+keyValue|Associates the Component Values that comprise the key. 158 +|ComponentValue||The identification of and value of a Component of the key (e.g. Dimension) 159 +||value|The value of Component 160 +||+valueFor|Association to the Component (e.g. Dimension) in the Structure to which the Constrainable Artefact is linked. 161 +|TimeDimensionValue||The value of the Time Dimension component. 162 +||timeValue|The value of the time period. 163 +||operator|((( 164 +Indicates whether the specified value represents and exact time or time period, or whether the value should be handled as a range. 165 + 166 +A value of greaterThan or greaterThanOrEqual indicates that the value is the beginning of a range (exclusive or inclusive, respectively). 167 + 168 +A value of lessThan or lessThanOrEqual indicates that the value is the end or a range (exclusive or inclusive, respectively). 169 + 170 +In the absence of the opposite bound being specified for the range, this bound is to be treated as infinite (e.g. any time period after the beginning of the provided time period for greaterThanOrEqual) 171 +))) 172 +|CubeRegion||A set of Components and their values that defines a sub set or “slice” of the total range of possible content of a data structure to which the Constrainable Artefact is linked. 173 +||isIncluded|Indicates whether the Cube Region is included in the constraint definition or excluded from the constraint definition. 174 +||+member|Associates the set of Components that define the sub set of values. 175 +|MetadataTargetRegion||A set of Components and their values that defines a sub set or “slice” of the total range of possible content of a metadata structure to which the Constrainable Artefact is linked. 176 +||isIncluded|Indicates whether the Metadata Target Region is included in the constraint definition or excluded from the constraint definition. 177 +||+member|Associates the set of Components that define the sub set of values. 178 +|MemberSelection||A set of permissible values for one component of the axis. 179 +||isIncluded|Indicates whether the Member Selection is included in the constraint definition or excluded from the constraint definition. 180 +||+valuesFor|Association to the Component in the Structure to which the Constrainable Artefact is linked, which defines the valid Representation for the Member Values. 181 +|SelectionValue|((( 182 +Abstract class. Sub classes are: 183 + 184 +MemberValue 185 + 186 +TimeRangeValue 187 +)))|A collection of values for the Member Selections that, combined with other Member Selections, comprise the value content of the Cube Region. 188 +|MemberValue|((( 189 +Inherits from 190 + 191 +SelectionValue 192 +)))|A single value of the set of values for the Member Selection. 193 +||value|A value of the member. 194 +||cascadeValues|Indicates that the child nodes of the member are included in the Member Selection (e.g. child codes) 195 +|//TimeRangeValue//|((( 196 +Inherits from 197 + 198 +SelectionValue 199 + 200 +Abstract Class 201 + 202 +Concrete Classes 203 + 204 +BeforePeriod 205 + 206 +AfterPeriod 207 + 208 +RangePeriod 209 +)))|A time value or values that specifies the date or dates for which the constrained selection is valid. 210 +|BeforePeriod|((( 211 +Inherits from 212 + 213 +//TimeRangeValue// 214 +)))|The period before which the constrained selection is valid. 215 +||isInclusive|Indication of whether the date is inclusive in the period. 216 +|AfterPeriod|((( 217 +Inherits from 218 + 219 +//TimeRangeValue// 220 +)))|The period after which the constrained selection is valid. 221 +||isInclusive|Indication of whether the date is inclusive in the period. 222 +|RangePeriod||The start and end periods in a date range. 223 +||+start|Association to the Start Period. 224 +||+end|Association to the End Period. 225 +|StartPeriod|((( 226 +Inherits from 227 + 228 +//TimeRangeValue// 229 +)))|The period from which the constrained selection is valid. 230 +||isInclusive|Indication of whether the date is inclusive in the period. 231 +|EndPeriod|((( 232 +Inherits from 233 + 234 +//TimeRangeValue// 235 +)))|The period to which the constrained selection is valid. 236 +||isInclusive|Indication of whether the date is inclusive in the period. 237 +|ReferencePeriod||A set of dates that constrain the content that may be found in a data or metadata set. 238 +||startDate|The start date of the period. 239 +||endDate|The end date of the period. 240 +|ReleaseCalendar||The schedule of publication or reporting of the data or metadata 241 +||periodicity|The time period between the releases of the data or metadata 242 +||offset|Interval between January 1^^st^^ and the first release of the data 243 +||tolerance|Period after which the data or metadata may be deemed late. 244 + 245 + 246 + 247 + 248 + 249 +