Documentation
¶
Overview ¶
Package skos reads a SKOS concept scheme (a controlled vocabulary such as homosaurus or LCSH published as RDF) and crosswalks each skos:Concept to a MARC authority record. It parses the common RDF serializations via the rdf package and maps prefLabel/altLabel/broader/narrower/related onto the MARC 1xx/4xx/5xx authority structure.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Concept ¶
type Concept struct {
URI string // the concept IRI (subject)
ID string // dc:identifier, or the IRI's last path segment
Scheme string // skos:inScheme target IRI; optional
Pref []Label // skos:prefLabel (one per language)
Alt []Label // skos:altLabel
Broader []Ref // skos:broader
Narrower []Ref // skos:narrower
Related []Ref // skos:related
Notes []Label // skos:scopeNote and rdfs:comment
}
Concept is one skos:Concept with the fields the authority crosswalk uses.
func Parse ¶
Parse reads a SKOS concept scheme from RDF bytes (serialization autodetected) and returns its concepts sorted by id. broader/narrower/related references are resolved to the target concept's preferred label when the target is in the set.
func (Concept) PrefLabel ¶
PrefLabel returns the concept's English-preferred preferred label, falling back to the first prefLabel in document order, or "" when none is present.
func (Concept) Record ¶
func (c Concept) Record() *codex.Record
Record crosswalks the concept to a MARC 21 authority record: the concept IRI is a 024 URI, the English preferred label the 150 established heading, other labels 450 see-from tracings, and broader/narrower/related concepts 550 see-also tracings ($w g/h for the hierarchy) carrying the target's label and IRI. Scope notes and comments become 680 public notes.