Documentation
¶
Overview ¶
Package datacite provides function to convert DataCite metadata to/from the commonmeta metadata format.
Index ¶
- Variables
- func Fetch(str string) (commonmeta.Data, error)
- func FetchList(number int, sample bool) ([]commonmeta.Data, error)
- func GetContributor(v Contributor) commonmeta.Contributor
- func Load(filename string) (commonmeta.Data, error)
- func LoadList(filename string) ([]commonmeta.Data, error)
- func QueryURL(number int, sample bool) string
- func Read(content Content) (commonmeta.Data, error)
- func ReadList(content []Content) ([]commonmeta.Data, error)
- type Attributes
- type Content
- type Contributor
- type GeoLocation
- type GeoLocationBox
- type GeoLocationPoint
Constants ¶
This section is empty.
Variables ¶
var DCToCMTranslations = map[string]string{
"Audiovisual": "Audiovisual",
"BlogPosting": "Article",
"Book": "Book",
"BookChapter": "BookChapter",
"Collection": "Collection",
"ComputationalNotebook": "ComputationalNotebook",
"ConferencePaper": "ProceedingsArticle",
"ConferenceProceeding": "Proceedings",
"DataPaper": "JournalArticle",
"Dataset": "Dataset",
"Dissertation": "Dissertation",
"Event": "Event",
"Image": "Image",
"Instrument": "Instrument",
"InteractiveResource": "InteractiveResource",
"Journal": "Journal",
"JournalArticle": "JournalArticle",
"Model": "Model",
"OutputManagementPlan": "OutputManagementPlan",
"PeerReview": "PeerReview",
"PhysicalObject": "PhysicalObject",
"Poster": "Presentation",
"Preprint": "Article",
"Report": "Report",
"Service": "Service",
"Software": "Software",
"Sound": "Sound",
"Standard": "Standard",
"StudyRegistration": "StudyRegistration",
"Text": "Document",
"Thesis": "Dissertation",
"Workflow": "Workflow",
"Other": "Other",
}
DCToCMTranslations maps DataCite resource types to Commonmeta types source: https://github.com/datacite/schema/blob/master/source/meta/kernel-4/include/datacite-resourceType-v4.xsd
Functions ¶
func Fetch ¶ added in v0.2.1
func Fetch(str string) (commonmeta.Data, error)
Fetch fetches DataCite metadata for a given DOI and returns Commonmeta metadata.
func FetchList ¶ added in v0.2.1
func FetchList(number int, sample bool) ([]commonmeta.Data, error)
FetchList gets the metadata for a list of works from the DataCite API and returns Commonmeta metadata.
func GetContributor ¶
func GetContributor(v Contributor) commonmeta.Contributor
GetContributor converts DataCite contributor metadata into the Commonmeta format
func Load ¶ added in v0.2.1
func Load(filename string) (commonmeta.Data, error)
Load loads the metadata for a single work from a JSON file
func LoadList ¶ added in v0.2.1
func LoadList(filename string) ([]commonmeta.Data, error)
LoadList loads a list of DataCite metadata from a JSON string and returns Commonmeta metadata.
Types ¶
type Attributes ¶
type Attributes struct {
DOI string `json:"doi"`
Prefix string `json:"prefix"`
Suffix string `json:"suffix"`
AlternateIdentifiers []struct {
AlternateIdentifier string `json:"alternateIdentifier"`
AlternateIdentifierType string `json:"alternateIdentifierType"`
} `json:"alternateIdentifiers"`
Creators []Contributor `json:"creators"`
Publisher string `json:"publisher"`
Container struct {
Type string `json:"type"`
Identifier string `json:"identifier"`
IdentifierType string `json:"identifierType"`
Title string `json:"title"`
Volume string `json:"volume"`
Issue string `json:"issue"`
FirstPage string `json:"firstPage"`
LastPage string `json:"lastPage"`
} `json:"container"`
PublicationYear int `json:"publicationYear"`
Titles []struct {
Title string `json:"title"`
TitleType string `json:"titleType"`
Lang string `json:"lang"`
} `json:"titles"`
URL string `json:"url"`
Subjects []struct {
Subject string `json:"subject"`
} `json:"subjects"`
Contributors []Contributor `json:"contributors"`
Dates []struct {
Date string `json:"date"`
DateType string `json:"dateType"`
DateInformation string `json:"dateInformation"`
} `json:"dates"`
Language string `json:"language"`
Types struct {
ResourceTypeGeneral string `json:"resourceTypeGeneral"`
ResourceType string `json:"resourceType"`
} `json:"types"`
RelatedIdentifiers []struct {
RelatedIdentifier string `json:"relatedIdentifier"`
RelatedIdentifierType string `json:"relatedIdentifierType"`
RelationType string `json:"relationType"`
} `json:"relatedIdentifiers"`
Sizes []string `json:"sizes"`
Formats []string `json:"formats"`
Version string `json:"version"`
RightsList []struct {
Rights string `json:"rights"`
RightsURI string `json:"rightsUri"`
SchemeURI string `json:"schemeUri"`
RightsIdentifier string `json:"rightsIdentifier"`
RightsIdentifierScheme string `json:"rightsIdentifierScheme"`
}
Descriptions []struct {
Description string `json:"description"`
DescriptionType string `json:"descriptionType"`
Lang string `json:"lang"`
} `json:"descriptions"`
GeoLocations []GeoLocation `json:"geoLocations"`
FundingReferences []struct {
FunderName string `json:"funderName"`
FunderIdentifier string `json:"funderIdentifier"`
FunderIdentifierType string `json:"funderIdentifierType"`
AwardNumber string `json:"awardNumber"`
AwardURI string `json:"awardUri"`
} `json:"fundingReferences"`
}
Attributes represents the attributes of the DataCite JSONAPI response.
type Content ¶
type Content struct {
ID string `json:"id"`
Type string `json:"type"`
Attributes Attributes `json:"attributes"`
}
Content represents the DataCite metadata.
type Contributor ¶
type Contributor struct {
Name string `json:"name"`
GivenName string `json:"givenName"`
FamilyName string `json:"familyName"`
NameType string `json:"nameType"`
NameIdentifiers []struct {
SchemeURI string `json:"schemeUri"`
NameIdentifier string `json:"nameIdentifier"`
NameIdentifierScheme string `json:"nameIdentifierScheme"`
} `json:"nameIdentifiers"`
Affiliation []string `json:"affiliation"`
ContributorType string `json:"contributorType"`
}
Contributor represents the contributor of the DataCite JSONAPI response.
type GeoLocation ¶ added in v0.2.1
type GeoLocation struct {
GeoLocationPoint `json:"geoLocationPoint,omitempty"`
GeoLocationBox `json:"geoLocationBox,omitempty"`
GeoLocationPlace string `json:"geoLocationPlace,omitempty"`
}
type GeoLocationBox ¶ added in v0.2.1
type GeoLocationBox struct {
WestBoundLongitude float64 `json:"westBoundLongitude,string,omitempty"`
EastBoundLongitude float64 `json:"eastBoundLongitude,string,omitempty"`
SouthBoundLatitude float64 `json:"southBoundLatitude,string,omitempty"`
NorthBoundLatitude float64 `json:"northBoundLatitude,string,omitempty"`
}