Skip to content

Resolve Dublin Core + CSV read-path asymmetry (implement or document) #92

@dchud

Description

@dchud

Problem

src/dublin_core.rs (19KB) and src/csv.rs (11KB) are currently write-only. The feature table in README presents these as supported formats but only the emit path exists — no DublinCoreReader or csv_to_record. This is misleading asymmetry.

What to do

Two sub-decisions, one per format:

Dublin Core

Implement read path. Use case: systems consuming harvested OAI-PMH DC records and wanting to produce skeleton MARC records. Mapping is inherently lossy (DC has 15 elements vs MARC's hundreds of fields), so the read is best-effort.

  • Implement dublin_core_xml_to_record() and DublinCoreReader
  • Document the DC element → MARC field mapping (e.g., dc:title → 245$a, dc:creator → 100$a, dc:subject → 650$a, etc.)
  • Roundtrip test is lossy — instead test that DC → MARC → DC preserves all 15 DC elements even if MARC shape changes

CSV

Decide: implement read (harder — no canonical CSV → MARC mapping) OR document explicitly as export-only.

  • Recommended: document as export-only in README feature table and docs/reference/ format pages, with rationale: CSV is for flat-table exports (one row per record, columns selected by user), not round-trippable structured MARC.
  • If implementing read: require a schema file or header row mapping columns to MARC field/subfield pairs.

Done when

  • Decision made and documented for each format
  • Dublin Core read path implemented (if chosen) OR README marked write-only with rationale
  • CSV read path implemented (if chosen) OR README marked write-only with rationale
  • README feature table updated to clearly distinguish R, W, and R/W
  • Docs updated under docs/reference/formats/
  • Tests: for DC, roundtrip DC element preservation; for CSV, whatever matches the decision
  • CHANGELOG entry under next version
  • .cargo/check.sh passes

Bead: bd-i7j6

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions