libraryofcongress

package module
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

README

go-sfomuseum-libraryofcongress

Go package for working with Library of Congress data in an SFO Museum context.

Documentation

Documentation is incomplete at this time. For working example code have a look at:

Tools

lookup

For example:

$> ./bin/lookup -lookup-uri lcsh:// Airplanes
sh85002782 Airplanes

$> ./bin/lookup -lookup-uri lcnaf:// "Lindbergh, Charles A. (Charles Augustus), 1902-1974"
n79100565 Lindbergh, Charles A. (Charles Augustus), 1902-1974

A note about "lookups"

Please have a look at the A note about "lookup" documentation in the go-sfomuseum-airfield package. The issues outlined there are the same here. The "tl;dr" is:

It's not great. It's just what we're doing today. The goal right now is to expect a certain amount of "rinse and repeat" in the short term while aiming to make each cycle shorter than the last.

A note about the data

The data files in this package, and in particular the data/lcnaf.csv.bz2 file, are very big. As of this writing the data are loaded in to an in-memory sync.Map instance which means that a) it takes a non-zero amount of time to load b) consumes a non-trivial amount of memory. As such the lcnaf lookup table, derived from data which has 11M rows, only stores label -> ID pointers. It is not possible, at this time, to lookup the label for a given lcnaf identifier.

Remember: This package is tailored to SFO Museum's specific needs, and it's specific trade-offs, at the time of writing. As mentioned above "It's not great. It's just what we're doing today."

See also

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterLookup

func RegisterLookup(ctx context.Context, scheme string, init_func LookupInitializationFunc) error

Types

type Lookup

type Lookup interface {
	Find(context.Context, string) ([]interface{}, error)
	Append(context.Context, interface{}) error
}

func NewLookup

func NewLookup(ctx context.Context, uri string) (Lookup, error)

type LookupInitializationFunc

type LookupInitializationFunc func(ctx context.Context, uri string) (Lookup, error)

Directories

Path Synopsis
cmd
lookup command
to-elasticsearch command
index-es is a command-tool to index the `lcsh` and `lcnaf` data embedded in the `go-sfomuseum-libraryofcongress` package in an Elasticsearch index.
index-es is a command-tool to index the `lcsh` and `lcnaf` data embedded in the `go-sfomuseum-libraryofcongress` package in an Elasticsearch index.
to-sqlite command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL