Documentation
¶
Overview ¶
Package vega harvests peer libraries' subject cataloging from III Vega Discover catalogs (NYPL and other Innovative sites) through the anonymous JSON API at <region>.iiivega.com. Unlike BiblioCommons' reverse RSS inference, Vega states its vocabulary outright: a concept record carries source="homoit", so a match is a peer's explicit Homosaurus assertion.
The chain per driver term: suggestions?phrase=<label> yields concept candidates; the concept endpoint gates source=="homoit" and an exact label match; the resources endpoint pages the FormatGroups cataloged under the concept, each carrying typed identifiers (ISBN on ~89% of records). Matching back to our works is by ISBN; the driver term is the suggestion.
Concept UUIDs are shared REGION-wide (every tenant in na returns the same UUID for one label), so label->concept resolution runs once per region and every tenant there reuses it. All of a region's traffic hits one API host, so politeness is per REGION: requests within a region serialize with the delay, distinct regions run concurrently.
Index ¶
Constants ¶
const Name = "vega"
Name is the enrichment source name; suggestions carry PIPELINE provenance.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Enricher ¶
type Enricher struct {
// contains filtered or unexported fields
}
Enricher harvests one or more Vega tenants.
func (*Enricher) Enrich ¶
func (e *Enricher) Enrich(ctx context.Context, works []ingest.WorkSummary) ([]ingest.Enrichment, error)
Enrich implements ingest.Enricher: per region, resolve each driver term to its shared concept once; per tenant, page the concept's FormatGroups (memoized within the TTL); match ISBNs back to the scoped works; emit one suggestion per (work, term) endorsed by every corroborating tenant.
func (*Enricher) RunStats ¶
func (e *Enricher) RunStats() ingest.EnrichStats
RunStats implements ingest.StatsReporter: Total is tenants x driver terms, Batches the (tenant, term) harvests completed (cache-warm counted instantly), SkippedBatches the per-tenant terms abandoned on an error, Candidates the live matches so far. Safe mid-run.
type Option ¶
type Option func(*Enricher)
Option configures the enricher.
func WithCacheTTL ¶
WithCacheTTL overrides how long resolutions and harvests are reused.
func WithMaxPages ¶
WithMaxPages caps resources pages fetched per (tenant, concept).
type Tenant ¶
Tenant is one Vega library: the catalog subdomain and its region. The catalog lives at https://<SiteCode>.<Region>.iiivega.com/ (some sites front it with a custom domain, but the Vega-domain form answers for all).
func ParseTenants ¶
ParseTenants reads the config form: comma-separated <siteCode>.<region> entries ("nypl.na2,mdpls.na"). The siteCode must be the library's real catalog subdomain -- DNS is wildcard, so nothing validates a guess until the API answers 403 "Customer with siteCode not found".