動態饋給建立者可透過 ExternalIdentifier 實體,將任意來源值配對組合與特定物件建立關聯。ExternalIdentifier 是外部系統中常見的管轄區代碼,用於將管轄區與候選人、辦公室或地緣政治單位等物件建立關聯。
ExternalIdentifier 實體的 Type 欄位是用來描述 ID 的來源,而非所識別的物件。舉例來說,內建類型有兩種:fips (「聯邦資訊處理標準」代碼的縮寫) 和 state。雖然 FIPS 兩位數代碼可用於描述州別,但這種情況的預期 Type 值為 fips,而非 state。這是因為 fips 會說明 ID 的來源。
外部 ID 會用於動態饋給的各個部分,用途如下:
- 提供穩定 ID。
- 提供外部資源的標準 ID,例如 Open Civic Data ID 或 FIPS 程式碼。
- 提供 NIST CDF 結構定義中沒有的其他屬性。
如要為物件提供額外資料或背景資訊,外部 ID 必須使用 Type 的 other。其中也包括 OtherType 和 Value,兩者都取決於提供的資料類型。如要查看以這種方式提供資料的範例,請參閱Office。
屬性
下表說明 ExternalIdentifier 的屬性:
| 屬性 | 是否必要? | 類型 | 說明 |
|---|---|---|---|
label |
選用 | string |
資訊豐富的標籤。視需要使用。 |
元素
下表顯示 ExternalIdentifier 的元素:
| 元素 | 多重性 | 類型 | 說明 |
|---|---|---|---|
Type |
1 | IdentifierType |
提供 ID 類型。 |
OtherType |
0 或 1 | string |
當 IdentifierType 的值為 other 時使用。 |
Value |
1 | string |
管轄區使用的 ID。 |
範例
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" } ] }