Documentation
¶
Overview ¶
Package schemaorg converts MARC 21 records to schema.org JSON-LD — the vocabulary search engines and reading systems consume on the web. Each record becomes a Book (or a related CreativeWork subtype) carrying the common bibliographic fields plus schema.org accessibility metadata (accessMode, accessibilityFeature, accessibilitySummary) derived from the record's 008, 007, 341 and 532 fields.
schema.org is a different, flat model, so this is a one-way MARC->schema.org crosswalk, not a codec. The Writer emits a JSON array and implements codex.RecordWriter, so it plugs into codex.Convert; it must be closed:
w := schemaorg.NewWriter(out) codex.Convert(iso2709.NewReader(src), w) w.Close()
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Book ¶
type Book struct {
Type string
Name string
Authors []Agent
Contributors []Agent
Publisher string
DatePublished string
ISBN []string
ISSN []string
InLanguage []string
About []string
Genre []string
Edition string
URL []string
Description string
// Accessibility (schema.org a11y vocabulary).
AccessMode []string
AccessibilityFeature []string
AccessibilitySummary string
}
Book is the schema.org representation of a record. Empty fields are omitted.
func FromRecord ¶
func FromRecord(r *codex.Record) *Book
FromRecord maps a MARC record to a schema.org Book in a single pass.