get_metadata_attribute
Get every value of a reference metadata attribute with the applicable dimension slice, providing the detailed breakdown when summary metadata indicates more detail is available.
Instructions
Get every value of one reference metadata attribute, with the slice each applies to.
Use after get_reference_metadata() reports drill_down=true for an
attribute, which means more detail remains than the summary shows. This
can happen because the attribute's values differ across the dataflow (for
example recommended-uses text that differs per country), or because a
single value was identical on every row this query returned but drill_down
stays true since other rows queried differently might differ.
Args:
dataflow_id: The dataflow to read
attribute_id: An attribute id from get_reference_metadata()
key: Optional dimension key to narrow the query. Strongly recommended
for large dataflows: an unfiltered request that is too large to
return is reported back rather than guessed at, but supplying a
key (for example a single indicator or reference area) up front
avoids that round trip.
agency_id: The agency that owns the dataflow
endpoint: Optional endpoint key for this call only
Returns:
Every value of the attribute, each with the dimension key it applies to
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | ||
| endpoint | No | ||
| agency_id | No | ||
| dataflow_id | Yes | ||
| attribute_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | No | Human-readable label | |
| notes | No | Remarks for the caller | |
| total | No | Count of (value, key_context) pairs found | |
| status | Yes | One of four outcomes, mirroring the populated/declared_empty vocabulary on MetadataAttribute: 'values' -- the attribute has values, returned in `values`. 'declared_empty' -- the provider declares this attribute for this dataflow and published no value. 'unknown_attribute' -- no such attribute in the declared set; the declared ids are named in `notes`. 'unestablished' -- no channel resolved to a declared set, so nothing can be concluded about whether the attribute exists. This last value must never be rendered as 'no metadata': it is not an observation that the attribute is absent, only that this provider's channels could not confirm one way or the other. | |
| values | No | Values found | |
| truncated | No | True when values holds fewer than total | |
| value_kind | No | prose, url, date or unknown | unknown |
| dataflow_id | Yes | Dataflow queried | |
| attribute_id | Yes | Attribute queried | |
| distinct_values | No | Count of distinct value texts among the values found. `total` counts (value, key_context) pairs and answers a different question: three countries publishing the same source organisation give total: 3, distinct_values: 1. Counted over the full uncapped set, not the capped 200, so it stays truthful when `truncated` is true. 0 for the three non-'values' statuses. |