Skip to content

Commit 16dc2e6

Browse files
committed
don't use fundgroup for single funder in crossrefxml writer
1 parent 200f7ed commit 16dc2e6

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

cmd/root.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
// rootCmd represents the base command when called without any subcommands
1414
var rootCmd = &cobra.Command{
1515
Use: "commonmeta",
16-
Version: "v0.13.4",
16+
Version: "v0.13.5",
1717
Short: "Convert scholarly metadata between formats",
1818
Long: `Convert scholarly metadata between formats. Currently
1919
supported formats include Crossref, DataCite, Schema.org, CSL, InvenioRDM,

crossrefxml/writer.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,15 @@ func Convert(data commonmeta.Data) (Body, error) {
259259
}
260260
a = append(a, f)
261261
}
262-
fg := Assertion{
263-
Name: "fundgroup",
264-
Assertion: a,
262+
if len(data.FundingReferences) > 1 {
263+
fg := Assertion{
264+
Name: "fundgroup",
265+
Assertion: a,
266+
}
267+
assertion = append(assertion, fg)
268+
} else {
269+
assertion = append(assertion, a...)
265270
}
266-
assertion = append(assertion, fg)
267271
}
268272
program = append(program, Program{
269273
Name: "fundref",

0 commit comments

Comments
 (0)