Bug #12869

EAD export: Country code should not be added to mainagencycode in <eadid> element

Added by Dan Gillean about 3 years ago. Updated about 3 years ago.

Status:VerifiedStart date:03/07/2019
Priority:MediumDue date:
Assignee:-% Done:


Target version:Release 2.5.0
Google Code Legacy ID: Tested version:2.4, 2.5
Sponsored:No Requires documentation:


First reported in the User forum, 2019-03-07: https://groups.google.com/d/msg/ica-atom-users/kmvW3MyJP2o/y7IxcLbvBQAJ

Tested and reproduced in demo 2.4 site and 2.5 Vagrant.

To reproduce

  • Create or find an archival institution that has an identifier and a full address (including country) added to it
  • Create or find a description linked to this institution - add at least title, identifier, LOD and save
  • Export the description as EAD and examine the output

Error encountered

The <eadid> element contains several attributes, including @countrycode and @mainagencycode. We take the country code from the country used in the address of the related repository, and the mainagency code from the repository's identifier. However, we are duplicating the country code by adding it to both @countrycode and as a prefix on the @mainagency code.

This goes against what the EAD 2002 standard says for the @mainagency code:

"Values should be supplied without the country code, which should be placed instead in the COUNTRYCODE attribute."

Example from the demo site: https://demo.accesstomemory.org/art-institute-of-ontario-fonds

<eadid identifier="art-institute-of-ontario-fonds" countrycode="CA" mainagencycode="CA-ON00012" url="http://demo.accesstomemory.org/index.php/art-institute-of-ontario-fonds" encodinganalog="identifier">SC034</eadid>
  • Linked repository country: Canada
  • Linked repository identifier: ON00012
  • Description @countrycode: CA
  • Description @mainagencycode: CA-ON00012

From the EAD 2002 Tag library

EADID element - https://www.loc.gov/ead/tglib/elements/eadid.html

A required subelement of <eadheader> that designates a unique code for a particular EAD finding aid document.

Two of the attributes, COUNTRYCODE and MAINAGENCYCODE, are required to make the <eadid> compliant with ISAD element 3.1.1. MAINAGENCYCODE provides the ISO 15511 code for the institution that maintains the finding aid (which may not be the same as the institution that is the custodian of the materials described). COUNTRYCODE supplies the ISO 3166-1 code for the country of the maintenance agency. In addition to these two attributes, it is recommended that repositories also use at least one of the following attributes: URL, PUBLICID, or IDENTIFIER to make the <eadid> globally unique. PUBLICID should be a Formal Public Identifier, URL an absolute or relative address, and IDENTIFIER a machine-readable unique identifier for the finding aid file. (The proper syntax for PUBLICID is defined in ISO/IEC 9070:1991 Information technology -- SGML support facilities -- Registration procedures for public text owner identifiers.)

COUNTRYCODE attribute - https://www.loc.gov/ead/tglib/att_gen.html

A unique code for the country in which the materials being described are held. Codes are to be taken from ISO 3166-1 Codes for the Representation of Names of Countries, column A2. Available in <eadid> and <unitid>.

MAINAGENCYCODE attribute - https://www.loc.gov/ead/tglib/att_gen.html

A code in <eadid> compliant with ISO/DIS 15511 Information and Documentation International Standard Identifier for Libraries and Related Organizations (ISIL). Values should be supplied without the country code, which should be placed instead in the COUNTRYCODE attribute.

Expected outcome

  • No country code is appended to the mainagencycode on EAD 2002 XML exports
  • Reference code inheritance still behaves the same


#2 Updated by Mike Cantelon about 3 years ago

  • Status changed from New to In progress
  • Assignee set to Mike Cantelon

#3 Updated by Mike Cantelon about 3 years ago

  • Status changed from In progress to Code Review
  • Assignee deleted (Mike Cantelon)

#4 Updated by Steve Breker about 3 years ago

#5 Updated by Mike Cantelon about 3 years ago

  • Status changed from Code Review to QA/Review

Thanks Steve! Merged into qa/2.5.x for QA.

#6 Updated by Evelyn McLellan about 3 years ago

  • Status changed from QA/Review to Feedback
  • Assignee set to Dan Gillean

I updated https://atom25.1804.qa.accesstomemory.net/ using Ansible AWX but it looks like the mainagencycode still has the countrycode prefix attached to it:

<eadid identifier="art-institute-of-ontario-fonds" countrycode="CA" mainagencycode="CA-ON00012" url="http://atom24.archivematica.org/index.php/art-institute-of-ontario-fonds" encodinganalog="identifier">SC034</eadid>

#7 Updated by Dan Gillean about 3 years ago

  • Status changed from Feedback to Verified
  • Assignee deleted (Dan Gillean)
  • Target version set to Release 2.5.0

Appears to be fixed now. Tested on 18.04 test site and 16.04 local VM.

Also available in: Atom PDF