外部标识符

借助 ExternalIdentifier 实体,Feed 创建者可以将任意的源-值对集与特定对象相关联。ExternalIdentifier 通常是外部系统中的管辖区代码,用于将管辖区与候选人、办公室或地缘政治单位等对象相关联。

ExternalIdentifier 实体的 Type 字段用于描述标识符的来源,而不是要标识的对象。例如,两种内置类型是 fips(“联邦信息处理标准”代码的缩写)和 state。虽然 FIPS 两位数代码可用于描述状态,但针对这种情况的预期 Type 值为 fips,而非 state。这是因为 fips 描述了标识符的来源。

在整个 Feed 中,外部标识符会用于以下用途:

  • 提供稳定的标识符
  • 提供来自外部资源的规范标识符,例如 Open Civic 数据标识符或 FIPS 代码。
  • 提供 NIST CDF 架构中非原生的其他属性。

外部标识符用于为对象提供额外的数据或上下文时,需要使用值为 otherType。此外,它们还包含 OtherTypeValue,两者都取决于所提供数据类型。如需查看有关如何以这种方式提供数据的示例,请参阅 Office

属性

下表介绍了 ExternalIdentifier 的属性:

属性 是否必需? 类型 说明
label 可选 string 信息标签。可根据需要使用。

元素

下表显示了 ExternalIdentifier 的元素:

元素 多样性 类型 说明
Type 1 IdentifierType 提供标识符类型。
OtherType 0 或 1 string IdentifierType 的值为 other 时使用。
Value 1 string 管辖区使用的标识符。

示例

XML

    <ExternalIdentifiers>
     <ExternalIdentifier>
        <Type>other</Type>
        <OtherType>stable</OtherType>
        <Value>stable-gu-0081</Value>
      </ExternalIdentifier>
      <ExternalIdentifier>
        <Type>ocd-id</Type>
        <Value>ocd-division/country:ke/county:narok</Value>
      </ExternalIdentifier>
      <ExternalIdentifier>
        <Type>national-level</Type>
        <Value>33</Value>
      </ExternalIdentifier>
    </ExternalIdentifiers>

JSON

    "ExternalIdentifiers": {
      "ExternalIdentifier" : [
        {
          "Type": "other",
          "OtherType": "stable",
          "Value": "stable-gu-0081"
        },
        {
          "Type": "ocd-id",
          "Value": "ocd-division/country:ke/county:narok"
        },
        {
          "Type": "national-level",
          "Value": "33"
        }
      ]
    }