diff --git a/cmd/version.go b/cmd/version.go index 9c1eacc..78d94d7 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -13,7 +13,7 @@ var versionCmd = &cobra.Command{ Short: "Print the version number of commonmeta", Long: `All software has versions. This is commonmeta's`, Run: func(cmd *cobra.Command, args []string) { - cmd.Println("Commonmeta v0.3.15 -- HEAD") + cmd.Println("Commonmeta v0.3.16 -- HEAD") }, } diff --git a/crossrefxml/reader.go b/crossrefxml/reader.go index c3c2f44..8a840c8 100644 --- a/crossrefxml/reader.go +++ b/crossrefxml/reader.go @@ -125,7 +125,7 @@ type Archive struct { type ArchiveLocations struct { XMLName xml.Name `xml:"archive_locations"` Text string `xml:",chardata"` - Archive []Archive `xml:"archive"` + Archive []Archive `xml:"archive,omitempty"` } type Assertion struct { diff --git a/crossrefxml/writer.go b/crossrefxml/writer.go index da6b1c1..e7a6940 100644 --- a/crossrefxml/writer.go +++ b/crossrefxml/writer.go @@ -173,6 +173,14 @@ func Convert(data commonmeta.Data) (Body, error) { } } + var issn []ISSN + if data.Container.IdentifierType == "issn" { + issn = append(issn, ISSN{ + MediaType: "electronic", + Text: data.Container.Identifier, + }) + } + doiData := DOIData{ DOI: doi, Resource: data.URL, @@ -380,10 +388,6 @@ func Convert(data commonmeta.Data) (Body, error) { CitationList: citationList, }) case "JournalArticle": - // var issn string - // if len(data.Container.Identifier) > 0 { - // issn = data.Container.Identifier[0].Identifier - // } c.Journal = append(c.Journal, Journal{ JournalArticle: JournalArticle{ PublicationType: "full_text", @@ -397,7 +401,7 @@ func Convert(data commonmeta.Data) (Body, error) { // }, DOIData: doiData, // Pages: - // Program: program, + Program: program, // PublicationDate: data.Date.Published, // PublisherItem: PublisherItem{ // ItemNumber: itemNumber, @@ -405,9 +409,9 @@ func Convert(data commonmeta.Data) (Body, error) { Titles: titles, }, JournalMetadata: JournalMetadata{ + Language: data.Language, FullTitle: data.Container.Title, - //ISSN: []string{issn}, - Language: data.Language, + ISSN: issn, }, JournalIssue: JournalIssue{ JournalVolume: JournalVolume{ @@ -415,9 +419,6 @@ func Convert(data commonmeta.Data) (Body, error) { }, Issue: data.Container.Issue, }, - // JournalVolume: JournalVolume{ - // Volume: data.Container.Volume, - // }, }) case "PeerReview": c.PeerReview = append(c.PeerReview, PeerReview{})