-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Add one-way export from MARC Authority records to MADS 2.1 XML, following the pattern established by the existing MODS conversion module.
Reference Specifications
- MADS home: https://www.loc.gov/standards/mads/
- MARC Authority to MADS 2.1 mapping (Excel): https://www.loc.gov/standards/mads/mads-mapping-2-1.xlsx
- XSLT 1.0 stylesheet: https://www.loc.gov/standards/marcxml/xslt/MARC21slim2MADS.xsl
- XSLT 2.0 stylesheet: https://www.loc.gov/standards/marcxml/xslt/MARC21slim2MADS_XSLT2.0.xsl
- MADS 2.1 schema (XSD): https://www.loc.gov/standards/mads/mads-2-1.xsd
- MARC Authority to MADS 2.0 mapping (HTML): https://www.loc.gov/standards/mads/mads-mapping.html
Scope
One-way conversion only: MARC Authority → MADS 2.1 XML. No reverse mapping (MADS → MARC Authority) — there is no official LOC crosswalk for that direction, and the LOC notes the forward mapping "is not intended to be a crosswalk that allows for bi-directional conversions without some loss of data."
Implementation Plan
1. Rust core module: src/mads.rs
Primary function:
pub fn authority_record_to_mads_xml(record: &AuthorityRecord) -> Result<String>Also support converting a generic Record with leader/06=z:
pub fn record_to_mads_xml(record: &Record) -> Result<String>Follow the manual XML construction pattern used in src/mods.rs (string building with std::fmt::Write), not the serde intermediate struct pattern.
2. Key field mappings (MARC Authority → MADS 2.1)
Authority headings (1XX → <mads:authority>):
- 100 →
<mads:name type="personal"> - 110 →
<mads:name type="corporate"> - 111 →
<mads:name type="conference"> - 130 →
<mads:titleInfo> - 148 →
<mads:temporal> - 150 →
<mads:topic> - 151 →
<mads:geographic> - 155 →
<mads:genre>
Variant headings (4XX → <mads:variant>):
- 400/410/411/430/448/450/451/455 → same descriptor types as above within
<variant>
Related headings (5XX → <mads:related>):
- 500/510/511/530/548/550/551/555 → same descriptor types within
<related> - Map $w control subfield to
typeattribute (broader/narrower/earlier/later/equivalent)
Metadata elements:
- 008 positions → various attributes (e.g., encoding level)
- 010 →
<mads:identifier type="lccn"> - 024 →
<mads:identifier>with type from $2 - 040 →
<mads:recordInfo>(cataloging source) - 042 →
<mads:recordInfo>(authentication code) - 046 → date elements
- 370 →
<mads:affiliation>or geographic metadata - 371 →
<mads:affiliation>(address) - 372 →
<mads:fieldOfActivity> - 373 →
<mads:affiliation>(group) - 374 →
<mads:occupation>or personInfo - 375 → gender info
- 376 →
<mads:familyInfo>or<mads:personInfo> - 377 →
<mads:language> - 378 →
<mads:name>(fuller form) - 380-385 → various descriptive elements
- 667/670/675/678 →
<mads:note>
Subdivision subfields ($v, $x, $y, $z in 1XX/4XX/5XX):
- $v →
<mads:genre>, $x →<mads:topic>, $y →<mads:temporal>, $z →<mads:geographic>
3. PyO3 bindings
Add authority_record_to_mads() and record_to_mads() in src-python/src/formats.rs.
4. Python wrapper, type stubs, tests
- Expose in
mrrc/__init__.py - Add signatures to
mrrc/_mrrc.pyi - Rust unit tests + Python integration tests in
tests/python/ - Validate output against the MADS 2.1 XSD schema
5. Documentation
- Update README.md format table (MADS row: Read=-, Write=Yes)
- Update
docs/tutorials/rust/format-conversion.md— add MADS export example - Update
docs/tutorials/python/format-conversion.md— add MADS export example - Update
docs/reference/rust-api.md— document new public functions - Update
docs/reference/python-api.md— document new Python functions - CHANGELOG entry
Design Notes
- MADS is to authority records what MODS is to bibliographic records; this feature complements existing MODS support
- The LOC XSLT stylesheets serve as an authoritative reference implementation for the mapping logic
- MADS 2.1 added new elements (personInfo, organizationInfo, familyInfo, fieldOfEndeavor, locale, workInfo) corresponding to MARC 37X fields
Internal tracking: beads mrrc-b7l