Documentation
¶
Index ¶
- Variables
- type Article
- func (article *Article) Authors() []finc.Author
- func (article *Article) CombinedTitle() string
- func (article *Article) DOI() (s string, err error)
- func (article *Article) Date() (t time.Time)
- func (article *Article) Headings() (hs []string)
- func (article *Article) ISSN() (issns []string)
- func (article *Article) Identifiers() (Identifiers, error)
- func (article *Article) JournalTitle() string
- func (article *Article) Languages() []string
- func (article *Article) PageCount() (s string)
- func (article *Article) Subjects() (ss []string)
- func (article *Article) ToIntermediateSchema() (*finc.IntermediateSchema, error)
- type Identifiers
- type PubDate
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoDOI = errors.New("DOI is missing") ErrNotImplemented = errors.New("not implemented") )
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct {
XMLName xml.Name `xml:"article"`
Type string `xml:"article-type,attr"`
Front struct {
XMLName xml.Name `xml:"front"`
Journal struct {
ID struct {
XMLName xml.Name `xml:"journal-id"`
Type string `xml:"journal-id-type,attr"`
Value string `xml:",chardata"`
}
ISSN []struct {
Type string `xml:"pub-type,attr"`
Value string `xml:",chardata"`
} `xml:"issn"`
TitleGroup struct {
XMLName xml.Name `xml:"journal-title-group"`
JournalTitle struct {
XMLName xml.Name `xml:"journal-title"`
Title string `xml:",chardata"`
}
AbbreviatedTitle struct {
XMLName xml.Name `xml:"abbrev-journal-title"`
Title string `xml:",chardata"`
Type string `xml:"abbrev-type,attr"`
}
}
AbbreviatedTitle struct {
XMLName xml.Name `xml:"abbrev-journal-title"`
Title string `xml:",chardata"`
Type string `xml:"abbrev-type,attr"`
}
Publisher struct {
XMLName xml.Name `xml:"publisher"`
Name struct {
XMLName xml.Name `xml:"publisher-name"`
Value string `xml:",chardata"`
}
}
} `xml:"journal-meta"`
Article struct {
XMLName xml.Name `xml:"article-meta"`
ID []struct {
Type string `xml:"pub-id-type,attr"`
Value string `xml:",chardata"`
} `xml:"article-id"`
TitleGroup struct {
XMLName xml.Name `xml:"title-group"`
Title struct {
XMLName xml.Name `xml:"article-title"`
Value string `xml:",innerxml"`
}
Subtitle struct {
XMLName xml.Name `xml:"subtitle"`
Value string `xml:",chardata"`
}
}
ContribGroup struct {
XMLName xml.Name `xml:"contrib-group"`
Contrib []struct {
Type string `xml:"contrib-type,attr"`
XLinkType string `xml:"xlink.type,attr"`
Name struct {
XMLName xml.Name `xml:"name"`
Style string `xml:"name-style"`
Surname struct {
XMLName xml.Name `xml:"surname"`
Value string `xml:",chardata"`
}
GivenNames struct {
XMLName xml.Name `xml:"given-names"`
Value string `xml:",chardata"`
}
}
StringName struct {
XMLName xml.Name `xml:"string-name"`
Surname struct {
XMLName xml.Name `xml:"surname"`
Value string `xml:",chardata"`
}
GivenNames struct {
XMLName xml.Name `xml:"given-names"`
Value string `xml:",chardata"`
}
X struct {
XMLName xml.Name `xml:"x"`
Value string `xml:",chardata"`
}
Suffix struct {
XMLName xml.Name `xml:"suffix"`
Value string `xml:",chardata"`
}
}
} `xml:"contrib"`
}
Categories struct {
XMLName xml.Name `xml:"article-categories"`
SubjectGroups []struct {
Type string `xml:"subj-group-type,attr"`
Subjects []struct {
Value string `xml:",chardata"`
} `xml:"subject"`
} `xml:"subj-group"`
} `xml:"article-categories"`
PubDates []PubDate `xml:"pub-date"`
Volume struct {
XMLName xml.Name `xml:"volume"`
Value string `xml:",chardata"`
}
Issue struct {
XMLName xml.Name `xml:"issue"`
Value string `xml:",chardata"`
}
FirstPage struct {
XMLName xml.Name `xml:"fpage"`
Value string `xml:",chardata"`
}
LastPage struct {
XMLName xml.Name `xml:"lpage"`
Value string `xml:",chardata"`
}
Products []struct {
Source struct {
XMLName xml.Name `xml:"source"`
Value string `xml:",innerxml"`
}
StringName struct {
XMLName xml.Name `xml:"string-name"`
Value string `xml:",innerxml"`
}
} `xml:"product"`
Permissions struct {
XMLName xml.Name `xml:"permissions"`
CopyrightYear struct {
XMLName xml.Name `xml:"copyright-year"`
Value string `xml:",chardata"`
}
CopyrightStatement struct {
XMLName xml.Name `xml:"copyright-statement"`
Value string `xml:",chardata"`
}
}
Abstract struct {
XMLName xml.Name `xml:"abstract"`
Value string `xml:",innerxml"`
Lang string `xml:"lang,attr"`
}
TranslatedAbstract struct {
XMLName xml.Name `xml:"trans-abstract"`
Lang string `xml:"lang,attr"`
Title struct {
XMLName xml.Name `xml:"title"`
Value string `xml:",innerxml"`
}
}
KeywordGroup struct {
XMLName xml.Name `xml:"kwd-group"`
Title struct {
XMLName xml.Name `xml:"title"`
Value string `xml:",chardata"`
}
Keywords []struct {
Value string `xml:",chardata"`
} `xml:"kwd"`
}
SelfURI struct {
XMLName xml.Name `xml:"self-uri"`
Value string `xml:"href,attr"`
}
CustomMetaGroup struct {
XMLName xml.Name `xml:"custom-meta-group"`
CustomMeta []struct {
Name struct {
XMLName xml.Name `xml:"meta-name"`
Value string `xml:",chardata"`
}
Value struct {
XMLName xml.Name `xml:"meta-value"`
Value string `xml:",chardata"`
}
} `xml:"custom-meta"`
}
}
}
Body struct {
Value string `xml:",innerxml"`
} `xml:"body"`
}
Article mirrors a JATS article element.
func (*Article) Authors ¶
Authors returns the authors as slice. TODO(miku): get rid of cross-format dependency.
func (*Article) CombinedTitle ¶
CombinedTitle returns a longish title.
func (*Article) DOI ¶
DOI is a convenience shortcut to get the DOI. It is an error, if there is no DOI.
func (*Article) Date ¶
Date returns this articles' issuing date in a best effort manner. Use electronic publication (epub), if available.
func (*Article) Identifiers ¶
func (article *Article) Identifiers() (Identifiers, error)
identifiers returns the doi and the dependent url and recordID in a struct. It is an error, if there is no DOI.
func (*Article) JournalTitle ¶
JournalTitle will look in various fields for a journal title.
func (*Article) Languages ¶
Languages returns the given and guessed languages found in abstract and fulltext. Note: This is slow. Skip detection on too short strings.
func (*Article) ToIntermediateSchema ¶
func (article *Article) ToIntermediateSchema() (*finc.IntermediateSchema, error)
ToIntermediateSchema converts a jats article into an internal schema. This is a basic implementation, different source might implement their own.
type Identifiers ¶
identifiers is a helper struct.
type PubDate ¶
type PubDate struct {
Type string `xml:"pub-type,attr"`
Month struct {
XMLName xml.Name `xml:"month"`
Value string `xml:",chardata"`
}
Year struct {
XMLName xml.Name `xml:"year"`
Value string `xml:",chardata"`
}
Day struct {
XMLName xml.Name `xml:"day"`
Value string `xml:",chardata"`
}
}
PubDate represents a publication date. Typical type values are ppub and epub.