Skip to content

Commit

Permalink
Commit 9 Schema changes, schema bug fixes and documentation updates (#26
Browse files Browse the repository at this point in the history
)

Changes include:
* Reference metadata CCR-02
* Sentinel values
* Constraints

Bug fixes include:
* Reinstatement of None AttributeRelationship option
  • Loading branch information
sdmx3mdt committed Apr 21, 2021
1 parent 79d9ed9 commit 056afda
Show file tree
Hide file tree
Showing 13 changed files with 187 additions and 62 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
14 changes: 7 additions & 7 deletions schemas/SDMXCommonReferences.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -2966,27 +2966,27 @@
</xs:complexContent>
</xs:complexType>

<xs:complexType name="LocalMetadataStructureComponentReferenceType">
<xs:complexType name="LocalMetadataAttributeReferenceType">
<xs:annotation>
<xs:documentation>LocalMetadataStructureComponentReferenceType is a type for referencing any type of metadata structure component locally, where the reference for the metadata structure definition which defines the components is available in another context.</xs:documentation>
<xs:documentation>LocalMetadataAttributeReferenceType is a type for referencing a metadata structure attribute locally, where the reference for the metadata structure definition which defines the components is available in another context.</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:restriction base="LocalComponentListComponentReferenceBaseType">
<xs:sequence>
<xs:element name="Ref" type="LocalMetadataStructureComponentRefType" form="unqualified"/>
<xs:element name="Ref" type="LocalMetadataAttributeRefType" form="unqualified"/>
</xs:sequence>
</xs:restriction>
</xs:complexContent>
</xs:complexType>

<xs:complexType name="LocalMetadataStructureComponentRefType">
<xs:complexType name="LocalMetadataAttributeRefType">
<xs:annotation>
<xs:documentation>LocalMetadataStructureComponentRefType contains the reference fields for referencing any metadata structure component locally. This reference must specify the class of the component being referenced.</xs:documentation>
<xs:documentation>LocalMetadataAttributeRefType contains the reference fields for referencing a metadata attribute component locally.</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:restriction base="LocalComponentListComponentRefBaseType">
<xs:attribute name="containerID" type="IDType" use="required"/>
<xs:attribute name="class" type="MetadataStructureComponentTypeCodelistType" use="required"/>
<xs:attribute name="containerID" type="IDType" use="prohibited"/>
<xs:attribute name="class" type="MetadataStructureComponentTypeCodelistType" use="required" fixed="MetadataAttribute"/>
<xs:attribute name="package" type="StructurePackageTypeCodelistType" use="optional" fixed="metadatastructure"/>
</xs:restriction>
</xs:complexContent>
Expand Down
27 changes: 11 additions & 16 deletions schemas/SDMXDataStructureSpecific.xsd

Large diffs are not rendered by default.

44 changes: 41 additions & 3 deletions schemas/SDMXStructureBase.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
<xs:documentation>Enumeration references an item scheme that enumerates the allowable values for this representation.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="EnumerationFormat" type="CodededTextFormatType" minOccurs="0">
<xs:element name="EnumerationFormat" type="CodedTextFormatType" minOccurs="0">
<xs:annotation>
<xs:documentation>EnumerationFormat describes the facets of the item scheme enumeration. This is for the most part, informational.</xs:documentation>
</xs:annotation>
Expand All @@ -239,6 +239,13 @@
<xs:annotation>
<xs:documentation>TextFormatType defines the information for describing a full range of text formats and may place restrictions on the values of the other attributes, referred to as "facets".</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="Sentinel" type="SentinelType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Sentinel defines a reserved value for the text format along with its meaning.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute name="textType" type="common:DataType" default="String">
<xs:annotation>
<xs:documentation>The textType attribute provides a description of the datatype. If it is not specified, any valid characters may be included in the text field (it corresponds to the xs:string datatype of W3C XML Schema) within the constraints of the facets.</xs:documentation>
Expand Down Expand Up @@ -314,6 +321,25 @@
<xs:documentation>The isMultiLingual attribute indicates for a text format of type "string", whether the value should allow for multiple values in different languages.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="sentinelValues" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation>The sentinelValues attribute indicates that sentinel values are defined for the text format. A sentinel value is reserved value in an otherwise open value domain that holds a specific meaning. For example, a value of -1 can be defined to indicate a non-applicable value.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>

<xs:complexType name="SentinelType">
<xs:annotation>
<xs:documentation>SentinelType defines the structure of a sentinel value. A sentinel value is reserved value in an otherwise open value domain with a specific meaning.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element ref="common:Name" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="value" type="xs:anySimpleType" use="required">
<xs:annotation>
<xs:documentation>The sentinel value being described.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>

<xs:complexType name="BasicComponentTextFormatType">
Expand All @@ -322,6 +348,9 @@
</xs:annotation>
<xs:complexContent>
<xs:restriction base="TextFormatType">
<xs:sequence>
<xs:element name="Sentinel" type="SentinelType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="textType" type="common:BasicComponentDataType" use="optional" default="String"/>
</xs:restriction>
</xs:complexContent>
Expand All @@ -333,15 +362,18 @@
</xs:annotation>
<xs:complexContent>
<xs:restriction base="BasicComponentTextFormatType">
<xs:sequence>
<xs:element name="Sentinel" type="SentinelType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="textType" type="common:SimpleDataType" use="optional" default="String"/>
<xs:attribute name="isMultiLingual" type="xs:boolean" use="prohibited"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>

<xs:complexType name="CodededTextFormatType">
<xs:complexType name="CodedTextFormatType">
<xs:annotation>
<xs:documentation>CodededTextFormatType is a restricted version of the SimpleComponentTextFormatType that only allows factets and text types applicable to codes. Although the time facets permit any value, an actual code identifier does not support the necessary characters for time. Therefore these facets should not contain time in their values.</xs:documentation>
<xs:documentation>CodedTextFormatType is a restricted version of the SimpleComponentTextFormatType that only allows factets and text types applicable to codes. Although the time facets permit any value, an actual code identifier does not support the necessary characters for time. Therefore these facets should not contain time in their values.</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:restriction base="SimpleComponentTextFormatType">
Expand All @@ -359,6 +391,7 @@
<xs:attribute name="maxValue" type="xs:integer" use="optional"/>
<xs:attribute name="decimals" type="xs:positiveInteger" use="prohibited"/>
<xs:attribute name="pattern" type="xs:string" use="optional"/>
<xs:attribute name="sentinelValues" type="xs:boolean" use="prohibited"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
Expand Down Expand Up @@ -424,6 +457,7 @@
<xs:attribute name="maxValue" type="xs:decimal" use="prohibited"/>
<xs:attribute name="decimals" type="xs:positiveInteger" use="prohibited"/>
<xs:attribute name="pattern" type="xs:string" use="prohibited"/>
<xs:attribute name="sentinelValues" type="xs:boolean" use="prohibited"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
Expand All @@ -434,6 +468,9 @@
</xs:annotation>
<xs:complexContent>
<xs:restriction base="SimpleComponentTextFormatType">
<xs:sequence>
<xs:element name="Sentinel" type="SentinelType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="textType" type="common:TimeDataType" default="ObservationalTimePeriod"/>
<xs:attribute name="startTime" type="common:StandardTimePeriodType" use="optional"/>
<xs:attribute name="endTime" type="common:StandardTimePeriodType" use="optional"/>
Expand All @@ -448,6 +485,7 @@
<xs:attribute name="maxValue" type="xs:decimal" use="prohibited"/>
<xs:attribute name="decimals" type="xs:positiveInteger" use="prohibited"/>
<xs:attribute name="pattern" type="xs:string" use="prohibited"/>
<xs:attribute name="sentinelValues" type="xs:boolean" use="optional"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
Expand Down
2 changes: 1 addition & 1 deletion schemas/SDMXStructureConcept.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<xs:documentation>Enumeration references a codelist which enumerates the possible values that can be used as the representation of this concept.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="EnumerationFormat" type="CodededTextFormatType" minOccurs="0"/>
<xs:element name="EnumerationFormat" type="CodedTextFormatType" minOccurs="0"/>
</xs:sequence>
</xs:choice>
</xs:restriction>
Expand Down
31 changes: 19 additions & 12 deletions schemas/SDMXStructureConstraint.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<!-- Copyright SDMX 2021 - http://www.sdmx.org -->
<xs:schema targetNamespace="http://www.sdmx.org/resources/sdmxml/schemas/v3_0/structure" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sdmx.org/resources/sdmxml/schemas/v3_0/structure" xmlns:structure="http://www.sdmx.org/resources/sdmxml/schemas/v3_0/structure" xmlns:common="http://www.sdmx.org/resources/sdmxml/schemas/v3_0/common">
<xs:import namespace="http://www.sdmx.org/resources/sdmxml/schemas/v3_0/common" schemaLocation="SDMXCommon.xsd"/>
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
<xs:include schemaLocation="SDMXStructureBase.xsd"/>

<xs:annotation>
Expand Down Expand Up @@ -92,9 +93,9 @@
</xs:complexContent>
</xs:complexType>

<xs:complexType name="MeatadataConstraintBaseType" abstract="true">
<xs:complexType name="MetadataConstraintBaseType" abstract="true">
<xs:annotation>
<xs:documentation>MeatadataConstraintBaseType is an abstract base refinement of ConstraintType. The constraint attachment is restricted to constrainable artefacts related to metadata, and the only possible role is "Allowed".</xs:documentation>
<xs:documentation>MetadataConstraintBaseType is an abstract base refinement of ConstraintType. The constraint attachment is restricted to constrainable artefacts related to metadata, and the only possible role is "Allowed".</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:restriction base="ConstraintType">
Expand All @@ -103,7 +104,7 @@
<xs:element ref="common:Link" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="common:Name" maxOccurs="unbounded"/>
<xs:element ref="common:Description" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="ConstraintAttachment" type="DataConstraintAttachmentType" minOccurs="0"/>
<xs:element name="ConstraintAttachment" type="MetadataConstraintAttachmentType" minOccurs="0"/>
<xs:element name="ReleaseCalendar" type="ReleaseCalendarType" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="role" type="ConstraintRoleType" use="required" fixed="Allowed"/>
Expand All @@ -116,7 +117,7 @@
<xs:documentation>MetadataConstraintType defines the structure of a metadata constraint. A metadata constraint can specify allowed attribute values for metadata described by the constrained artefact.</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="MeatadataConstraintBaseType">
<xs:extension base="MetadataConstraintBaseType">
<xs:sequence>
<xs:element name="MetadataTargetRegion" type="MetadataTargetRegionType" minOccurs="0" maxOccurs="2">
<xs:annotation>
Expand Down Expand Up @@ -374,9 +375,9 @@
<xs:documentation>KeyValue contains a reference to a component which disambiguates the data (i.e. a dimension) and provides a collection of values for the component. The collection of values can be flagged as being inclusive or exclusive to the region being defined. Any key component that is not included is assumed to be wild carded, which is to say that the cube includes all possible values for the un-referenced key components. Further, this assumption applies to the values of the components as well. The values for any given component can only be sub-setted in the region by explicit inclusion or exclusion. For example, a dimension X which has the possible values of 1, 2, 3 is assumed to have all of these values if a key value is not defined. If a key value is defined with an inclusion attribute of true and the values of 1 and 2, the only the values of 1 and 2 for dimension X are included in the definition of the region. If the key value is defined with an inclusion attribute of false and the value of 1, then the values of 2 and 3 for dimension X are included in the definition of the region. Note that any given key component must only be referenced once in the region.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Attribute" type="MemberSelectionType" minOccurs="0" maxOccurs="unbounded">
<xs:element name="Component" type="MemberSelectionType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Attributes contains a reference to an attribute component (data or metadata) and provides a collection of values for the referenced attribute. This serves to state that for the key which defines the region, the attributes that are specified here have or do not have (depending to the include attribute of the value set) the values provided. It is possible to provide and attribute reference without specifying values, for the purpose of stating the attribute is absent (include = false) or present with an unbounded set of values. As opposed to key components, which are assumed to be wild carded if absent, no assumptions are made about the absence of an attribute. Only attributes which are explicitly stated to be present or absent from the region will be know. All unstated attributes for the set cannot be assumed to absent or present.</xs:documentation>
<xs:documentation>Component contains a reference to a component (data attribute, metadata attribute, or measure) and provides a collection of values for the referenced component. This serves to state that for the key which defines the region, the components that are specified here have or do not have (depending on the include attribute of the value set) the values provided. It is possible to provide a component reference without specifying values, for the purpose of stating the component is absent (include = false) or present with an unbounded set of values. As opposed to key components, which are assumed to be wild carded if absent, no assumptions are made about the absence of a component. Only components which are explicitly stated to be present or absent from the region will be know. All unstated components for the set cannot be assumed to absent or present.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
Expand Down Expand Up @@ -429,7 +430,7 @@
<xs:restriction base="RegionType">
<xs:sequence>
<xs:element name="KeyValue" type="DinstinctKeyValueType" maxOccurs="unbounded"/>
<xs:element name="Attribute" type="MemberSelectionType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Component" type="MemberSelectionType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="include" type="xs:boolean" use="optional" fixed="true">
<xs:annotation>
Expand Down Expand Up @@ -464,7 +465,7 @@
<xs:restriction base="DistinctKeyType">
<xs:sequence>
<xs:element name="KeyValue" type="DataKeyValueType" maxOccurs="unbounded"/>
<xs:element name="Attribute" type="AttributeValueSetType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Component" type="ComponentValueSetType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:restriction>
</xs:complexContent>
Expand Down Expand Up @@ -492,7 +493,7 @@
<xs:restriction base="RegionType">
<xs:sequence>
<xs:element name="KeyValue" type="CubeRegionKeyType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Attribute" type="AttributeValueSetType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Component" type="ComponentValueSetType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:restriction>
</xs:complexContent>
Expand All @@ -505,7 +506,7 @@
<xs:complexContent>
<xs:restriction base="RegionType">
<xs:sequence>
<xs:element name="Attribute" type="MetadataAttributeValueSetType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Component" type="MetadataAttributeValueSetType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:restriction>
</xs:complexContent>
Expand All @@ -526,9 +527,9 @@
</xs:complexContent>
</xs:complexType>

<xs:complexType name="AttributeValueSetType">
<xs:complexType name="ComponentValueSetType">
<xs:annotation>
<xs:documentation>AttributeValueSetType defines the structure for providing values for a data attribute. If no values are provided, the attribute is implied to include/excluded from the region in which it is defined, with no regard to the value of the data attribute. Note that for metadata attributes which occur within other metadata attributes, a nested identifier can be provided. For example, a value of CONTACT.ADDRESS.STREET refers to the metadata attribute with the identifier STREET which exists in the ADDRESS metadata attribute in the CONTACT metadata attribute, which is defined at the root of the report structure.</xs:documentation>
<xs:documentation>ComponentValueSetType defines the structure for providing values for a data attributes, measures, or metadata attributes. If no values are provided, the component is implied to include/excluded from the region in which it is defined, with no regard to the value of the component. Note that for metadata attributes which occur within other metadata attributes, a nested identifier can be provided. For example, a value of CONTACT.ADDRESS.STREET refers to the metadata attribute with the identifier STREET which exists in the ADDRESS metadata attribute in the CONTACT metadata attribute, which is defined at the root of the report structure.</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:restriction base="MemberSelectionType">
Expand Down Expand Up @@ -566,6 +567,11 @@
<xs:documentation>The cascadeValues attribute, if true, indicates that if the value is taken from a code all child codes in a simple hierarchy are understood be included in the region.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute ref="xml:lang" use="optional">
<xs:annotation>
<xs:documentation>The xml:lang attribute specifies a language code for the value. This is used when the component value support multi-lingual values.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
Expand All @@ -577,6 +583,7 @@
<xs:simpleContent>
<xs:restriction base="SimpleComponentValueType">
<xs:attribute name="cascadeValues" type="common:CascadeSelectionType" use="prohibited"/>
<xs:attribute ref="xml:lang" use="prohibited"/>
</xs:restriction>
</xs:simpleContent>
</xs:complexType>
Expand Down
Loading

0 comments on commit 056afda

Please sign in to comment.