Documentation
¶
Overview ¶
Package gosudoc is a set of client functions for the web services available on top of the Library Catalog of French University libraries named Sudoc. see http://documentation.abes.fr/sudoc/manuels/administration/aidewebservices/
Index ¶
- Variables
- func GetMerged(input []string) (map[string]string, error)
- func GetMultiwhere(input []string) (map[string][]Library, error)
- func ID2ppn(input []string, id2 string) (map[string][]string, error)
- func Issn2ppn(input []string) (map[string][]string, error)
- type ID2ppnData
- type Issn2ppnData
- type Library
- type MergedData
- type MultiwhereData
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var ID2 = []string{
"frbn2ppn",
"ocn2ppn",
"dnb2ppn",
"ucatb2ppn",
"frcairninfo2ppn",
"springerln2ppn",
"isbn2ppn",
"ean2ppn",
}
Functions ¶
func GetMerged ¶
GetMerged takes any number of Sudoc ID numbers (PPN) and matches them with the ID of the merged marc record it echoes the IDs you input, then outputs the returned PPNs Sudoc responds with an error if there's nothing to return
Example ¶
input := []string{"071860576"}
result, _ := GetMerged(input)
for k, v := range result {
fmt.Println(k, v)
}
Output: 071860576 007527446
func GetMultiwhere ¶
GetMultiwhere, given a record ID in the Sudoc catalog will return the list of libraries that hold this item
Example ¶
myInput := []string{"154923206"}
result, _ := GetMultiwhere(myInput)
for k, v := range result {
fmt.Println(k)
for _, lib := range v {
fmt.Printf("RCR: %v / Shortname: %v / Latitude: %v / Longitude: %v\n", lib.RCR, lib.Shortname, lib.Latitude, lib.Longitude)
}
}
Output: 154923206 RCR: 751052105 / Shortname: PARIS-Bib. de la Sorbonne - BIS / Latitude: 48.8517361 / Longitude: 2.3484821 RCR: 751052116 / Shortname: PARIS-Bib. Sainte Geneviève / Latitude: 48.8467139 / Longitude: 2.3463854
func ID2ppn ¶
ID2ppn is used for several related web services: given one or more IDs such as isbns, OCLC ocn, etc. and given the appropriate service to try (isbn, ocn, etc) will return the corresponding sudoc record IDs
Example ¶
myIDService := "frbn2ppn"
myInput := []string{"00000051X"}
result, _ := ID2ppn(myInput, myIDService)
for k, v := range result {
fmt.Println(k)
for _, value := range v {
fmt.Println(value)
}
}
Output: 00000051X 000000167 02635778X
Types ¶
type ID2ppnData ¶
type ID2ppnData struct {
Err string `xml:"error"`
Pairs []struct {
Frbn string `xml:"frbn,omitempty"`
Ocn string `xml:"ocn,omitempty"`
Dnb string `xml:"dnb,omitempty"`
Ucatb string `xml:"ucatb,omitempty"`
FrCairnInfo string `xml:"frcairninfo,omitempty"`
SpringerLN string `xml:"springerln,omitempty"`
Isbn string `xml:"isbn,omitempty"`
Ean string `xml:"ean,omitempty"`
PPNs []string `xml:"result>ppn"`
} `xml:"query"`
}
ID2ppnData: used to unmarshal the XML returned by Sudoc will populate the appropriate field given a service, e.g. Ocn for the ocn2ppn web service, and ignore the other fields
type Issn2ppnData ¶
type Issn2ppnData struct {
Err string `xml:"error"`
Pairs []struct {
Issn string `xml:"issn,omitempty"`
PPNs []string `xml:"result>ppn"`
PPNsNoHolding []string `xml:"resultNoHolding>ppn"`
} `xml:"query"`
}
Issn2ppnData: used to unmarshal the XML returned by Sudoc for the issn2ppn web service
type Library ¶
type Library struct {
RCR string `xml:"rcr"`
Shortname string `xml:"shortname"`
Latitude string `xml:"latitude"`
Longitude string `xml:"longitude"`
}
Library is used when we unmarshal the library info embedded in the returned XML i.e. library ID, name, lat and longitude.
type MergedData ¶
type MergedData struct {
Err string `xml:"error"`
Pairs []struct {
Queried string `xml:"ppn"`
Merged string `xml:"result>ppn"`
} `xml:"query"`
}
MergedData is used to parse xml response
type MultiwhereData ¶
type MultiwhereData struct {
Err string `xml:"error"`
Results []struct {
Queried string `xml:"ppn"`
Libraries []Library `xml:"result>library"`
} `xml:"query"`
}
MultiwhereData is used to parse xml response for the multiwhere web service