Documentation
¶
Index ¶
- func ViafGetIDs(input string) (map[string]string, error)
- func ViafGetLCN(input string) (string, error)
- func ViafGetLCNs(input []string) (map[string]string, error)
- func ViafGetWKP(input string) (string, error)
- func ViafGetWKPs(input []string) (map[string]string, error)
- func ViafTranslate(input string) (string, error)
- func ViafTranslateBatch(input []string) (map[string]string, error)
- type AllIDsResult
- type AudLevel
- type Avg
- type Date
- type Dates
- type Lang
- type Languages
- type NameInfo
- type RawName
- type SourceID
- type SourceIDs
- type Sources
- type ViafData
- type WCIReadResult
- type WCIdentity
- type XLinks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ViafGetIDs ¶
ViafGetIDs finds all source IDs, e.g. LC, DNB, WKP, etc. from a VIAF ID
func ViafGetLCN ¶
ViafGetLCN finds a Library of Congress ID from a VIAF ID
func ViafGetLCNs ¶
ViafGetLCNs finds Library of Congress IDs from a slice of VIAF IDs in batches
func ViafGetWKP ¶
ViafGetWKP finds a Wikipedia ID from a VIAF ID
func ViafGetWKPs ¶
ViafGetWKPs finds Wikidata IDs from a slice of VIAF IDs in batches
func ViafTranslate ¶
ViafTranslate takes an ID from an external source e.g. DNB, Sudoc, etc and retrieves the corresponding VIAF ID the input should be an url encoded string, e.g. SUDOC%7c033522448
Types ¶
type AllIDsResult ¶
type AllIDsResult struct {
// contains filtered or unexported fields
}
AllIDsResult returns the input of a request to ViafGetAllIDs (e.g. 123456) and the result in the form map[DNB]{"TYU6756"}, with the error if any
func ViafGetAllIDs ¶
func ViafGetAllIDs(input []string) ([]AllIDsResult, error)
ViafGetAllIDs finds all source IDs, e.g. LC, DNB, WKP, etc. from a bucn of VIAF ID
type AudLevel ¶
type AudLevel struct {
Avg Avg `xml:"avg"`
}
AudLevel is embedded in WCIdentity represents the "audience level" of the author's works
type NameInfo ¶
type NameInfo struct {
Type string `xml:"type,attr"`
RawName RawName `xml:"rawName"`
Languages Languages `xml:"languages"`
BirthDate string `xml:"birthDate"`
Dates Dates `xml:"dates"`
TotalHoldings string `xml:"totalHoldings"`
WorkCount string `xml:"workCount"`
RecordCount string `xml:"recordCount"`
}
NameInfo is embedded in WCIdentity
type Sources ¶
type Sources struct {
Source interface{} `json:"source"`
}
Sources is used to unmarshal data about other sources ID into an interface (JSON structure subject to change on the OCLC end)
type ViafData ¶
type ViafData struct {
ViafID string `json:"viafID"`
NameType string `json:"nameType"`
Sources Sources `json:"sources"`
SourceIDs SourceIDs // SourceIDs is the value extracted from Sources above
XLinks XLinks `json:"xLinks"`
WCIdentitiesURL string // WCIdentitiesURL is the value extracted from XLinks above
}
ViafData is used to unmarshal the response coming from the VIAF GetDataInFormat web service
type WCIReadResult ¶
type WCIReadResult struct {
Input string
Output WCIdentity
ErrorString string
}
WCIReadResult returns the input of a request to WCIBatchRead and the result in the form WCIdentity, with the error if any
func WCIBatchRead ¶
func WCIBatchRead(input []string) ([]WCIReadResult, error)
WCIBatchRead manages concurrent calls to WCIRead
type WCIdentity ¶
type WCIdentity struct {
Pnkey string `xml:"pnkey"`
AudLevel AudLevel `xml:"audLevel"`
NameInfo NameInfo `xml:"nameInfo"`
}
WCIdentity stores the unmarshalled result from the WorldCat Identities web service
func WCIRead ¶
func WCIRead(input string) (WCIdentity, error)
WCIRead calls the WorldCat Identities web service for a given LC number (i.e. authority number)