Metadata Structure Definition¶
A Metadata Structure Definition (MSD) defines the metadata attributes that can be reported in a
Metadata Set. Metadata attributes form a tree: an attribute can contain child attributes, and an
attribute that only groups its children is presentational. Documents start
ref: "MetadataStructure=AGENCY:ID(1.0)".
Simple form¶
The document starts with the common header. The body holds the concept scheme
reference, followed by the metadata attributes. Each attribute is written as an object keyed by its concept id, as
described in Components. There is no wrapping field such as attributes: the
attributes sit directly in the root object, beside the header fields.
format: "fusion-yaml(1.0.0)"
ref: "MetadataStructure=ACY:MSD(1.0.0)"
name: "TEST"
conceptscheme: "SDMX:MSD_CONCEPTS(1.0)"
A1:
codelist: "SDMX:CL_A1(1.0)"
minOccurs: 0
maxOccurs: 1
A2:
minOccurs: 0
maxOccurs: 1
conceptscheme: the short URN of the concept scheme that all attribute concepts belong to.A1,A2: one object per metadata attribute, keyed by concept id. Each object holds the attribute's representation: the enumeration reference (codelisthere), any text format fields,minOccursandmaxOccurs.
A metadata attribute is always written as an object, even when it has nothing other than its concept id. Unlike the
components of a Data Structure, there is no short - CONCEPT form.
Complex form¶
Attributes become nested when the MSD has a hierarchy, and the concept keys gain an alias prefix when the attributes use concepts from more than one concept scheme.
format: "fusion-yaml(1.0.0)"
ref: "MetadataStructure=ACY:MSD1(1.1)"
name: "TEST"
conceptschemes:
MSD_CONCEPTS: "ECB:MSD_CONCEPTS(1.0)"
MSD_CONCEPTS1: "SDMX:MSD_CONCEPTS(1.0)"
QUALITY_CONCEPTS: "SDMX:QUALITY_CONCEPTS(1.0)"
MSD_CONCEPTS1.COUNTRY:
codelist: "SDMX:CL_COUNTRY(1.0)"
minOccurs: 1
maxOccurs: 1
MSD_CONCEPTS1.STATE:
codelist: "SDMX:CL_STATE(1.0)"
minOccurs: 1
maxOccurs: 1
MSD_CONCEPTS1.CONTACT:
presentational: true
MSD_CONCEPTS1.FIRST_NAME:
minOccurs: 1
maxOccurs: 1
MSD_CONCEPTS.LAST_NAME:
minOccurs: 1
maxOccurs: 1
QUALITY_CONCEPTS.PHONE:
textType: "Integer"
maxLength: 10
minLength: 5
minOccurs: 0
- Concept schemes. With one concept scheme the body starts
conceptscheme: "<short URN>". With more than one it starts with aconceptschemesmap from alias to short URN, and each attribute key is writtenALIAS.CONCEPT. See Components for how aliases are chosen. The aliases cover every attribute in the tree, including nested ones. - Nesting. Child attributes are written inside their parent's object, after the parent's own representation
fields and its
presentationalflag. A child is recognised because its value is an object, while the parent's own fields have scalar values. - Presentational.
presentational: trueis written for an attribute that only groups its children and cannot carry a value. It is never written asfalse. - Representation. Text format fields follow the representation rules; numeric
fields such as
maxLength,minLength,maxValueandminValueare unquoted numbers.maxOccursis a number, or the string"unbounded".
An attribute object can also hold id (when the attribute id differs from its concept id), uri, annotations and
links, in the order given in the field reference below. Annotations and links are written after the nested
child attributes.
Field reference¶
Body fields, in written order:
| Field | Value | Written when |
|---|---|---|
conceptscheme |
Short URN of the concept scheme | All attributes use one concept scheme |
conceptschemes |
Map of alias to concept scheme short URN | Attributes use more than one concept scheme |
<CONCEPT> / <ALIAS>.<CONCEPT> |
Metadata attribute object (below) | Once for each top-level metadata attribute, in MSD order |
Metadata attribute object, in written order:
| Field | Value | Written when |
|---|---|---|
id |
Attribute id | The id differs from the concept id |
uri |
URI | The attribute has a URI |
codelist, valuelist, ... |
Short URN of the enumeration, keyed by its lower-case class (references) | The representation is enumerated |
textType, maxLength, minLength, maxValue, minValue, pattern, multilingual, ... |
Text format fields, see representation | Each field that has a value |
minOccurs |
Number | Set on the representation |
maxOccurs |
Number, or "unbounded" |
Set on the representation |
presentational |
true |
The attribute is presentational |
<CONCEPT> / <ALIAS>.<CONCEPT> |
Nested metadata attribute object (this table) | Once for each child attribute, in MSD order |
annotations |
See annotations | The attribute has annotations |
links |
See links | The attribute has links |
Reading notes¶
- The reader treats every field whose value is an object as a nested metadata attribute, and every scalar field as
one of the attribute's own fields. At the root, the header fields (
name,url,annotations, ...) are read before attributes are considered, so an attribute whose concept id is a header field name cannot be read. - When
idis absent the attribute id is set to the concept id. - Concept references are rebuilt from the
conceptscheme/conceptschemesfields, which must come before the attributes (as the writer always writes them).