@@ -31,28 +31,29 @@ type Query struct {
31
31
32
32
// Content represents the JSON Feed metadata.
33
33
type Content struct {
34
- ID string `json:"id"`
35
- DOI string `json:"doi"`
36
- GUID string `json:"guid"`
37
- RID string `json:"rid"`
38
- Abstract string `json:"abstract"`
39
- ArchiveURL string `json:"archive_url"`
40
- Authors Authors `json:"authors"`
41
- Blog Blog `json:"blog"`
42
- BlogName string `json:"blog_name"`
43
- BlogSlug string `json:"blog_slug"`
44
- ContentText string `json:"content_text"`
45
- FeatureImage string `json:"image"`
46
- IndexedAt int64 `json:"indexed_at"`
47
- Language string `json:"language"`
48
- PublishedAt int64 `json:"published_at"`
49
- Relationships []Relation `json:"relationships"`
50
- Reference []Reference `json:"reference"`
51
- Summary string `json:"summary"`
52
- Tags []string `json:"tags"`
53
- Title string `json:"title"`
54
- UpdatedAt int64 `json:"updated_at"`
55
- URL string `json:"url"`
34
+ ID string `json:"id"`
35
+ DOI string `json:"doi"`
36
+ GUID string `json:"guid"`
37
+ RID string `json:"rid"`
38
+ Abstract string `json:"abstract"`
39
+ ArchiveURL string `json:"archive_url"`
40
+ Authors Authors `json:"authors"`
41
+ Blog Blog `json:"blog"`
42
+ BlogName string `json:"blog_name"`
43
+ BlogSlug string `json:"blog_slug"`
44
+ ContentText string `json:"content_text"`
45
+ FeatureImage string `json:"image"`
46
+ IndexedAt int64 `json:"indexed_at"`
47
+ Language string `json:"language"`
48
+ PublishedAt int64 `json:"published_at"`
49
+ Relationships []Relation `json:"relationships"`
50
+ Reference []Reference `json:"reference"`
51
+ FundingReferences []FundingReference `json:"funding_references"`
52
+ Summary string `json:"summary"`
53
+ Tags []string `json:"tags"`
54
+ Title string `json:"title"`
55
+ UpdatedAt int64 `json:"updated_at"`
56
+ URL string `json:"url"`
56
57
}
57
58
58
59
// Affiliation represents an affiliation in the JSON Feed item.
@@ -92,6 +93,16 @@ type Funding struct {
92
93
FunderName string `json:"funder_name"`
93
94
}
94
95
96
+ // FundingReference represents the funding reference of a publication, defined in the commonmeta JSON Schema.
97
+ type FundingReference struct {
98
+ FunderIdentifier string `json:"funderIdentifier,omitempty"`
99
+ FunderIdentifierType string `json:"funderIdentifierType,omitempty"`
100
+ FunderName string `json:"funderName,omitempty"`
101
+ AwardNumber string `json:"awardNumber,omitempty"`
102
+ AwardTitle string `json:"awardTitle,omitempty"`
103
+ AwardURI string `json:"awardUri,omitempty"`
104
+ }
105
+
95
106
// Relation represents a relation in the JSON Feed item.
96
107
type Relation struct {
97
108
Type string `json:"type"`
@@ -559,6 +570,18 @@ func GetFundingReferences(content Content) []commonmeta.FundingReference {
559
570
AwardNumber : content .Blog .Funding .AwardNumber ,
560
571
AwardURI : content .Blog .Funding .AwardURI ,
561
572
})
573
+ }
574
+ if len (content .FundingReferences ) > 0 {
575
+ for _ , v := range content .FundingReferences {
576
+ fundingReferences = append (fundingReferences , commonmeta.FundingReference {
577
+ FunderName : v .FunderName ,
578
+ FunderIdentifier : v .FunderIdentifier ,
579
+ FunderIdentifierType : v .FunderIdentifierType ,
580
+ AwardTitle : v .AwardTitle ,
581
+ AwardNumber : v .AwardNumber ,
582
+ AwardURI : v .AwardURI ,
583
+ })
584
+ }
562
585
} else {
563
586
// Funding references from relationships
564
587
for _ , v := range content .Relationships {
0 commit comments