外部标识符

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

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

Feed 中会使用外部标识符,以实现以下目的:

  • 提供稳定标识符
  • 提供来自外部资源的规范标识符,例如 Open Civic Data 标识符或 FIPS 代码。
  • 提供不属于 NIST CDF 架构的原生属性。

当用于为对象提供额外数据或上下文时,外部标识符需要使用 Typeother 的值。它们还包括 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"
        }
      ]
    }