# Metadata Quality for Biobanks
## 6 Metadata Quality Characteristics and Metrics
### Metadata Timeliness
#### 6.6.2 Calculating Metadata Timeliness Metrics  
Both data attribute values, and their metadata attribute values are accompanied by creation times. Therefore, it makes sense to calculate metadata timeliness based on the distance between these two types of values, e.g., as _a reverse distance of time between creating the data attribute value and its supplementing metadata values_. An example of low metadata timeliness is the case when collecting the information about the standard the data item conforms to is done two years after storing the data item: this is usually unacceptable as the standard information can become forgotten or lost in a course of time. Sample-level metadata timeliness metric can be calculated, e.g., as _the average metadata attribute-scoped metadata timeliness for a specific sample_ by aggregating timeliness distances for all possible \"data item attribute value--metadata value\" pairs, with every pair consisting of a data item attribute value connected to the specific sample, and the metadata value instantiating the specific metadata attribute, connected to this data item attribute. In this case, the creation time must be available for both elements of the pair. \[MT  
Data attribute-scoped average collection-level metadata timeliness aggregates all metadata timeliness values calculated for a specific data item attribute (first element of the pair) for all samples in a collection. It can be calculated as follows:  
\[MTimeel_{ac}^{attr}=\frac{\sum\limits_{s\in S_{c}}\sum\limits_{a\in A^{M}}(1-d_{ s}^{M}(a,a^{M})/\max\limits_{a\in A_{c}}d_{s}^{M}(a,a^{M}))}{n(S_{c})\cdot n(A_{c}^{M})},a\ \in A_{c} \tag{17}\]  
Suppose the interval of time between storing the BMI data item attribute value and the metadata attribute value is 1500 s for 350 metadata values describing BMI data item attribute values in the collection \(c_{1}\) and 2500 s for all other metadata values describing BMI data item attribute values defined for the same collection. Additionally, suppose that the collection \(c_{1}\) contains 250 samples, each instantiating data item attributes described by two metadata attributes. Then \(MTimeel_{(BMI)_{c_{1}}}^{attr}=\left(350\cdot(1-1500/2500)+150\cdot(1-2500/250 0)\right)/\left(250\cdot 2\right)=0.28\). Metadata attribute-scoped average collection-level metadata timeliness aggregates all metadata timeliness values calculated for a specific metadata attribute (second element of the pair) for all samples in a collection. It can be calculated as follows:  
\[MTimeel_{a^{M}c}^{attr}=\frac{\sum\limits_{s\in S_{c}}\sum\limits_{a\in A_{c}}( 1-d_{s}^{M}(a,a^{M})/\max\limits_{a\in A_{c}}d_{s}^{M}(a,a^{M}))}{n(S_{c}) \cdot n(A_{c})},a^{M}\in A_{c}^{M} \tag{18}\]  
Suppose the interval of time between storing the data item attribute value and the data item completeness metadata attribute value is 1000 s for 250 data item completeness metadata values describing data item values in the collection \(c_{1}\) and 2500 s for all other data item completeness metadata values defined for the same collection. Additionally, suppose that the collection \(c_{1}\) contains 250 samples, each instantiating four data item attributes. Then \(MTimeel_{(completeness)_{c_{1}}}^{attr}=\left(250\cdot(1-1000/2500)+750\cdot(1-250 0/2500)\right)/\left(250\cdot 4\right)=0.15\). It is also possible to define sample-based collection-level metadata timeliness by aggregating sample-level timeliness values with the aggregation formula similar to (4). Finding the Data Item Attribute Value with Minimal Metadata Timeliness in a Collection  
It is also possible to discover the collection-level metadata timeliness \"bottleneck\", i.e., the data item attribute value with minimal metadata timeliness in a collection. It is done by finding a \"data item attribute value--metadata attribute value\" pair characterized by minimal timeliness among all such pairs defined for all samples in a collection.