Documentation
¶
Overview ¶
Package marcview is the MARC half of the dual-view editor: it materializes a grain's records as an editable field array (via the framework-aware decode, so overrides shadow and verbatim sidecar fields appear), and writes an edited array back as a *diff* -- the edited record re-crosswalks to BIBFRAME, the result is compared to the original decode per (subject, predicate) group, and only the changed groups land as editorial quads with the override semantics. Untouched fields are byte-for-byte no-ops; crosswalk-lossy tags round-trip through the lcat:marcVerbatim sidecar instead of the graph.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrValidation = errors.New("marcview: invalid record")
ErrValidation reports an edited record that cannot be saved.
Functions ¶
func DocToRecord ¶
DocToRecord rebuilds the full MARC record from a field array (every field included, lossy or not) -- the inverse of RecordToDoc.
Types ¶
type Field ¶
type Field struct {
Tag string `json:"tag"`
Ind1 string `json:"ind1,omitempty"`
Ind2 string `json:"ind2,omitempty"`
// Value carries a control field's raw data (tag < 010).
Value string `json:"value,omitempty"`
Subfields []Subfield `json:"subfields,omitempty"`
// Lossy carries the fidelity table's reason when the tag does not
// survive the crosswalk -- the editor's non-blocking warning. Edits to
// lossy tags persist via the lcat:marcVerbatim sidecar.
Lossy string `json:"lossy,omitempty"`
}
Field is one MARC field row of the editing grid.
type RecordDoc ¶
type RecordDoc struct {
// Node is the grain node the record maps to (its Instance IRI, or the
// Work IRI for an instance-less record).
Node string `json:"node"`
Leader string `json:"leader"`
Fields []Field `json:"fields"`
}
RecordDoc is one materialized MARC record.
func RecordToDoc ¶
RecordToDoc materializes one parsed MARC record as a field array -- the copy-cataloging search results and staged imports speak this shape too .