crossrefxml

package
v0.3.19 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package crossrefxml provides function to convert Crossref XML metadata to/from the commonmeta metadata format.

Index

Constants

This section is empty.

Variables

View Source
var CMToCRMappings = map[string]string{
	"Article":            "PostedContent",
	"BookChapter":        "BookChapter",
	"BookSeries":         "BookSeries",
	"Book":               "Book",
	"Component":          "Component",
	"Dataset":            "Dataset",
	"Dissertation":       "Dissertation",
	"Grant":              "Grant",
	"JournalArticle":     "JournalArticle",
	"JournalIssue":       "JournalIssue",
	"JournalVolume":      "JournalVolume",
	"Journal":            "Journal",
	"ProceedingsArticle": "ProceedingsArticle",
	"ProceedingsSeries":  "ProceedingsSeries",
	"Proceedings":        "Proceedings",
	"ReportComponent":    "ReportComponent",
	"ReportSeries":       "ReportSeries",
	"Report":             "Report",
	"Review":             "PeerReview",
	"Other":              "Other",
}

CMToCRMappings maps Commonmeta types to Crossref types source: http://api.crossref.org/types

View Source
var CRToCMMappings = map[string]string{
	"journal_title":       "Journal",
	"journal_issue":       "JournalIssue",
	"journal_volume":      "JournalVolume",
	"journal_article":     "JournalArticle",
	"conference_title":    "Proceedings",
	"conference_series":   "ProceedingsSeries",
	"conference_paper":    "ProceedingsArticle",
	"book_title":          "Book",
	"book_series":         "BookSeries",
	"book_content":        "BookChapter",
	"component":           "Component",
	"dissertation":        "Dissertation",
	"peer_review":         "PeerReview",
	"posted_content":      "Article",
	"report-paper_title":  "Report",
	"report-paper_series": "ReportSeries",

	"standard_title":  "Standard",
	"standard_series": "StandardSeries",
}

CRToCMMappings maps Crossref Query types to Commonmeta types source: https://www.crossref.org/schemas/crossref_query_output3.0.xsd Crossref Query naming conventions are different from the REST API

View Source
var InterWorkRelationTypes = []string{
	"IsPartOf",
	"HasPart",
	"IsReviewOf",
	"HasReview",
	"IsRelatedMaterial",
	"HasRelatedMaterial",
}
View Source
var IntraWorkRelationTypes = []string{
	"IsIdenticalTo",
	"IsPreprintOf",
	"HasPreprint",
	"IsTranslationOf",
	"HasTranslation",
	"IsVersionOf",
	"HasVersion",
}

Functions

func Fetch added in v0.2.8

func Fetch(str string) (commonmeta.Data, error)

Fetch gets the metadata for a single work from the Crossref API and converts it to the Commonmeta format

func GetContributors added in v0.2.8

func GetContributors(contrib Contributors) ([]commonmeta.Contributor, error)

func GetFundingReferences added in v0.2.8

func GetFundingReferences(fundref Program) ([]commonmeta.FundingReference, error)

func Load added in v0.2.8

func Load(filename string) (commonmeta.Data, error)

Load loads the metadata for a single work from a XML file

func LoadAll added in v0.2.14

func LoadAll(filename string) ([]commonmeta.Data, error)

LoadAll loads the metadata for a list of works from an XML file and converts it to the Commonmeta format

func Read added in v0.2.1

func Read(query Query) (commonmeta.Data, error)

Read Crossref XML response and return work struct in Commonmeta format

func ReadAll added in v0.2.13

func ReadAll(query []Query) ([]commonmeta.Data, error)

ReadAll reads a list of Crossref XML responses and returns a list of works in Commonmeta format

func Upload added in v0.3.1

func Upload(content []byte, account Account) (string, error)

func Write added in v0.2.14

func Write(data commonmeta.Data, account Account) ([]byte, []gojsonschema.ResultError)

Write writes Crossrefxml metadata.

func WriteAll added in v0.2.15

func WriteAll(list []commonmeta.Data, account Account) ([]byte, []gojsonschema.ResultError)

WriteAll writes a list of commonmeta metadata.

Types

type Abstract added in v0.2.8

type Abstract struct {
	XMLName      xml.Name `xml:"abstract"`
	Xmlns        string   `xml:"xmlns,attr"`
	Title        string   `xml:"title,attr,omitempty"`
	AbstractType string   `xml:"abstract-type,attr,omitempty"`
	Text         string   `xml:",chardata"`
	P            []P      `xml:"p"`
}

type AcceptanceDate added in v0.2.8

type AcceptanceDate struct {
	XMLName   xml.Name `xml:"acceptance_date"`
	MediaType string   `xml:"media_type,attr"`
	Month     string   `xml:"month"`
	Day       string   `xml:"day"`
	Year      string   `xml:"year"`
}

type Account added in v0.2.14

type Account struct {
	LoginID       string `xml:"login_id"`
	LoginPassword string `xml:"login_passwd"`
	Depositor     string `xml:"depositor"`
	Email         string `xml:"email"`
	Registrant    string `xml:"registrant"`
}

type Affiliation added in v0.2.8

type Affiliation struct {
	XMLName xml.Name `xml:"affiliation"`
	Text    string   `xml:",chardata"`
}

Affiliation represents an affiliation in Crossref XML metadata.

type Affiliations added in v0.2.14

type Affiliations struct {
	XMLName     xml.Name      `xml:"affiliations"`
	Institution []Institution `xml:"institution,omitempty"`
}

type ApprovalDate added in v0.2.8

type ApprovalDate struct {
	XMLName xml.Name `xml:"approval_date"`
	Month   string   `xml:"month"`
	Day     string   `xml:"day"`
	Year    string   `xml:"year"`
}

type Archive added in v0.2.8

type Archive struct {
	XMLName xml.Name `xml:"archive"`
	Text    string   `xml:",chardata"`
	Name    string   `xml:"name,attr"`
}

type ArchiveLocations added in v0.2.8

type ArchiveLocations struct {
	XMLName xml.Name  `xml:"archive_locations"`
	Text    string    `xml:",chardata"`
	Archive []Archive `xml:"archive,omitempty"`
}

type Assertion added in v0.2.8

type Assertion struct {
	XMLName    xml.Name    `xml:"assertion"`
	Text       string      `xml:",chardata"`
	Name       string      `xml:"name,attr"`
	Provider   string      `xml:"provider,attr,omitempty"`
	Label      string      `xml:"label,attr,omitempty"`
	GroupName  string      `xml:"group_name,attr,omitempty"`
	GroupLabel string      `xml:"group_label,attr,omitempty"`
	Order      string      `xml:"order,attr,omitempty"`
	Assertion  []Assertion `xml:"assertion"`
}

type Body added in v0.3.13

type Body struct {
	XMLName       xml.Name        `xml:"body"`
	Book          []Book          `xml:"book,omitempty"`
	Conference    []Conference    `xml:"conference,omitempty"`
	Database      []Database      `xml:"database,omitempty"`
	Dissertation  []Dissertation  `xml:"dissertation,omitempty"`
	Journal       []Journal       `xml:"journal,omitempty"`
	PeerReview    []PeerReview    `xml:"peer_review,omitempty"`
	PostedContent []PostedContent `xml:"posted_content,omitempty"`
	SAComponent   []SAComponent   `xml:"sa_component,omitempty"`
	Standard      []Standard      `xml:"standard,omitempty"`
}

func Convert added in v0.2.14

func Convert(data commonmeta.Data) (Body, error)

Convert converts Commonmeta metadata to Crossrefxml metadata

type Book added in v0.2.8

type Book struct {
	XMLName         xml.Name        `xml:"book"`
	BookType        string          `xml:"book_type,attr"`
	BookMetadata    BookMetadata    `xml:"book_metadata"`
	BookSetMetadata BookSetMetadata `xml:"book_set_metadata"`
	ContentItem     ContentItem     `xml:"content_item"`
}

type BookMetadata added in v0.2.8

type BookMetadata struct {
	XMLName         xml.Name          `xml:"book_metadata"`
	Language        string            `xml:"language,attr"`
	Contributors    Contributors      `xml:"contributors"`
	Titles          Titles            `xml:"titles"`
	Abstract        []Abstract        `xml:"abstract"`
	EditionNumber   int               `xml:"edition_number"`
	PublicationDate []PublicationDate `xml:"publication_date"`
	ISBN            []ISBN            `xml:"isbn"`
	Publisher       Publisher         `xml:"publisher"`
	DOIData         DOIData           `xml:"doi_data"`
}

type BookSetMetadata added in v0.2.13

type BookSetMetadata struct {
	XMLName         xml.Name          `xml:"book_set_metadata"`
	Language        string            `xml:"language,attr"`
	SetMetadata     SetMetadata       `xml:"set_metadata"`
	Volume          string            `xml:"volume"`
	EditionNumber   string            `xml:"edition_number"`
	PublicationDate []PublicationDate `xml:"publication_date"`
	ISBN            []ISBN            `xml:"isbn"`
	Publisher       Publisher         `xml:"publisher"`
}

type CRMItem added in v0.2.8

type CRMItem struct {
	XMLName xml.Name `xml:"crm-item"`
	Text    string   `xml:",chardata"`
	Name    string   `xml:"name,attr"`
	Type    string   `xml:"type,attr"`
	Claim   string   `xml:"claim,attr"`
}

type Citation added in v0.2.8

type Citation struct {
	XMLName            xml.Name `xml:"citation"`
	Key                string   `xml:"key,attr"`
	JournalTitle       string   `xml:"journal_title,omitempty"`
	Author             string   `xml:"author,omitempty"`
	Volume             string   `xml:"volume,omitempty"`
	FirstPage          string   `xml:"first_page,omitempty"`
	CYear              string   `xml:"cYear,omitempty"`
	ArticleTitle       string   `xml:"article_title,omitempty"`
	DOI                *DOI     `xml:"doi,omitempty"`
	UnstructedCitation string   `xml:"unstructured_citation,omitempty"`
}

type CitationList added in v0.2.8

type CitationList struct {
	XMLName  xml.Name   `xml:"citation_list"`
	Citation []Citation `xml:"citation,omitempty"`
}

type Collection added in v0.2.8

type Collection struct {
	XMLName  xml.Name `xml:"collection"`
	Property string   `xml:"property,attr"`
	Item     []Item   `xml:"item"`
}

type Component added in v0.2.8

type Component struct {
	XMLName        xml.Name `xml:"component"`
	RegAgency      string   `xml:"reg-agency,attr"`
	ParentRelation string   `xml:"parent_relation,attr"`
	Text           string   `xml:",chardata"`
	Titles         Titles   `xml:"titles"`
	Format         Format   `xml:"format"`
	DOIData        DOIData  `xml:"doi_data"`
}

type ComponentList added in v0.2.8

type ComponentList struct {
	XMLName   xml.Name    `xml:"component_list"`
	Text      string      `xml:",chardata"`
	Component []Component `xml:"component"`
}

type Conference added in v0.2.8

type Conference struct {
	XMLName             xml.Name            `xml:"conference"`
	Contributors        Contributors        `xml:"contributors"`
	EventMetadata       EventMetadata       `xml:"event_metadata"`
	ProceedingsMetadata ProceedingsMetadata `xml:"proceedings_metadata"`
	ConferencePaper     ConferencePaper     `xml:"conference_paper"`
}

type ConferencePaper added in v0.2.8

type ConferencePaper struct {
	XMLName         xml.Name          `xml:"conference_paper"`
	PublicationType string            `xml:"publication_type,attr"`
	Contributors    Contributors      `xml:"contributors"`
	Titles          Titles            `xml:"titles"`
	PublicationDate []PublicationDate `xml:"publication_date"`
	Pages           Pages             `xml:"pages"`
	PublisherItem   PublisherItem     `xml:"publisher_item"`
	Crossmark       Crossmark         `xml:"crossmark"`
	DOIData         DOIData           `xml:"doi_data"`
	CitationList    CitationList      `xml:"citation_list,omitempty"`
}

type Content

type Content struct {
	XMLName       xml.Name       `xml:"crossref"`
	Xmlns         string         `xml:"xmlns,attr,omitempty"`
	Book          *Book          `xml:"book,omitempty"`
	Conference    *Conference    `xml:"conference,omitempty"`
	Database      *Database      `xml:"database,omitempty"`
	Dissertation  *Dissertation  `xml:"dissertation,omitempty"`
	Journal       *Journal       `xml:"journal,omitempty"`
	PeerReview    *PeerReview    `xml:"peer_review,omitempty"`
	PostedContent *PostedContent `xml:"posted_content,omitempty"`
	SAComponent   *SAComponent   `xml:"sa_component,omitempty"`
	Standard      *Standard      `xml:"standard,omitempty"`
}

Content represents the Crossref XML metadata returned from Crossref. The type uses a struct instead of the slice for the Crossref metadata.

type ContentItem added in v0.2.8

type ContentItem struct {
	XMLName             xml.Name          `xml:"content_item"`
	ComponentType       string            `xml:"component_type,attr"`
	LevelSequenceNumber string            `xml:"level_sequence_number,attr"`
	PublicationType     string            `xml:"publication_type,attr"`
	Contributors        Contributors      `xml:"contributors"`
	Titles              Titles            `xml:"titles"`
	PublicationDate     []PublicationDate `xml:"publication_date"`
	Pages               struct {
		FirstPage string `xml:"first_page"`
		LastPage  string `xml:"last_page"`
	} `xml:"pages"`
	DOIData      DOIData      `xml:"doi_data"`
	CitationList CitationList `xml:"citation_list,omitempty"`
}

type Contributors added in v0.2.8

type Contributors struct {
	XMLName    xml.Name     `xml:"contributors"`
	PersonName []PersonName `xml:"person_name"`
}

type CreationDate added in v0.2.8

type CreationDate struct {
	XMLName   xml.Name `xml:"creation_date"`
	MediaType string   `xml:"media_type,attr"`
	Month     string   `xml:"month"`
	Day       string   `xml:"day"`
	Year      string   `xml:"year"`
}

type Crossmark added in v0.2.8

type Crossmark struct {
	XMLName          xml.Name `xml:"crossmark"`
	Text             string   `xml:",chardata"`
	CrossmarkVersion string   `xml:"crossmark_version"`
	CrossmarkPolicy  string   `xml:"crossmark_policy"`
	CrossmarkDomains struct {
		Text            string `xml:",chardata"`
		CrossmarkDomain struct {
			Text   string `xml:",chardata"`
			Domain string `xml:"domain"`
		} `xml:"crossmark_domain"`
	} `xml:"crossmark_domains"`
	CrossmarkDomainExclusive string         `xml:"crossmark_domain_exclusive"`
	CustomMetadata           CustomMetadata `xml:"custom_metadata"`
}

type Crossrefxml added in v0.2.8

type Crossrefxml struct {
	XMLName xml.Name `xml:"body"`
	Query   Query    `xml:"query"`
}

Crossrefxml represents the Crossref XML metadata.

type CustomMetadata added in v0.2.8

type CustomMetadata struct {
	XMLName   xml.Name    `xml:"custom_metadata"`
	Text      string      `xml:",chardata"`
	Assertion []Assertion `xml:"assertion"`
	Program   []Program   `xml:"program"`
}

type DOI added in v0.2.11

type DOI struct {
	Type     string `xml:"type,attr,omitempty"`
	Provider string `xml:"provider,attr,omitempty"`
	Text     string `xml:",chardata"`
}

type DOIBatch added in v0.2.15

type DOIBatch struct {
	XMLName        xml.Name `xml:"doi_batch"`
	Xmlns          string   `xml:"xmlns,attr,omitempty"`
	Version        string   `xml:"version,attr,omitempty"`
	Xsi            string   `xml:"xsi,attr,omitempty"`
	SchemaLocation string   `xml:"schemaLocation,attr,omitempty"`
	Head           Head     `xml:"head"`
	Body           Body     `xml:"body"`
}

type DOIData added in v0.2.8

type DOIData struct {
	XMLName    xml.Name   `xml:"doi_data"`
	DOI        string     `xml:"doi"`
	Timestamp  string     `xml:"timestamp,omitempty"`
	Resource   string     `xml:"resource"`
	Collection Collection `xml:"collection,omitempty"`
}

type DOIRecord added in v0.2.8

type DOIRecord struct {
	XMLName  xml.Name `xml:"doi_record"`
	Crossref Content  `xml:"crossref"`
}

type Database added in v0.2.8

type Database struct {
	DatabaseMetadata DatabaseMetadata `xml:"database_metadata"`
	Dataset          Dataset          `xml:"dataset"`
}

type DatabaseMetadata added in v0.2.8

type DatabaseMetadata struct {
	Titles struct {
		Title string `xml:"title"`
	} `xml:"titles"`
}

type Dataset added in v0.2.8

type Dataset struct {
	Contributors Contributors `xml:"contributors"`
	Titles       Titles       `xml:"titles"`
	DatabaseDate struct {
		CreationDate CreationDate `xml:"creation_date"`
	} `xml:"database_date"`
	DOIData DOIData `xml:"doi_data"`
}

type Depositor added in v0.2.15

type Depositor struct {
	DepositorName string `xml:"depositor_name"`
	Email         string `xml:"email_address"`
}

type Dissertation added in v0.2.8

type Dissertation struct {
	XMLName         xml.Name     `xml:"dissertation"`
	Language        string       `xml:"language"`
	PublicationType string       `xml:"publication_type"`
	PersonName      []PersonName `xml:"person_name"`
	Titles          Titles       `xml:"titles"`
	ApprovalDate    ApprovalDate `xml:"approval_date"`
	Institution     Institution  `xml:"institution"`
	Degree          string       `xml:"degree"`
	DOIData         DOIData      `xml:"doi_data"`
	CitationList    CitationList `xml:"citation_list,omitempty"`
}

type EventMetadata added in v0.2.8

type EventMetadata struct {
	XMLName            xml.Name `xml:"event_metadata"`
	ConferenceName     string   `xml:"conference_name"`
	ConferenceAcronym  string   `xml:"conference_acronym"`
	ConferenceSponsor  string   `xml:"conference_sponsor"`
	ConferenceLocation string   `xml:"conference_location"`
	ConferenceDate     string   `xml:"conference_date"`
}

type Format added in v0.2.8

type Format struct {
	XMLName  xml.Name `xml:"format"`
	MimeType string   `xml:"mime_type,attr"`
	Text     string   `xml:",chardata"`
}
type Head struct {
	DOIBatchID string    `xml:"doi_batch_id"`
	Timestamp  string    `xml:"timestamp"`
	Depositor  Depositor `xml:"depositor"`
	Registrant string    `xml:"registrant"`
}

type ISBN added in v0.2.8

type ISBN struct {
	XMLName   xml.Name `xml:"isbn"`
	MediaType string   `xml:"media_type,attr"`
	Text      string   `xml:",chardata"`
}

ISBN represents a ISSN in Crossref XML metadata.

type ISSN added in v0.2.8

type ISSN struct {
	XMLName   xml.Name `xml:"issn"`
	MediaType string   `xml:"media_type,attr"`
	Text      string   `xml:",chardata"`
}

ISSN represents a ISSN in Crossref XML metadata.

type Institution added in v0.2.8

type Institution struct {
	XMLName          xml.Name       `xml:"institution"`
	InstitutionName  string         `xml:"institution_name,omitempty"`
	InstitutionPlace string         `xml:"institution_place,omitempty"`
	InstitutionID    *InstitutionID `xml:"institution_id,omitempty"`
}

type InstitutionID added in v0.2.14

type InstitutionID struct {
	XMLName xml.Name `xml:"institution_id"`
	Type    string   `xml:"type,attr,omitempty"`
	Text    string   `xml:",chardata"`
}

type InterWorkRelation added in v0.2.14

type InterWorkRelation struct {
	XMLName          xml.Name `xml:"inter_work_relation"`
	RelationshipType string   `xml:"relationship-type,attr"`
	IdentifierType   string   `xml:"identifier-type,attr"`
	Text             string   `xml:",chardata"`
}

type IntraWorkRelation added in v0.2.14

type IntraWorkRelation struct {
	Text             string `xml:",chardata"`
	RelationshipType string `xml:"relationship-type,attr"`
	IdentifierType   string `xml:"identifier-type,attr"`
}

type Item added in v0.2.8

type Item struct {
	XMLName  xml.Name `xml:"item"`
	Crawler  string   `xml:"crawler,attr,omitempty"`
	Resource Resource `xml:"resource"`
}

type ItemNumber added in v0.2.8

type ItemNumber struct {
	XMLName        xml.Name `xml:"item_number"`
	ItemNumberType string   `xml:"item_number_type,attr"`
	Text           string   `xml:",chardata"`
}

ItemNumber represents an item number in Crossref XML metadata.

type Journal added in v0.2.8

type Journal struct {
	XMLName         xml.Name        `xml:"journal"`
	JournalMetadata JournalMetadata `xml:"journal_metadata,omitempty"`
	JournalIssue    JournalIssue    `xml:"journal_issue,omitempty"`
	JournalArticle  JournalArticle  `xml:"journal_article,omitempty"`
}

Journal represents a journal in Crossref XML metadata.

type JournalArticle added in v0.2.8

type JournalArticle struct {
	XMLName                   xml.Name          `xml:"journal_article"`
	Text                      string            `xml:",chardata"`
	PublicationType           string            `xml:"publication_type,attr,omitempty"`
	ReferenceDistributionOpts string            `xml:"reference_distribution_opts,attr,omitempty"`
	Titles                    Titles            `xml:"titles,omitempty"`
	Contributors              Contributors      `xml:"contributors,omitempty"`
	PublicationDate           []PublicationDate `xml:"publication_date"`
	PublisherItem             *PublisherItem    `xml:"publisher_item,omitempty"`
	Abstract                  []Abstract        `xml:"jats:abstract"`
	Pages                     *Pages            `xml:"pages,omitempty"`
	ISSN                      []ISSN            `xml:"issn"`
	Program                   []Program         `xml:"program"`
	Crossmark                 *Crossmark        `xml:"crossmark,omitempty"`
	ArchiveLocations          ArchiveLocations  `xml:"archive_locations"`
	DOIData                   DOIData           `xml:"doi_data"`
	CitationList              CitationList      `xml:"citation_list,omitempty"`
}

JournalArticle represents a journal article in Crossref XML metadata.

type JournalIssue added in v0.2.8

type JournalIssue struct {
	XMLName         xml.Name          `xml:"journal_issue"`
	PublicationDate []PublicationDate `xml:"publication_date"`
	JournalVolume   JournalVolume     `xml:"journal_volume,omitempty"`
	Issue           string            `xml:"issue,omitempty"`
	DOIData         *DOIData          `xml:"doi_data,omitempty"`
}

type JournalMetadata added in v0.2.8

type JournalMetadata struct {
	XMLName   xml.Name `xml:"journal_metadata"`
	Language  string   `xml:"language,attr,omitempty"`
	FullTitle string   `xml:"full_title,omitempty"`
	ISSN      []ISSN   `xml:"issn,omitempty"`
	DOIData   *DOIData `xml:"doi_data,omitempty"`
}

JournalMetadata represents journal metadata in Crossref XML metadata.

type JournalVolume added in v0.2.8

type JournalVolume struct {
	XMLName xml.Name `xml:"journal_volume"`
	Volume  string   `xml:"volume"`
}

type LicenseRef added in v0.2.8

type LicenseRef struct {
	Text      string `xml:",chardata"`
	AppliesTo string `xml:"applies_to,attr"`
}

type OriginalLanguageTitle added in v0.2.14

type OriginalLanguageTitle struct {
	Text     string `xml:",chardata"`
	Language string `xml:"language,attr"`
}

type P added in v0.2.8

type P struct {
	XMLName xml.Name `xml:"p"`
	Xmlns   string   `xml:"xmlns,attr,omitempty"`
	Text    string   `xml:",chardata"`
}

type Pages added in v0.2.8

type Pages struct {
	FirstPage string `xml:"first_page"`
	LastPage  string `xml:"last_page"`
}

type PeerReview added in v0.2.8

type PeerReview struct {
	XMLName                    xml.Name     `xml:"peer_review"`
	Stage                      string       `xml:"stage,attr"`
	RevisionRound              string       `xml:"revision-round,attr"`
	Recommendation             string       `xml:"recommendation,attr"`
	Type                       string       `xml:"type,attr"`
	Contributors               Contributors `xml:"contributors"`
	Titles                     Titles       `xml:"titles"`
	ReviewDate                 ReviewDate   `xml:"review_date"`
	CompetingInterestStatement string       `xml:"competing_interest_statement"`
	Program                    []Program    `xml:"program"`
	DOIData                    DOIData      `xml:"doi_data"`
}

type PersonName added in v0.2.8

type PersonName struct {
	XMLName         xml.Name      `xml:"person_name"`
	ContributorRole string        `xml:"contributor_role,attr"`
	Sequence        string        `xml:"sequence,attr"`
	Text            string        `xml:",chardata"`
	GivenName       string        `xml:"given_name"`
	Surname         string        `xml:"surname"`
	Affiliations    *Affiliations `xml:"affiliations,omitempty"`
	Affiliation     string        `xml:"affiliation,omitempty"`
	ORCID           string        `xml:"ORCID,omitempty"`
}

PersonName represents a person in Crossref XML metadata.

type PostedContent added in v0.2.8

type PostedContent struct {
	XMLName        xml.Name        `xml:"posted_content"`
	Type           string          `xml:"type,attr"`
	Language       string          `xml:"language,attr,omitempty"`
	GroupTitle     string          `xml:"group_title,omitempty"`
	Contributors   Contributors    `xml:"contributors,omitempty"`
	Titles         Titles          `xml:"titles,omitempty"`
	PostedDate     PostedDate      `xml:"posted_date,omitempty"`
	AcceptanceDate *AcceptanceDate `xml:"acceptance_date,omitempty"`
	Institution    *Institution    `xml:"institution,omitempty"`
	ItemNumber     ItemNumber      `xml:"item_number,omitempty"`
	Abstract       []Abstract      `xml:"abstract"`
	Program        []Program       `xml:"program"`
	DOIData        DOIData         `xml:"doi_data"`
	CitationList   CitationList    `xml:"citation_list,omitempty"`
}

PostedContent represents posted content in Crossref XML metadata.

type PostedDate added in v0.2.8

type PostedDate struct {
	XMLName   xml.Name `xml:"posted_date"`
	MediaType string   `xml:"media_type,attr"`
	Month     string   `xml:"month"`
	Day       string   `xml:"day"`
	Year      string   `xml:"year"`
}

type ProceedingsMetadata added in v0.2.8

type ProceedingsMetadata struct {
	XMLName          xml.Name          `xml:"proceedings_metadata"`
	Language         string            `xml:"language,attr"`
	ProceedingsTitle string            `xml:"proceedings_title"`
	Publisher        Publisher         `xml:"publisher"`
	PublicationDate  []PublicationDate `xml:"publication_date"`
	ISBN             []ISBN            `xml:"isbn"`
	PublisherItem    PublisherItem     `xml:"publisher_item"`
	DOIData          DOIData           `xml:"doi_data"`
}

type Program added in v0.2.8

type Program struct {
	XMLName     xml.Name      `xml:"program"`
	Xmlns       string        `xml:"xmlns,attr"`
	Fr          string        `xml:"fr,attr,omitempty"`
	Name        string        `xml:"name,attr,omitempty"`
	Ai          string        `xml:"ai,attr,omitempty"`
	Rel         string        `xml:"rel,attr,omitempty"`
	Text        string        `xml:",chardata"`
	Assertion   []Assertion   `xml:"assertion"`
	LicenseRef  []LicenseRef  `xml:"license_ref"`
	RelatedItem []RelatedItem `xml:"related_item"`
}

type PublicationDate added in v0.2.8

type PublicationDate struct {
	XMLName   xml.Name `xml:"publication_date"`
	MediaType string   `xml:"media_type,attr"`
	Month     string   `xml:"month"`
	Day       string   `xml:"day"`
	Year      string   `xml:"year"`
}

type Publisher added in v0.2.8

type Publisher struct {
	XMLName        xml.Name `xml:"publisher"`
	PublisherName  string   `xml:"publisher_name"`
	PublisherPlace string   `xml:"publisher_place"`
}

type PublisherItem added in v0.2.8

type PublisherItem struct {
	XMLName    xml.Name   `xml:"publisher_item"`
	Text       string     `xml:",chardata"`
	ItemNumber ItemNumber `xml:"item_number,omitempty"`
	Identifier struct {
		Text   string `xml:",chardata"`
		IDType string `xml:"id_type,attr"`
	} `xml:"identifier"`
}

type Query added in v0.2.12

type Query struct {
	Status    string    `xml:"status,attr"`
	DOI       DOI       `xml:"doi"`
	CRMItem   []CRMItem `xml:"crm-item"`
	DOIRecord DOIRecord `xml:"doi_record"`
}

func Get added in v0.2.8

func Get(pid string) (Query, error)

Get gets the metadata for a single work from the Crossref API in Crossref XML format.

func (Query) Type added in v0.3.12

func (q Query) Type() string

Type represents the Crossref type of a work

type RelatedItem added in v0.2.8

type RelatedItem struct {
	XMLName           xml.Name           `xml:"related_item"`
	Text              string             `xml:",chardata"`
	Description       string             `xml:"description,omitempty"`
	InterWorkRelation *InterWorkRelation `xml:"inter_work_relation,omitempty"`
	IntraWorkRelation *IntraWorkRelation `xml:"intra_work_relation,omitempty"`
}

type Resource added in v0.2.8

type Resource struct {
	XMLName  xml.Name `xml:"resource"`
	Text     string   `xml:",chardata"`
	MimeType string   `xml:"mime_type,attr"`
}

Resource represents a resource in Crossref XML metadata.

type ReviewDate added in v0.2.8

type ReviewDate struct {
	XMLDate xml.Name `xml:"review_date"`
	Month   string   `xml:"month"`
	Day     string   `xml:"day"`
	Year    string   `xml:"year"`
}

type SAComponent added in v0.2.8

type SAComponent struct {
	XMLName       xml.Name      `xml:"sa_component"`
	ComponentList ComponentList `xml:"component_list"`
}

type SetMetadata added in v0.2.13

type SetMetadata struct {
	XMLName      xml.Name     `xml:"set_metadata"`
	Titles       Titles       `xml:"titles"`
	ISBN         []ISBN       `xml:"isbn"`
	Contributors Contributors `xml:"contributors"`
	DOIData      DOIData      `xml:"doi_data"`
}

type Standard added in v0.2.8

type Standard struct {
	XMLName xml.Name `xml:"standard"`
	DOIData DOIData  `xml:"doi_data"`
}

type StringMap added in v0.2.14

type StringMap map[string]string

type Titles added in v0.2.8

type Titles struct {
	XMLName               xml.Name               `xml:"titles"`
	Title                 string                 `xml:"title,omitempty"`
	Subtitle              string                 `xml:"subtitle,omitempty"`
	OriginalLanguageTitle *OriginalLanguageTitle `xml:"original_language_title,omitempty"`
}

Titles represents the titles in Crossref XML metadata.

Jump to

Keyboard shortcuts

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